r290991 - [Sema] Replace remove_if+erase with erase_if. NFC.

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 11:16:29 PST 2017


Author: gbiv
Date: Wed Jan  4 13:16:29 2017
New Revision: 290991

URL: http://llvm.org/viewvc/llvm-project?rev=290991&view=rev
Log:
[Sema] Replace remove_if+erase with erase_if. NFC.

Modified:
    cfe/trunk/lib/Sema/SemaCUDA.cpp
    cfe/trunk/lib/Sema/SemaOverload.cpp

Modified: cfe/trunk/lib/Sema/SemaCUDA.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCUDA.cpp?rev=290991&r1=290990&r2=290991&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCUDA.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCUDA.cpp Wed Jan  4 13:16:29 2017
@@ -228,10 +228,8 @@ void Sema::EraseUnwantedCUDAMatches(
       [&](const Pair &M1, const Pair &M2) { return GetCFP(M1) < GetCFP(M2); }));
 
   // Erase all functions with lower priority.
-  Matches.erase(
-      llvm::remove_if(
-          Matches, [&](const Pair &Match) { return GetCFP(Match) < BestCFP; }),
-      Matches.end());
+  llvm::erase_if(Matches,
+                 [&](const Pair &Match) { return GetCFP(Match) < BestCFP; });
 }
 
 /// When an implicitly-declared special member has to invoke more than one

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=290991&r1=290990&r2=290991&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed Jan  4 13:16:29 2017
@@ -8958,9 +8958,7 @@ OverloadCandidateSet::BestViableFunction
                S.IdentifyCUDAPreference(Caller, Cand->Function) ==
                    Sema::CFP_WrongSide;
       };
-      Candidates.erase(std::remove_if(Candidates.begin(), Candidates.end(),
-                                      IsWrongSideCandidate),
-                       Candidates.end());
+      llvm::erase_if(Candidates, IsWrongSideCandidate);
     }
   }
 




More information about the cfe-commits mailing list