1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

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 de5b0a206d
commit 7888d0c465

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);