summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 09045dcf8e7..932b080eb3e 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -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;
OpenPOWER on IntegriCloud