[PATCH] D125473: Comment parsing: Treat properties as zero-argument inline commands

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 13 04:49:45 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd2396d896ee1: Comment parsing: Treat properties as zero-argument inline commands (authored by aaronpuchert).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125473

Files:
  clang/include/clang/AST/CommentCommands.td


Index: clang/include/clang/AST/CommentCommands.td
===================================================================
--- clang/include/clang/AST/CommentCommands.td
+++ clang/include/clang/AST/CommentCommands.td
@@ -63,6 +63,11 @@
   let IsVerbatimLineCommand = 1;
 }
 
+class PropertyCommand<string name> : Command<name> {
+  let NumArgs = 0;
+  let IsInlineCommand = 1;
+}
+
 class DeclarationVerbatimLineCommand<string name> :
       VerbatimLineCommand<name> {
   let IsDeclarationCommand = 1;
@@ -275,31 +280,6 @@
 
 def NoOp : VerbatimLineCommand<"noop">;
 
-// These have actually no arguments, but we can treat them as line commands.
-def CallGraph       : VerbatimLineCommand<"callgraph">;
-def HideCallGraph   : VerbatimLineCommand<"hidecallgraph">;
-def CallerGraph     : VerbatimLineCommand<"callergraph">;
-def HideCallerGraph : VerbatimLineCommand<"hidecallergraph">;
-def ShowInitializer : VerbatimLineCommand<"showinitializer">;
-def HideInitializer : VerbatimLineCommand<"hideinitializer">;
-def ShowRefBy       : VerbatimLineCommand<"showrefby">;
-def HideRefBy       : VerbatimLineCommand<"hiderefby">;
-def ShowRefs        : VerbatimLineCommand<"showrefs">;
-def HideRefs        : VerbatimLineCommand<"hiderefs">;
-
-// These also have no argument.
-def Private   : VerbatimLineCommand<"private">;
-def Protected : VerbatimLineCommand<"protected">;
-def Public    : VerbatimLineCommand<"public">;
-def Pure      : VerbatimLineCommand<"pure">;
-def Static    : VerbatimLineCommand<"static">;
-
-// These also have no argument.
-def NoSubgrouping    : VerbatimLineCommand<"nosubgrouping">;
-def PrivateSection   : VerbatimLineCommand<"privatesection">;
-def ProtectedSection : VerbatimLineCommand<"protectedsection">;
-def PublicSection    : VerbatimLineCommand<"publicsection">;
-
 // We might also build proper support for if/ifnot/else/elseif/endif.
 def If     : VerbatimLineCommand<"if">;
 def IfNot  : VerbatimLineCommand<"ifnot">;
@@ -311,6 +291,32 @@
 def Cond    : VerbatimLineCommand<"cond">;
 def EndCond : VerbatimLineCommand<"endcond">;
 
+//===----------------------------------------------------------------------===//
+// PropertyCommand
+//===----------------------------------------------------------------------===//
+
+def CallGraph       : PropertyCommand<"callgraph">;
+def HideCallGraph   : PropertyCommand<"hidecallgraph">;
+def CallerGraph     : PropertyCommand<"callergraph">;
+def HideCallerGraph : PropertyCommand<"hidecallergraph">;
+def ShowInitializer : PropertyCommand<"showinitializer">;
+def HideInitializer : PropertyCommand<"hideinitializer">;
+def ShowRefBy       : PropertyCommand<"showrefby">;
+def HideRefBy       : PropertyCommand<"hiderefby">;
+def ShowRefs        : PropertyCommand<"showrefs">;
+def HideRefs        : PropertyCommand<"hiderefs">;
+
+def Private   : PropertyCommand<"private">;
+def Protected : PropertyCommand<"protected">;
+def Public    : PropertyCommand<"public">;
+def Pure      : PropertyCommand<"pure">;
+def Static    : PropertyCommand<"static">;
+
+def NoSubgrouping    : PropertyCommand<"nosubgrouping">;
+def PrivateSection   : PropertyCommand<"privatesection">;
+def ProtectedSection : PropertyCommand<"protectedsection">;
+def PublicSection    : PropertyCommand<"publicsection">;
+
 //===----------------------------------------------------------------------===//
 // DeclarationVerbatimLineCommand
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125473.429204.patch
Type: text/x-patch
Size: 3471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220513/0411d0c0/attachment.bin>


More information about the cfe-commits mailing list