Use Loop::block_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52616 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 3368f2a..cde16e7 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -574,9 +574,10 @@
#if 0
// Now replace all derived expressions in the loop body with simpler
// expressions.
- for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i)
- if (LI->getLoopFor(L->getBlocks()[i]) == L) { // Not in a subloop...
- BasicBlock *BB = L->getBlocks()[i];
+ for (LoopInfo::block_iterator I = L->block_begin(), E = L->block_end();
+ I != E; ++I) {
+ BasicBlock *BB = *I;
+ if (LI->getLoopFor(BB) == L) { // Not in a subloop...
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
if (I->getType()->isInteger() && // Is an integer instruction
!I->use_empty() &&
@@ -593,6 +594,7 @@
}
}
}
+ }
#endif
DeleteTriviallyDeadInstructions(DeadInsts);