From c6c9f358047ee9737ae1f7ca2905c7eebbbd23ec Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Wed, 13 May 2015 01:12:09 +0000 Subject: [PATCH] Change a loop in LoopInfo to foreach. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237224 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/LoopInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 09045dcf8e7..932b080eb3e 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/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; -- 2.34.1