[PATCH] D31342: Add ParsedAttrInfo::handleDeclAttribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 27 11:46:38 PST 2020


aaron.ballman added inline comments.


================
Comment at: clang/docs/ClangPlugins.rst:89
+The members of ``ParsedAttrInfo`` that a plugin attribute must define are:
+ * ``AttrKind``, which must be set to ``ParsedAttr::NoSemaHandlerAttribute``.
+ * ``Spellings``, which must be populated with the attribute syntaxes that are
----------------
If it must always be this one specific value, why do we make users set it manually instead of setting it automatically for them?


================
Comment at: clang/docs/ClangPlugins.rst:90
+ * ``AttrKind``, which must be set to ``ParsedAttr::NoSemaHandlerAttribute``.
+ * ``Spellings``, which must be populated with the attribute syntaxes that are
+   allowed and how the attribute name is spelled for each syntax.
----------------
The documentation should mention what type this is -- the example above doesn't name the type, just uses braced initialization, so it may be unclear how to specify a scope, for instance.


================
Comment at: clang/docs/ClangPlugins.rst:92
+   allowed and how the attribute name is spelled for each syntax.
+ * ``handleDeclAttribute``, which is the function that applies the attribute to
+   a declaration.
----------------
This returns a value, but there's no mention of what `true`/`false` means, and the example doesn't make it clear how one would "handle" the attribute (e.g., how one creates the semantic attribute and attaches it to the declaration).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D31342/new/

https://reviews.llvm.org/D31342





More information about the cfe-commits mailing list