1 //===- MCInstrAnalysis.cpp - InstrDesc target hooks -----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCInstrAnalysis.h"
12 #include "llvm/ADT/APInt.h"
13 #include "llvm/MC/MCInst.h"
14 #include "llvm/MC/MCInstrDesc.h"
15 #include "llvm/MC/MCInstrInfo.h"
20 bool MCInstrAnalysis::clearsSuperRegisters(const MCRegisterInfo &MRI,
22 APInt &Writes) const {
23 Writes.clearAllBits();
27 bool MCInstrAnalysis::isDependencyBreaking(const MCSubtargetInfo &STI,
28 const MCInst &Inst) const {
32 bool MCInstrAnalysis::evaluateBranch(const MCInst &Inst, uint64_t Addr,
33 uint64_t Size, uint64_t &Target) const {
34 if (Inst.getNumOperands() == 0 ||
35 Info->get(Inst.getOpcode()).OpInfo[0].OperandType != MCOI::OPERAND_PCREL)
38 int64_t Imm = Inst.getOperand(0).getImm();
39 Target = Addr+Size+Imm;