This is an archive of the discontinued LLVM Phabricator instance.

[clang] Instantiate concepts with sugared template arguments
ClosedPublic

Authored by mizvekov on Oct 23 2022, 1:55 PM.

Details

Summary

Since we don't unique specializations for concepts, we can just instantiate
them with the sugared template arguments, at negligible cost.

If we don't track their specializations, we can't resugar them later
anyway, and that would be more expensive than just instantiating them
sugared in the first place since it would require an additional pass.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Diff Detail

Event Timeline

mizvekov created this revision.Oct 23 2022, 1:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 1:55 PM
mizvekov requested review of this revision.Oct 23 2022, 1:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 1:55 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mizvekov added reviewers: davrec, Restricted Project.Oct 23 2022, 2:53 PM
erichkeane accepted this revision.Oct 24 2022, 6:28 AM
erichkeane added a subscriber: erichkeane.

This is an improvement, thanks!

clang/lib/Sema/SemaConcept.cpp
1079

Comment here should be "RelativeToPrimary=" I think.

This revision is now accepted and ready to land.Oct 24 2022, 6:28 AM
mizvekov added inline comments.Oct 24 2022, 6:34 AM
clang/lib/Sema/SemaConcept.cpp
1079

This is a new parameter introduced in D134604, you would have to read that dependency first to figure that out :)
I forgot to mention that on the description of this patch.

erichkeane added inline comments.Oct 24 2022, 6:42 AM
clang/lib/Sema/SemaConcept.cpp
1079

Ah!

See @aaron.ballman 's comment here: https://github.com/llvm/llvm-project/issues/59271

Since the release branch is pending, if we don't have a solution or a revert by the 13th, Aaron or I will revert this patch.