From a889c12ecc2b657b06dfe4d32aa367bd98911ebe 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 llvm-svn: 237224 --- llvm/lib/Analysis/LoopInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 09045dcf8e72..932b080eb3e0 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;