From 8f47fc8f00fbb1cc2215fc90942b0948e3ca121b Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 22 Oct 2012 23:30:04 +0000 Subject: When a block ends in an indirect branch, add its successors to the machine basic block. The CFG of the machine function needs to know that the targets of the indirect branch are successors to the indirect branch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166448 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMFastISel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Target') diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp index 92248f5..89b85d0 100644 --- a/lib/Target/ARM/ARMFastISel.cpp +++ b/lib/Target/ARM/ARMFastISel.cpp @@ -1388,6 +1388,11 @@ bool ARMFastISel::SelectIndirectBr(const Instruction *I) { unsigned Opc = isThumb2 ? ARM::tBRIND : ARM::BX; AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc)) .addReg(AddrReg)); + + const IndirectBrInst *IB = cast(I); + for (unsigned i = 0, e = IB->getNumSuccessors(); i != e; ++i) + FuncInfo.MBB->addSuccessor(FuncInfo.MBBMap[IB->getSuccessor(i)]); + return true; } -- cgit v1.1