Add range adapters predecessors() and successors() for BBs
[oota-llvm.git] / lib / Transforms / IPO / ArgumentPromotion.cpp
index 3282022938676831bacfbea5d21c765ffcbb87f8..7e48ce37bcd691534d4369ef16b29029a68cb615 100644 (file)
@@ -561,8 +561,7 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg,
     // Now check every path from the entry block to the load for transparency.
     // To do this, we perform a depth first search on the inverse CFG from the
     // loading block.
-    for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
-      BasicBlock *P = *PI;
+    for (BasicBlock *P : predecessors(BB)) {
       for (BasicBlock *TranspBB : inverse_depth_first_ext(P, TranspBlocks))
         if (AA.canBasicBlockModify(*TranspBB, Loc))
           return false;