diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-19 17:22:29 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-19 17:22:29 +0000 |
commit | 04478e56f736325d3567e7c0efe2bb5c2766c63b (patch) | |
tree | 719cf325c897c063715eb91c405897f61b98b8c9 /lib/CodeGen/BranchFolding.cpp | |
parent | f3dc70092c073acc0bdfe6aa77979116f34e6b51 (diff) |
Use the transferSuccessors helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index e67339ab38..f629ae75f3 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -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); |