SCEV: Use range-based for loop and fold variable into assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2014-05-10 17:47:18 +00:00
parent e87cadc49a
commit bfd5dad4c9

View File

@ -7214,14 +7214,12 @@ static void findArrayDimensionsRec(ScalarEvolution &SE,
return;
}
const SCEV *Zero = SE.getConstant(GCD->getType(), 0);
for (unsigned I = 0; I < Terms.size(); ++I) {
for (const SCEV *&Term : Terms) {
// Normalize the terms before the next call to findArrayDimensionsRec.
const SCEV *Q, *R;
SCEVDivision::divide(SE, Terms[I], GCD, &Q, &R);
assert(R == Zero && "GCD does not evenly divide one of the terms");
Terms[I] = Q;
SCEVDivision::divide(SE, Term, GCD, &Q, &R);
assert(R->isZero() && "GCD does not evenly divide one of the terms");
Term = Q;
}
// Remove all SCEVConstants.