Change a loop in LoopInfo to foreach. NFC
[oota-llvm.git] / lib / Analysis / LoopInfo.cpp
index 09045dcf8e72614337bc6af31430026e6fd3bedd..932b080eb3e0a83451d6535b9cf82d1327cdb41e 100644 (file)
@@ -65,8 +65,8 @@ bool Loop::isLoopInvariant(const Value *V) const {
 /// 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;