[PATCH] D127599: [clang] small speed improvement of Sema::AddArgumentDependentLookupCandidates
Kókai Péter via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 12 09:41:23 PDT 2022
Kokan updated this revision to Diff 436234.
Kokan added a comment.
clang-format applied
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127599/new/
https://reviews.llvm.org/D127599
Files:
clang/include/clang/Sema/Lookup.h
clang/lib/Sema/SemaOverload.cpp
Index: clang/lib/Sema/SemaOverload.cpp
===================================================================
--- clang/lib/Sema/SemaOverload.cpp
+++ clang/lib/Sema/SemaOverload.cpp
@@ -9389,6 +9389,9 @@
// FIXME: Pass in the explicit template arguments?
ArgumentDependentLookup(Name, Loc, Args, Fns);
+ if (Fns.empty())
+ return;
+
// Erase all of the candidates we already knew about.
for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
CandEnd = CandidateSet.end();
Index: clang/include/clang/Sema/Lookup.h
===================================================================
--- clang/include/clang/Sema/Lookup.h
+++ clang/include/clang/Sema/Lookup.h
@@ -814,6 +814,8 @@
Decls.erase(cast<NamedDecl>(D->getCanonicalDecl()));
}
+ bool empty(void) { return Decls.empty(); }
+
using iterator =
llvm::mapped_iterator<decltype(Decls)::iterator, select_second>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127599.436234.patch
Type: text/x-patch
Size: 942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220612/5856a095/attachment.bin>
More information about the cfe-commits
mailing list