[llvm] r208357 - Use std::remove_if to remove elements from a vector
Tobias Grosser
tobias at grosser.es
Thu May 8 14:32:59 PDT 2014
Author: grosser
Date: Thu May 8 16:32:59 2014
New Revision: 208357
URL: http://llvm.org/viewvc/llvm-project?rev=208357&view=rev
Log:
Use std::remove_if to remove elements from a vector
Suggested-by: Benjamin Kramer <benny.kra at gmail.com>
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=208357&r1=208356&r2=208357&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu May 8 16:32:59 2014
@@ -7224,11 +7224,10 @@ static void findArrayDimensionsRec(Scala
}
// 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);
More information about the llvm-commits
mailing list