[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges.
[oota-llvm.git] / lib / Transforms / Utils / CloneFunction.cpp
index 5c8f20d5f884161767c0c01cd2b1146c252e1ffe..f148ea17481ed7ca694d9baf76653260c138cd67 100644 (file)
@@ -514,9 +514,8 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
       assert(NumPreds < PN->getNumIncomingValues());
       // Count how many times each predecessor comes to this block.
       std::map<BasicBlock*, unsigned> PredCount;
-      for (pred_iterator PI = pred_begin(NewBB), E = pred_end(NewBB);
-           PI != E; ++PI)
-        --PredCount[*PI];
+      for (BasicBlock *Pred : predecessors(NewBB))
+        --PredCount[Pred];
       
       // Figure out how many entries to remove from each PHI.
       for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)