mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Don't increment invalid iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42178 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user