Use Loop::block_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52616 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-06-22 20:18:58 +00:00
parent 6c459a28ec
commit 9b78763fce
4 changed files with 21 additions and 16 deletions

View File

@ -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);