diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-05-10 17:47:18 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-05-10 17:47:18 +0000 |
commit | 8cff45aa203add648ffdf0b08c695c07cff37b5a (patch) | |
tree | 31bb9a60906564340910b5313ec4d3c2e45ddbc0 /llvm/lib | |
parent | 77c76c54fc6d7f010ee5f9f373d2c778346cae20 (diff) | |
download | bcm5719-llvm-8cff45aa203add648ffdf0b08c695c07cff37b5a.tar.gz bcm5719-llvm-8cff45aa203add648ffdf0b08c695c07cff37b5a.zip |
SCEV: Use range-based for loop and fold variable into assert.
llvm-svn: 208476
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index f065d851a00..5f06e8238c9 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -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. |