summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCUDA.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaCUDA.cpp')
-rw-r--r--lib/Sema/SemaCUDA.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/Sema/SemaCUDA.cpp b/lib/Sema/SemaCUDA.cpp
index 827eb02bcd..d6c0606674 100644
--- a/lib/Sema/SemaCUDA.cpp
+++ b/lib/Sema/SemaCUDA.cpp
@@ -158,34 +158,6 @@ Sema::IdentifyCUDAPreference(const FunctionDecl *Caller,
llvm_unreachable("All cases should've been handled by now.");
}
-void Sema::EraseUnwantedCUDAMatches(const FunctionDecl *Caller,
- LookupResult &R) {
- if (R.isSingleResult())
- return;
-
- // Gets the CUDA function preference for a call from Caller to Match.
- auto GetCFP = [&](const NamedDecl *D) {
- if (auto *Callee = dyn_cast<FunctionDecl>(D->getUnderlyingDecl()))
- return IdentifyCUDAPreference(Caller, Callee);
- return CFP_Never;
- };
-
- // Find the best call preference among the functions in R.
- CUDAFunctionPreference BestCFP = GetCFP(*std::max_element(
- R.begin(), R.end(), [&](const NamedDecl *D1, const NamedDecl *D2) {
- return GetCFP(D1) < GetCFP(D2);
- }));
-
- // Erase all functions with lower priority.
- auto Filter = R.makeFilter();
- while (Filter.hasNext()) {
- auto *Callee = dyn_cast<FunctionDecl>(Filter.next()->getUnderlyingDecl());
- if (Callee && GetCFP(Callee) < BestCFP)
- Filter.erase();
- }
- Filter.done();
-}
-
template <typename T>
static void EraseUnwantedCUDAMatchesImpl(
Sema &S, const FunctionDecl *Caller, llvm::SmallVectorImpl<T> &Matches,