[llvm] r300292 - Use range-for; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 13 18:33:15 PDT 2017
Author: sanjoy
Date: Thu Apr 13 20:33:15 2017
New Revision: 300292
URL: http://llvm.org/viewvc/llvm-project?rev=300292&view=rev
Log:
Use range-for; NFC
Modified:
llvm/trunk/lib/Analysis/IVUsers.cpp
Modified: llvm/trunk/lib/Analysis/IVUsers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=300292&r1=300291&r2=300292&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IVUsers.cpp (original)
+++ llvm/trunk/lib/Analysis/IVUsers.cpp Thu Apr 13 20:33:15 2017
@@ -76,9 +76,8 @@ static bool isInteresting(const SCEV *S,
// An add is interesting if exactly one of its operands is interesting.
if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(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 *findAddRecF
}
if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(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;
}
More information about the llvm-commits
mailing list