This is an archive of the discontinued LLVM Phabricator instance.

[clang] small speed improvement of Sema::AddArgumentDependentLookupCandidates
Needs ReviewPublic

Authored by Kokan on Jun 12 2022, 7:07 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

[clang] Improve speed of Sema::AddArgumentDependentLookupCandidates

The Sema::AddArgumentDependentLookupCandidates compile the list of
overload candidates found via ADL.

Also it makes sure not to include candidates if already found via not
ADL. It achives that distinct list via looping over candidates and
removing them from the ADL candidates(Fns).

When there is no candidate found via ADL, there is no need to loop over
the candidate list as Fns is empty so there is nothing to remove from
that.

Disclaimer: I do not have compile time measurement, but not doing a loop

should be faster.

Diff Detail

Event Timeline

Kokan created this revision.Jun 12 2022, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2022, 7:07 AM
Kokan requested review of this revision.Jun 12 2022, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2022, 7:07 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Kokan updated this revision to Diff 436234.Jun 12 2022, 9:41 AM

clang-format applied

The context of the diff is missing. Please re-run the diff making with -U9999999999999999999.

clang/include/clang/Sema/Lookup.h
817

(void)? LLVM is a C++ project.