1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[ADCE] Convert another loop for a range-based for

We can use a range-based for for the operands loop too; NFC.

llvm-svn: 229319
This commit is contained in:
Hal Finkel 2015-02-15 15:51:25 +00:00
parent bc23b1a680
commit afd400b12e

View File

@ -69,11 +69,11 @@ 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