Reapply [FastISel][X86] Use XOR to materialize the "0" value (r215594).
[oota-llvm.git] / lib / Transforms / Utils / CloneFunction.cpp
index f148ea17481ed7ca694d9baf76653260c138cd67..5c8f20d5f884161767c0c01cd2b1146c252e1ffe 100644 (file)
@@ -514,8 +514,9 @@ 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 (BasicBlock *Pred : predecessors(NewBB))
-        --PredCount[Pred];
+      for (pred_iterator PI = pred_begin(NewBB), E = pred_end(NewBB);
+           PI != E; ++PI)
+        --PredCount[*PI];
       
       // Figure out how many entries to remove from each PHI.
       for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)