[PATCH] D91047: Add a call super attribute plugin example

Yafei Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 01:59:15 PST 2020


psionic12 added inline comments.


================
Comment at: clang/docs/ClangPlugins.rst:119
+
+Attribute plugin to mark a virtual method as call_super, sub-classes must call it in overridden the method.
+
----------------
psionic12 wrote:
> aaron.ballman wrote:
> > aaron.ballman wrote:
> > > Should add backticks around `call_super` since it's syntax. Also, `sub-classes` should be `subclasses`.
> > > 
> > > "call it in overridden the method" -> "call it in the overridden method"
> > There should be more explanation here about what concepts the example demonstrates. For example, one interesting bit to me is that it shows how you can add a custom attribute that's useful even if it does not generate an AST node for the attribute.
> "how you can add a custom attribute that's useful even if it does not generate an AST node for the attribute", do you mean I should add an Annotation Attribute object even I don't use it? So that when someone dumps the AST, the `call_super` attribute will show?
> 
> Or do you mean to explain the inner implementation of how could the RecursiveASTVisitor knows the declaration is marked as `call_super`, even if I didn't add any extra attribute nodes to this declaration node?
I got you point, please ignore the comment above.

Since this is an example, I should mention more about this example itself rather than how to use this plugin, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91047



More information about the cfe-commits mailing list