summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-19 17:22:29 +0000
committerDan Gohman <gohman@apple.com>2008-06-19 17:22:29 +0000
commit6f880690b81dfbbfaa2226a26280c7c97261b830 (patch)
tree2783e5857333ed6fcc87ad1ace85a4ed6af32e9f /llvm/lib/CodeGen/BranchFolding.cpp
parent68f539e807e4839ca634b93aa2d9a7af7505f10e (diff)
downloadbcm5719-llvm-6f880690b81dfbbfaa2226a26280c7c97261b830.tar.gz
bcm5719-llvm-6f880690b81dfbbfaa2226a26280c7c97261b830.zip
Use the transferSuccessors helper function.
llvm-svn: 52495
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index e67339ab386..f629ae75f3a 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud