diff options
author | cor3ntin <corentinjabot@gmail.com> | 2025-04-16 19:09:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-16 19:09:45 +0200 |
commit | facc57fc25d0f05f5834fed421662dbad3ec5b50 (patch) | |
tree | 08592fe2ddd2f4e8c6550f737edff78b448e9243 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | d88a3a36ad26e68281873fab9a35389f6eb5c919 (diff) | |
download | llvm-facc57fc25d0f05f5834fed421662dbad3ec5b50.zip llvm-facc57fc25d0f05f5834fed421662dbad3ec5b50.tar.gz llvm-facc57fc25d0f05f5834fed421662dbad3ec5b50.tar.bz2 |
[Clang][RFC] Bypass TAD during overload resolution if a perfect match exists (#133426)
This implements the same overload resolution behavior as GCC,
as described in https://wg21.link/p3606 (sections 1-2, not 3)
If, during overload resolution, a non-template candidate is always
picked because each argument is a perfect match (i.e., the source and
target types are the same), we do not perform deduction for any template
candidate that might exist.
The goal is to be able to merge #122423 without being too disruptive.
This change means that the selection of the best viable candidate and
template argument deduction become interleaved.
To avoid rewriting half of Clang, we store in `OverloadCandidateSet`
enough information to deduce template candidates from
`OverloadCandidateSet::BestViableFunction`. This means the lifetime of
any object used by the template argument must outlive a call to
`Add*Template*Candidate`.
This two-phase resolution is not performed for some initialization as
there are cases where template candidates are a better match per the
standard. It's also bypassed for code completion.
The change has a nice impact on compile times
https://llvm-compile-time-tracker.com/compare.php?from=edc22c64e527171041876f26a491bb1d03d905d5&to=8170b860bd4b70917005796c05a9be013a95abb2&stat=instructions%3Au
Fixes #62096
Fixes #74581
Fixes #53454
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions