diff options
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/IR/Dominators.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index 8ddcf25fced..ba07433103b 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -321,9 +321,10 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) { // successors. If there were PHI nodes in the successors, then they need to // know that incoming branches will be from New, not from Old. // - for (BasicBlock *Successor : successors(New)) { + for (succ_iterator I = succ_begin(New), E = succ_end(New); I != E; ++I) { // Loop over any phi nodes in the basic block, updating the BB field of // incoming values... + BasicBlock *Successor = *I; PHINode *PN; for (BasicBlock::iterator II = Successor->begin(); (PN = dyn_cast<PHINode>(II)); ++II) { diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index f45543a4e71..d6649d6c706 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -179,7 +179,9 @@ bool DominatorTree::dominates(const BasicBlockEdge &BBE, // trivially dominates itself, so we only have to find if it dominates the // other predecessors. Since the only way out of X is via NormalDest, X can // only properly dominate a node if NormalDest dominates that node too. - for (const BasicBlock *BB : predecessors(End)) { + for (const_pred_iterator PI = pred_begin(End), E = pred_end(End); + PI != E; ++PI) { + const BasicBlock *BB = *PI; if (BB == Start) continue; diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 5b7a3475574..9cf911b51a4 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -2107,8 +2107,8 @@ void Verifier::visitLandingPadInst(LandingPadInst &LPI) { // The landingpad instruction defines its parent as a landing pad block. The // landing pad block may be branched to only by the unwind edge of an invoke. - for (BasicBlock *Pred : predecessors(BB)) { - const InvokeInst *II = dyn_cast<InvokeInst>(Pred->getTerminator()); + for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) { + const InvokeInst *II = dyn_cast<InvokeInst>((*I)->getTerminator()); Assert1(II && II->getUnwindDest() == BB && II->getNormalDest() != BB, "Block containing LandingPadInst must be jumped to " "only by the unwind edge of an invoke.", &LPI); |