summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-21 20:21:19 +0000
committerDan Gohman <gohman@apple.com>2008-06-21 20:21:19 +0000
commit55083d5dd3f96c64bae13b998463c813167b0cc5 (patch)
treebf9d8d299bab5149bf48d0342455f90bf69118aa /llvm/lib/Target/PowerPC/PPCISelLowering.cpp
parent5a92bab4f0e59be836f307f3a7d3b22f46663e7f (diff)
downloadbcm5719-llvm-55083d5dd3f96c64bae13b998463c813167b0cc5.tar.gz
bcm5719-llvm-55083d5dd3f96c64bae13b998463c813167b0cc5.zip
Use MachineBasicBlock::transferSuccessors.
llvm-svn: 52594
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index beb03d0e598..000cfc3f2cd 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -4018,15 +4018,10 @@ PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
MachineFunction *F = BB->getParent();
F->getBasicBlockList().insert(It, copy0MBB);
F->getBasicBlockList().insert(It, sinkMBB);
- // Update machine-CFG edges by first adding all successors of the current
+ // Update machine-CFG edges by transferring all successors of the current
// block to the new block which will contain the Phi node for the select.
- for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
- e = BB->succ_end(); i != e; ++i)
- sinkMBB->addSuccessor(*i);
- // Next, remove all successors of the current block, and add the true
- // and fallthrough blocks as its successors.
- while(!BB->succ_empty())
- BB->removeSuccessor(BB->succ_begin());
+ sinkMBB->transferSuccessors(BB);
+ // Next, add the true and fallthrough blocks as its successors.
BB->addSuccessor(copy0MBB);
BB->addSuccessor(sinkMBB);
OpenPOWER on IntegriCloud