Skip to content

Commit

Permalink
Revert "SCEV: Use I = vector<>.erase(I) to iterate and delete at the …
Browse files Browse the repository at this point in the history
…same time"

as committed in r208282. The original commit was incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208286 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tobiasgrosser committed May 8, 2014
1 parent 1c2f863 commit f46646d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7223,9 +7223,12 @@ static void findArrayDimensionsRec(ScalarEvolution &SE,
Terms[I] = Q;
}

for (auto I = Terms.begin(), E = Terms.end(); I != E; I++)
if (isa<SCEVConstant>(*I))
I = Terms.erase(I);
// Remove all SCEVConstants.
for (unsigned I = 0; I < Terms.size();)
if (isa<SCEVConstant>(Terms[I]))
Terms.erase(Terms.begin() + I);
else
++I;

if (Terms.size() > 0)
findArrayDimensionsRec(SE, Terms, Sizes, Zero, One);
Expand Down

0 comments on commit f46646d

Please sign in to comment.