diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/LoopExtractor.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/PartialInlining.cpp | 9 |
3 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 816fc291dc5..f9de54a173d 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -473,7 +473,8 @@ 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 (BasicBlock *P : predecessors(BB)) { + for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) { + BasicBlock *P = *PI; for (idf_ext_iterator<BasicBlock*, SmallPtrSet<BasicBlock*, 16> > I = idf_ext_begin(P, TranspBlocks), E = idf_ext_end(P, TranspBlocks); I != E; ++I) diff --git a/llvm/lib/Transforms/IPO/LoopExtractor.cpp b/llvm/lib/Transforms/IPO/LoopExtractor.cpp index 3f973c716ff..20414aa05b4 100644 --- a/llvm/lib/Transforms/IPO/LoopExtractor.cpp +++ b/llvm/lib/Transforms/IPO/LoopExtractor.cpp @@ -229,7 +229,9 @@ void BlockExtractorPass::SplitLandingPadPreds(Function *F) { // Look through the landing pad's predecessors. If one of them ends in an // 'invoke', then we want to split the landing pad. bool Split = false; - for (BasicBlock *BB : predecessors(LPad)) { + for (pred_iterator + PI = pred_begin(LPad), PE = pred_end(LPad); PI != PE; ++PI) { + BasicBlock *BB = *PI; if (BB->isLandingPad() && BB != Parent && isa<InvokeInst>(Parent->getTerminator())) { Split = true; diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp index 5957e84ffab..76d6dfa8e88 100644 --- a/llvm/lib/Transforms/IPO/PartialInlining.cpp +++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp @@ -58,12 +58,13 @@ Function* PartialInliner::unswitchFunction(Function* F) { BasicBlock* returnBlock = nullptr; BasicBlock* nonReturnBlock = nullptr; unsigned returnCount = 0; - for (BasicBlock *Succ : successors(entryBlock)) - if (isa<ReturnInst>(Succ->getTerminator())) { - returnBlock = Succ; + for (succ_iterator SI = succ_begin(entryBlock), SE = succ_end(entryBlock); + SI != SE; ++SI) + if (isa<ReturnInst>((*SI)->getTerminator())) { + returnBlock = *SI; returnCount++; } else - nonReturnBlock = Succ; + nonReturnBlock = *SI; if (returnCount != 1) return nullptr; |