Use std::remove_if to remove elements from a vector

Suggested-by: Benjamin Kramer <benny.kra@gmail.com>
llvm-svn: 208357
This commit is contained in:
Tobias Grosser 2014-05-08 21:32:59 +00:00
parent 0b9b36623a
commit b2101c3ca5
1 changed files with 4 additions and 5 deletions

View File

@ -7224,11 +7224,10 @@ static void findArrayDimensionsRec(ScalarEvolution &SE,
}
// Remove all SCEVConstants.
for (unsigned I = 0; I < Terms.size();)
if (isa<SCEVConstant>(Terms[I]))
Terms.erase(Terms.begin() + I);
else
++I;
Terms.erase(
std::remove_if(Terms.begin(), Terms.end(),
[](const SCEV *E) { return isa<SCEVConstant>(E);}),
Terms.end());
if (Terms.size() > 0)
findArrayDimensionsRec(SE, Terms, Sizes, Zero, One);