diff --git a/clang/include/clang/AST/CommentCommands.td b/clang/include/clang/AST/CommentCommands.td --- a/clang/include/clang/AST/CommentCommands.td +++ b/clang/include/clang/AST/CommentCommands.td @@ -63,6 +63,11 @@ let IsVerbatimLineCommand = 1; } +class PropertyCommand : Command { + let NumArgs = 0; + let IsInlineCommand = 1; +} + class DeclarationVerbatimLineCommand : VerbatimLineCommand { 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 //===----------------------------------------------------------------------===//