From 8626ed2eae325e6693de604e56345e0fa9e0f54f Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Sun, 15 Feb 2015 15:51:25 +0000 Subject: [PATCH] [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 --- llvm/lib/Transforms/Scalar/ADCE.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index effd87e..f490bb2 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -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(OI)) if (Alive.insert(Inst).second) Worklist.push_back(Inst); + } } // The inverse of the live set is the dead set. These are those instructions -- 2.7.4