[PATCH] D31343: Add an attribute plugin example

2020-03-26 Thread John Brawn via Phabricator via cfe-commits
john.brawn added a comment. Release note added: https://reviews.llvm.org/rG0cff81cff05d Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.llvm.org/D31343 ___ cfe-commits mailing

[PATCH] D31343: Add an attribute plugin example

2020-03-25 Thread John Brawn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3f03c12a51be: Add an attribute plugin example (authored by john.brawn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.llvm.org/D3

[PATCH] D31343: Add an attribute plugin example

2020-03-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think this was the last remaining review for the feature to support attributes as plugins, yes? If so, can you please add a release note about the feature to the release notes? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.ll

[PATCH] D31343: Add an attribute plugin example

2020-03-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.llvm.org/D31343 ___ cfe-commits

[PATCH] D31343: Add an attribute plugin example

2020-03-24 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 252309. john.brawn added a comment. A few small changes: - Don't start C++11 spelling with :: (changes to name normalisation to allow this are in D76704 ) - Don't check that the Decl is null in diagAppertainsToDecl - Retur

[PATCH] D31343: Add an attribute plugin example

2020-03-23 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D31343#1937588 , @aaron.ballman wrote: > In D31343#1936810 , @Jasmin wrote: > > > Hello John! > > > > I was encouraged by Erich after a talk I had with him and Aaron on IRC to > > co

[PATCH] D31343: Add an attribute plugin example

2020-03-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D31343#1936810 , @Jasmin wrote: > Hello John! > > I was encouraged by Erich after a talk I had with him and Aaron on IRC to > contact you about an use case for this plugin. > > I wanted to use user-specified/unknown attri

[PATCH] D31343: Add an attribute plugin example

2020-03-23 Thread Jasmin Fazlic via Phabricator via cfe-commits
Jasmin added a comment. Hello John! I was encouraged by Erich after a talk I had with him and Aaron on IRC to contact you about an use case for this plugin. I wanted to use user-specified/unknown attributes to annotate code and was told that they are not propagated through the AST and therefor

[PATCH] D31343: Add an attribute plugin example

2020-03-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/examples/Attribute/Attribute.cpp:35 +Spellings.push_back({ParsedAttr::AS_GNU, "example"}); +Spellings.push_back({ParsedAttr::AS_CXX11, "::example"}); +Spellings.push_back({ParsedAttr::AS_CXX11, "plugin::example"})

[PATCH] D31343: Add an attribute plugin example

2020-03-18 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 251114. john.brawn added a comment. Updated to match the changes to D31342 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.llvm.org/D31343 Files: clang/docs/ClangPlugins.rst clang/ex

[PATCH] D31343: Add an attribute plugin example

2020-03-05 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D31343#1902903 , @john.brawn wrote: > I've been looking into attribute merging, and as far as I can tell there's > two things going on: > > - In SemaDeclAttr.cpp, the various handleXyzAttr functions may call > mergeXyzAt

[PATCH] D31343: Add an attribute plugin example

2020-03-03 Thread John Brawn via Phabricator via cfe-commits
john.brawn added a comment. I've been looking into attribute merging, and as far as I can tell there's two things going on: - In SemaDeclAttr.cpp, the various handleXyzAttr functions may call mergeXyzAttr to handle clashes with other attributes within the same declaration. - In SemaDecl.cpp, s

[PATCH] D31343: Add an attribute plugin example

2020-03-02 Thread John Brawn via Phabricator via cfe-commits
john.brawn marked 2 inline comments as done. john.brawn added inline comments. Comment at: clang/examples/Attribute/Attribute.cpp:35 +Spellings.push_back({ParsedAttr::AS_GNU, "example"}); +Spellings.push_back({ParsedAttr::AS_CXX11, "::example"}); +Spellings.push_back(

[PATCH] D31343: Add an attribute plugin example

2020-03-02 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 247683. john.brawn added a comment. Rebased and added link in documentation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.llvm.org/D31343 Files: clang/docs/ClangPlugins.rst clang/examples/Attribute/Attribute.cpp

[PATCH] D31343: Add an attribute plugin example

2020-02-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/examples/Attribute/Attribute.cpp:35 + } + virtual bool handleDeclAttribute(Sema &S, Decl *D, + const ParsedAttr &Attr) const { john.brawn wrote: > aaron.ballman wrote: > >

[PATCH] D31343: Add an attribute plugin example

2020-02-27 Thread John Brawn via Phabricator via cfe-commits
john.brawn marked 5 inline comments as done. john.brawn added inline comments. Comment at: clang/examples/Attribute/Attribute.cpp:25 +struct ExampleAttrInfo : public ParsedAttrInfo { + ExampleAttrInfo() { +// Set the kind to NoSemaHandlerAttribute to make sure clang doesn't

[PATCH] D31343: Add an attribute plugin example

2020-02-27 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 246989. john.brawn marked an inline comment as done. john.brawn added a comment. Update based on review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31343/new/ https://reviews.llvm.org/D31343 Files: clang/examples/Attribute/Attribut

[PATCH] D31343: Add an attribute plugin example

2020-02-05 Thread Sorawee Porncharoenwase via Phabricator via cfe-commits
sorawee added inline comments. Comment at: clang/test/Frontend/plugin-attribute.cpp:16 +void fn3() { + // BADATTRIBUTE: error: 'example' attribute only allowed at file scop + int var2 __attribute__((example)); Typo: scope Repository: rG LLVM Github Monorepo

[PATCH] D31343: Add an attribute plugin example

2020-02-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/examples/Attribute/Attribute.cpp:25 +struct ExampleAttrInfo : public ParsedAttrInfo { + ExampleAttrInfo() { +// Set the kind to NoSemaHandlerAttribute to make sure clang doesn't assume It would be really

[PATCH] D31343: Add an attribute plugin example

2020-01-21 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 239307. john.brawn added reviewers: erichkeane, aaron.ballman, rjmccall. john.brawn set the repository for this revision to rG LLVM Github Monorepo. john.brawn added a subscriber: cfe-commits. john.brawn added a comment. Herald added a project: clang. Resur