[llvm] r259325 - use range-based for loop; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 31 08:34:48 PST 2016


Author: spatel
Date: Sun Jan 31 10:34:48 2016
New Revision: 259325

URL: http://llvm.org/viewvc/llvm-project?rev=259325&view=rev
Log:
use range-based for loop; NFC

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h?rev=259325&r1=259324&r2=259325&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h Sun Jan 31 10:34:48 2016
@@ -458,9 +458,9 @@ public:
     // Make sure that we reprocess all operands now that we reduced their
     // use counts.
     if (I.getNumOperands() < 8) {
-      for (User::op_iterator i = I.op_begin(), e = I.op_end(); i != e; ++i)
-        if (Instruction *Op = dyn_cast<Instruction>(*i))
-          Worklist.Add(Op);
+      for (Use &Operand : I.operands())
+        if (auto *Inst = dyn_cast<Instruction>(Operand))
+          Worklist.Add(Inst);
     }
     Worklist.Remove(&I);
     I.eraseFromParent();




More information about the llvm-commits mailing list