From: Aaron Ballman Date: Thu, 21 Jan 2016 15:18:25 +0000 (+0000) Subject: When dumping documentation for AST matchers, do something more useful with \see doxyg... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49a5928400377cff5d4f655c51404db5df516de9;p=clang When dumping documentation for AST matchers, do something more useful with \see doxygen commands. Ideally this would link to the target of \see, but for now it translates \see into "See also: " Regenerate the AST documentation for this new functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258401 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index ed1f3f5f18..a7d1308f2e 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -787,8 +787,8 @@ Example matches reinterpret_cast<char*>(&p) in Matcher<Stmt>cxxStaticCastExprMatcher<CXXStaticCastExpr>...
Matches a C++ static_cast expression.
 
-hasDestinationType
-reinterpretCast
+See also: hasDestinationType
+See also: reinterpretCast
 
 Example:
   cxxStaticCastExpr()
@@ -898,7 +898,7 @@ Note: the name "explicitCast" is chosen to match Clang's terminology, as
 Clang uses the term "cast" to apply to implicit conversions as well as to
 actual cast expressions.
 
-hasDestinationType.
+See also: hasDestinationType.
 
 Example: matches all five of the casts in
   int((int)(reinterpret_cast<int>(static_cast<int>(const_cast<int>(42)))))
@@ -1061,15 +1061,16 @@ NSString's "alloc". This matcher should match both message sends.
   [[NSString alloc] initWithString:@"Hello"]
 
+ Matcher<Stmt>parenExprMatcher<ParenExpr>...
Matches parentheses used in expressions.
 
-Given
+Example matches (foo() + 1)
   int foo() { return 1; }
   int a = (foo() + 1);
-matches '(foo() + 1)'
 
+ Matcher<Stmt>returnStmtMatcher<ReturnStmt>...
Matches return statements.
 
@@ -2177,6 +2178,17 @@ functionDecl(isConstexpr())
 
+Matcher<FunctionDecl>isDefaulted +
Matches defaulted function declarations.
+
+Given:
+  class A { ~A(); };
+  class B { ~B() = default; };
+functionDecl(isDefaulted())
+  matches the declaration of ~B, but not ~A.
+
+ + Matcher<FunctionDecl>isDefinition
Matches if a declaration has a body attached.
 
@@ -2192,17 +2204,6 @@ Usable as: Matcher<FunctionDecl>isDefaulted
-
Matches defaulted function declarations.
-
-Given:
-  class A { ~A(); };
-  class B { ~B() = default; };
-functionDecl(isDefaulted())
-  matches the declaration of ~B, but not ~A.
-
- - Matcher<FunctionDecl>isDeleted
Matches deleted function declarations.
 
diff --git a/docs/tools/dump_ast_matchers.py b/docs/tools/dump_ast_matchers.py
index 9ecff049c9..9c05eb888c 100644
--- a/docs/tools/dump_ast_matchers.py
+++ b/docs/tools/dump_ast_matchers.py
@@ -83,6 +83,11 @@ def strip_doxygen(comment):
   """Returns the given comment without \-escaped words."""
   # If there is only a doxygen keyword in the line, delete the whole line.
   comment = re.sub(r'^\\[^\s]+\n', r'', comment, flags=re.M)
+  
+  # If there is a doxygen \see command, change the \see prefix into "See also:".
+  # FIXME: it would be better to turn this into a link to the target instead.
+  comment = re.sub(r'\\see', r'See also:', comment)
+  
   # Delete the doxygen command and the following whitespace.
   comment = re.sub(r'\\[^\s]+\s+', r'', comment)
   return comment