}
// Otherwise, this is an unvisited intra-loop node. Check all successors.
- for (BasicBlock *Succ : successors(BB)) {
+ for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI) {
// Check to see if the successor is a trivial loop exit.
- if (!isTrivialLoopExitBlockHelper(L, Succ, ExitBB, Visited))
+ if (!isTrivialLoopExitBlockHelper(L, *SI, ExitBB, Visited))
return false;
}
PHINode *PN = PHINode::Create(LPad->getType(), 0, "",
ExitSucc->getFirstInsertionPt());
- for (BasicBlock *BB : predecessors(ExitSucc)) {
+ for (pred_iterator I = pred_begin(ExitSucc), E = pred_end(ExitSucc);
+ I != E; ++I) {
+ BasicBlock *BB = *I;
LandingPadInst *LPI = BB->getLandingPadInst();
LPI->replaceAllUsesWith(PN);
PN->addIncoming(LPI, BB);