Update the MachineBasicBlock CFG for an indirect branch.

llvm-svn: 85325
This commit is contained in:
Dan Gohman 2009-10-27 22:10:34 +00:00
parent 876387ba4f
commit a5e078b677
1 changed files with 4 additions and 0 deletions

View File

@ -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())));