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 | 6f880690b81dfbbfaa2226a26280c7c97261b830 (patch) | |
tree | 2783e5857333ed6fcc87ad1ace85a4ed6af32e9f /llvm/lib/CodeGen/BranchFolding.cpp | |
parent | 68f539e807e4839ca634b93aa2d9a7af7505f10e (diff) | |
download | bcm5719-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.cpp | 6 |
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); |