mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
simplify this logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d2f0db1b19
commit
cb03f8547d
@ -39,12 +39,14 @@ namespace {
|
||||
DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {}
|
||||
virtual bool runOnBasicBlock(BasicBlock &BB) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); )
|
||||
if (dceInstruction(DI)) {
|
||||
for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) {
|
||||
Instruction *Inst = DI++;
|
||||
if (isInstructionTriviallyDead(Inst)) {
|
||||
Inst->eraseFromParent();
|
||||
Changed = true;
|
||||
++DIEEliminated;
|
||||
} else
|
||||
++DI;
|
||||
}
|
||||
}
|
||||
return Changed;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user