class ARMMCInstrAnalysis : public MCInstrAnalysis {
public:
ARMMCInstrAnalysis(const MCInstrInfo *Info) : MCInstrAnalysis(Info) {}
- virtual bool isBranch(const MCInst &Inst) const {
- // Don't flag "bx lr" as a branch.
- return MCInstrAnalysis::isBranch(Inst) && (Inst.getOpcode() != ARM::BX ||
- Inst.getOperand(0).getReg() != ARM::LR);
- }
virtual bool isUnconditionalBranch(const MCInst &Inst) const {
// BCCs with the "always" predicate are unconditional branches.
return MCInstrAnalysis::isConditionalBranch(Inst);
}
- virtual bool isReturn(const MCInst &Inst) const {
- // Recognize "bx lr" as return.
- return Inst.getOpcode() == ARM::BX && Inst.getOperand(0).getReg()==ARM::LR;
- }
-
uint64_t evaluateBranch(const MCInst &Inst, uint64_t Addr,
uint64_t Size) const {
// We only handle PCRel branches for now.