diff options
author | Justin Lebar <jlebar@google.com> | 2016-07-12 23:23:13 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-07-12 23:23:13 +0000 |
commit | e71c08f84c1a5cc12ef6db728b095d9577b61132 (patch) | |
tree | 31e4f1ea9511c1295307bde5bd8316f9c130e492 /clang/lib/Sema/SemaCUDA.cpp | |
parent | 4c2c6fd1c4e59aa8f099fd21cbc4ca07a52b45f2 (diff) | |
download | bcm5719-llvm-e71c08f84c1a5cc12ef6db728b095d9577b61132.tar.gz bcm5719-llvm-e71c08f84c1a5cc12ef6db728b095d9577b61132.zip |
[CUDA] Use the multi-element remove function in EraseUnwantedCUDAMatches.
Summary:
Bug pointed out by Benjamin Kramer in r264008. I think the bug is
benign because by the time this is called, we should only have at most
two overloads to consider (either a host and a device overload, or a
host+device overload, but not all three).
Reviewers: tra
Subscribers: cfe-commits, bkramer
Differential Revision: http://reviews.llvm.org/D21914
llvm-svn: 275233
Diffstat (limited to 'clang/lib/Sema/SemaCUDA.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCUDA.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaCUDA.cpp b/clang/lib/Sema/SemaCUDA.cpp index 7e201f4dae6..90af6d5a927 100644 --- a/clang/lib/Sema/SemaCUDA.cpp +++ b/clang/lib/Sema/SemaCUDA.cpp @@ -163,8 +163,10 @@ static void EraseUnwantedCUDAMatchesImpl( [&](const T &M1, const T &M2) { return GetCFP(M1) < GetCFP(M2); })); // Erase all functions with lower priority. - Matches.erase(llvm::remove_if( - Matches, [&](const T &Match) { return GetCFP(Match) < BestCFP; })); + Matches.erase( + llvm::remove_if(Matches, + [&](const T &Match) { return GetCFP(Match) < BestCFP; }), + Matches.end()); } void Sema::EraseUnwantedCUDAMatches(const FunctionDecl *Caller, |