[llvm-commits] [llvm] r85325 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Dan Gohman gohman at apple.com
Tue Oct 27 15:10:35 PDT 2009


Author: djg
Date: Tue Oct 27 17:10:34 2009
New Revision: 85325

URL: http://llvm.org/viewvc/llvm-project?rev=85325&view=rev
Log:
Update the MachineBasicBlock CFG for an indirect branch.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=85325&r1=85324&r2=85325&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Oct 27 17:10:34 2009
@@ -2132,6 +2132,10 @@
 }
 
 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())));





More information about the llvm-commits mailing list