From: Sanjoy Das Date: Fri, 14 Apr 2017 01:33:15 +0000 (+0000) Subject: Use range-for; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96ed2063265049a4c308c260b2c3110872e0c477;p=llvm Use range-for; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300292 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp index a661b0101e6..4b7d15b5364 100644 --- a/lib/Analysis/IVUsers.cpp +++ b/lib/Analysis/IVUsers.cpp @@ -76,9 +76,8 @@ static bool isInteresting(const SCEV *S, const Instruction *I, const Loop *L, // An add is interesting if exactly one of its operands is interesting. if (const SCEVAddExpr *Add = dyn_cast(S)) { bool AnyInterestingYet = false; - for (SCEVAddExpr::op_iterator OI = Add->op_begin(), OE = Add->op_end(); - OI != OE; ++OI) - if (isInteresting(*OI, I, L, SE, LI)) { + for (const auto *Op : Add->operands()) + if (isInteresting(Op, I, L, SE, LI)) { if (AnyInterestingYet) return false; AnyInterestingYet = true; @@ -353,9 +352,8 @@ static const SCEVAddRecExpr *findAddRecForLoop(const SCEV *S, const Loop *L) { } if (const SCEVAddExpr *Add = dyn_cast(S)) { - for (SCEVAddExpr::op_iterator I = Add->op_begin(), E = Add->op_end(); - I != E; ++I) - if (const SCEVAddRecExpr *AR = findAddRecForLoop(*I, L)) + for (const auto *Op : Add->operands()) + if (const SCEVAddRecExpr *AR = findAddRecForLoop(Op, L)) return AR; return nullptr; }