Use iterators instead of indices in a few more places.

llvm-svn: 111143
This commit is contained in:
Dan Gohman 2010-08-16 16:27:53 +00:00
parent f29618236e
commit 74c61503b1
1 changed files with 9 additions and 6 deletions

View File

@ -1343,8 +1343,9 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
// If HasNSW is true and all the operands are non-negative, infer HasNUW.
if (!HasNUW && HasNSW) {
bool All = true;
for (unsigned i = 0, e = Ops.size(); i != e; ++i)
if (!isKnownNonNegative(Ops[i])) {
for (SmallVectorImpl<const SCEV *>::const_iterator I = Ops.begin(),
E = Ops.end(); I != E; ++I)
if (!isKnownNonNegative(*I)) {
All = false;
break;
}
@ -1707,8 +1708,9 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
// If HasNSW is true and all the operands are non-negative, infer HasNUW.
if (!HasNUW && HasNSW) {
bool All = true;
for (unsigned i = 0, e = Ops.size(); i != e; ++i)
if (!isKnownNonNegative(Ops[i])) {
for (SmallVectorImpl<const SCEV *>::const_iterator I = Ops.begin(),
E = Ops.end(); I != E; ++I)
if (!isKnownNonNegative(*I)) {
All = false;
break;
}
@ -2040,8 +2042,9 @@ ScalarEvolution::getAddRecExpr(SmallVectorImpl<const SCEV *> &Operands,
// If HasNSW is true and all the operands are non-negative, infer HasNUW.
if (!HasNUW && HasNSW) {
bool All = true;
for (unsigned i = 0, e = Operands.size(); i != e; ++i)
if (!isKnownNonNegative(Operands[i])) {
for (SmallVectorImpl<const SCEV *>::const_iterator I = Operands.begin(),
E = Operands.end(); I != E; ++I)
if (!isKnownNonNegative(*I)) {
All = false;
break;
}