This is an archive of the discontinued LLVM Phabricator instance.

[lldb][TypeSystemClang][NFC] Introduce TemplateParameterInfos::ArgumentMetadata
AbandonedPublic

Authored by Michael137 on Dec 17 2022, 9:51 AM.

Details

Reviewers
aprantl
labath
Summary

This patch creates a new aggregate type that holds
information about a template argument. Currently this
is only its name but in future patches we plan to add
additional information.

Diff Detail

Event Timeline

Michael137 created this revision.Dec 17 2022, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2022, 9:51 AM
Michael137 requested review of this revision.Dec 17 2022, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2022, 9:51 AM
labath accepted this revision.Dec 19 2022, 1:17 AM
labath added inline comments.
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
334

This may depend on where you're going with this, but right now it seems like this const here is overkill, as one can express the notion of "const metadata" by making the whole ArgumentMetadata class const.

That obviously won't work if your actual goal is to have some kind of "mutable" metadata, but then I'd like to hear more about what is that going to be used for.

This revision is now accepted and ready to land.Dec 19 2022, 1:17 AM
Michael137 added inline comments.Dec 19 2022, 2:25 AM
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
334

Fair point

The use-case is the follow-up PR here: https://reviews.llvm.org/D140262 which is still WIP

Depending on whether that works out we may or may not need this patch here in the first place. So I'm holding off of committing it for now

334
labath added inline comments.Dec 19 2022, 4:45 AM
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
334

Storing the is_default flag here makes sense to me, but I feel the same way about it's constness as I feel about the name field. Since ArgumentMetadata is just a dumb container, I don't think it makes sense enforcing constness at this level. If we want to, we can always make individual instances of this struct const as a whole.

Not needed anymore due to simpler implementation at https://reviews.llvm.org/D141828

Michael137 abandoned this revision.Jan 26 2023, 7:40 AM