Use the transferSuccessors helper function.

llvm-svn: 52495
This commit is contained in:
Dan Gohman 2008-06-19 17:22:29 +00:00
parent 68f539e807
commit 6f880690b8
1 changed files with 1 additions and 5 deletions

View File

@ -381,11 +381,7 @@ MachineBasicBlock *BranchFolder::SplitMBBAt(MachineBasicBlock &CurMBB,
CurMBB.getParent()->getBasicBlockList().insert(++MBBI, NewMBB);
// Move all the successors of this block to the specified block.
while (!CurMBB.succ_empty()) {
MachineBasicBlock *S = *(CurMBB.succ_end()-1);
NewMBB->addSuccessor(S);
CurMBB.removeSuccessor(S);
}
NewMBB->transferSuccessors(&CurMBB);
// Add an edge from CurMBB to NewMBB for the fall-through.
CurMBB.addSuccessor(NewMBB);