This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Allow processing of attributes on statements by plugins
AbandonedPublic

Authored by Qix- on Apr 5 2021, 1:56 AM.

Details

Reviewers
aaron.ballman
Summary

Pretty cut and dry; currently plugins can create attributes for declarations but any that are not recognized produce a diagnostic, leaving no hook for plugins to react to them.

This adds a quick check to the attribute to see if the implementation would like to handle it first, akin to how declarations are handled.

Compatible with D99861.

Diff Detail

Event Timeline

Qix- requested review of this revision.Apr 5 2021, 1:56 AM
Qix- created this revision.
Qix- edited the summary of this revision. (Show Details)Apr 5 2021, 1:57 AM

Thank you for the patch! Btw, can you add more context to the patch when you generate it (I usually use -U 999 when making patches)?

The changes look good so far, but I think docs\ClangPlugins.rst should be updated to document the new functionality and it would be nice to add example usage (in lieu of tests) to examples\Attribute.

Qix- updated this revision to Diff 336172.Apr 8 2021, 11:05 AM
Qix- planned changes to this revision.Apr 9 2021, 11:05 AM
Qix- abandoned this revision.Apr 22 2021, 6:35 AM

Closing in favor of more complete plugin attribute changes discussed in IRC.