This is an archive of the discontinued LLVM Phabricator instance.

[clang] Added Attr::getVariety function
AbandonedPublic

Authored by strimo378 on Aug 8 2023, 4:58 AM.

Details

Reviewers
aaron.ballman
Summary

The commit extends ClangAttrEmitter of tablegen to generate Attr*::getVariety() functions. The functions returns the variety of the attribute as an enum. I'll use the function in a follow up commit to improve the output of function attributes for ast-print.

Diff Detail

Event Timeline

strimo378 created this revision.Aug 8 2023, 4:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 4:58 AM
strimo378 requested review of this revision.Aug 8 2023, 4:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 4:58 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
strimo378 edited the summary of this revision. (Show Details)Aug 8 2023, 5:00 AM
aaron.ballman added inline comments.Aug 8 2023, 9:08 AM
clang/include/clang/AST/Attr.h
87–99

I don't think either of these are needed -- Attr inherits from AttributeCommonInfo and that base class already has AttributeCommonInfo::getSyntax() for getting this information. Will that work for your needs?

strimo378 abandoned this revision.Aug 8 2023, 2:17 PM

@aaron.ballman Thank you for the information. Strange that I missed that ... I even used the function somewhere else o_O

strimo378 updated this revision to Diff 548482.Aug 8 2023, 11:58 PM

Using Attr::getSyntax (instead of unnecessary added Attr::getVariety)

strimo378 abandoned this revision.Aug 9 2023, 12:25 AM

Unnecessary