1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Don't increment invalid iterator.

llvm-svn: 42178
This commit is contained in:
Devang Patel 2007-09-20 23:01:50 +00:00
parent 425fe2a97b
commit 57b0b31257

View File

@ -928,8 +928,9 @@ void LoopIndexSplit::removeBlocks(BasicBlock *DeadBB, Loop *LP,
while (!WorkList.empty()) { while (!WorkList.empty()) {
BasicBlock *BB = WorkList.back(); WorkList.pop_back(); BasicBlock *BB = WorkList.back(); WorkList.pop_back();
for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end(); for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end();
BBI != BBE; ++BBI) { BBI != BBE; ) {
Instruction *I = BBI; Instruction *I = BBI;
++BBI;
I->replaceAllUsesWith(UndefValue::get(I->getType())); I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent(); I->eraseFromParent();
} }