The new ARM disassembler disassembles "bx lr" as a special BX_ret instruction so target specific analysis isn't needed anymore.

llvm-svn: 137151
This commit is contained in:
Benjamin Kramer 2011-08-09 21:34:19 +00:00
parent 2443a29f51
commit ed2b147693

View File

@ -165,11 +165,6 @@ namespace {
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.
@ -185,11 +180,6 @@ public:
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.