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 | f995c02abcd8025b13cbc08e38837acaed49cbb4 (patch) | |
tree | 719cf325c897c063715eb91c405897f61b98b8c9 /lib/CodeGen/BranchFolding.cpp | |
parent | 5df079389d99b6c186c7bb98147fdf057cb4dbdc (diff) | |
download | external_llvm-f995c02abcd8025b13cbc08e38837acaed49cbb4.zip external_llvm-f995c02abcd8025b13cbc08e38837acaed49cbb4.tar.gz external_llvm-f995c02abcd8025b13cbc08e38837acaed49cbb4.tar.bz2 |
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 e67339a..f629ae7 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); |