diff options
| author | Bill Wendling <isanbard@gmail.com> | 2012-10-22 23:30:04 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2012-10-22 23:30:04 +0000 |
| commit | 12cda50f1f043a3b8d41dbd8c5becdbd8fe16b6d (patch) | |
| tree | 48e7ba27ad4877337189821104e1d5fc3a929ecd /llvm/lib | |
| parent | 4750b77ea119a9367ec4ae180e4003c7ebc8b16a (diff) | |
| download | bcm5719-llvm-12cda50f1f043a3b8d41dbd8c5becdbd8fe16b6d.tar.gz bcm5719-llvm-12cda50f1f043a3b8d41dbd8c5becdbd8fe16b6d.zip | |
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.
<rdar://problem/12529625>
llvm-svn: 166448
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMFastISel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index 92248f53178..89b85d09b72 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/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<IndirectBrInst>(I); + for (unsigned i = 0, e = IB->getNumSuccessors(); i != e; ++i) + FuncInfo.MBB->addSuccessor(FuncInfo.MBBMap[IB->getSuccessor(i)]); + return true; } |

