mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
[ADCE] Convert another loop for a range-based for
We can use a range-based for for the operands loop too; NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229319 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f0a9df3e3
commit
962ebd4f23
@ -69,12 +69,12 @@ bool ADCE::runOnFunction(Function& F) {
|
||||
// Propagate liveness backwards to operands.
|
||||
while (!Worklist.empty()) {
|
||||
Instruction *Curr = Worklist.pop_back_val();
|
||||
for (Instruction::op_iterator OI = Curr->op_begin(), OE = Curr->op_end();
|
||||
OI != OE; ++OI)
|
||||
for (Use &OI : Curr->operands()) {
|
||||
if (Instruction *Inst = dyn_cast<Instruction>(OI))
|
||||
if (Alive.insert(Inst).second)
|
||||
Worklist.push_back(Inst);
|
||||
}
|
||||
}
|
||||
|
||||
// The inverse of the live set is the dead set. These are those instructions
|
||||
// which have no side effects and do not influence the control flow or return
|
||||
|
Loading…
Reference in New Issue
Block a user