summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-27 22:10:34 +0000
committerDan Gohman <gohman@apple.com>2009-10-27 22:10:34 +0000
commiteef55dc3fdebf915128e5d3848f372c7db6c38e8 (patch)
tree4a20585f2e34ab70e922ac58acb17f9c486fbdbc
parent64825153a219b40bcdb79861fb6ac4fd8eadd616 (diff)
downloadllvm-eef55dc3fdebf915128e5d3848f372c7db6c38e8.tar.gz
llvm-eef55dc3fdebf915128e5d3848f372c7db6c38e8.tar.bz2
llvm-eef55dc3fdebf915128e5d3848f372c7db6c38e8.tar.xz
Update the MachineBasicBlock CFG for an indirect branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85325 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index d68d2487d3..fe95c757e6 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -2132,6 +2132,10 @@ void SelectionDAGLowering::visitSwitch(SwitchInst &SI) {
}
void SelectionDAGLowering::visitIndBr(IndBrInst &I) {
+ // Update machine-CFG edges.
+ for (unsigned i = 0, e = I.getNumSuccessors(); i != e; ++i)
+ CurMBB->addSuccessor(FuncInfo.MBBMap[I.getSuccessor(i)]);
+
DAG.setRoot(DAG.getNode(ISD::BRIND, getCurDebugLoc(),
MVT::Other, getControlRoot(),
getValue(I.getAddress())));