[llvm] r237224 - Change a loop in LoopInfo to foreach. NFC
    Pete Cooper 
    peter_cooper at apple.com
       
    Tue May 12 18:12:09 PDT 2015
    
    
  
Author: pete
Date: Tue May 12 20:12:09 2015
New Revision: 237224
URL: http://llvm.org/viewvc/llvm-project?rev=237224&view=rev
Log:
Change a loop in LoopInfo to foreach.  NFC
Modified:
    llvm/trunk/lib/Analysis/LoopInfo.cpp
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=237224&r1=237223&r2=237224&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Tue May 12 20:12:09 2015
@@ -65,8 +65,8 @@ bool Loop::isLoopInvariant(const Value *
 /// hasLoopInvariantOperands - Return true if all the operands of the
 /// specified instruction are loop invariant.
 bool Loop::hasLoopInvariantOperands(const Instruction *I) const {
-  for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
-    if (!isLoopInvariant(I->getOperand(i)))
+  for (auto &Op : I->operands())
+    if (!isLoopInvariant(Op))
       return false;
 
   return true;
    
    
More information about the llvm-commits
mailing list