diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-22 20:18:58 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-22 20:18:58 +0000 |
commit | 9b78763fce4cb418e7a2e672efb84bac25559b79 (patch) | |
tree | 90a44f398721452d6cbb3a0545c44360db304b7c /lib/Transforms/Scalar/IndVarSimplify.cpp | |
parent | 6c459a28ecb8d33e4b59ab2db1f9a58a2d06824b (diff) |
Use Loop::block_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 3368f2acd7..cde16e7473 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -574,9 +574,10 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { #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 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { } } } + } #endif DeleteTriviallyDeadInstructions(DeadInsts); |