Fix spelling and grammar in a comment.
[oota-llvm.git] / lib / Target / PowerPC / PPCISelLowering.cpp
index beb03d0e5980fed72e63cbc3de58c1786b1dc053..d4f824108be1123130c36cde15fc29c1642bf92c 100644 (file)
@@ -18,7 +18,6 @@
 #include "PPCPerfectShuffle.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/VectorExtras.h"
-#include "llvm/Analysis/ScalarEvolutionExpressions.h"
 #include "llvm/CodeGen/CallingConvLower.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
@@ -4018,15 +4017,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);