summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2016-01-21 15:18:25 +0000
committerAaron Ballman <aaron@aaronballman.com>2016-01-21 15:18:25 +0000
commitc35724cc7252381abd99f62513fee1de85b56b15 (patch)
tree7e0fabf100cf1d95f791205aa4ea7c8ecaf28cac
parent2455701117c12d1fae811cc148a951984351e444 (diff)
downloadbcm5719-llvm-c35724cc7252381abd99f62513fee1de85b56b15.tar.gz
bcm5719-llvm-c35724cc7252381abd99f62513fee1de85b56b15.zip
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. llvm-svn: 258401
-rw-r--r--clang/docs/LibASTMatchersReference.html33
-rw-r--r--clang/docs/tools/dump_ast_matchers.py5
2 files changed, 22 insertions, 16 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html
index ed1f3f5f18e..a7d1308f2e7 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -787,8 +787,8 @@ Example matches reinterpret_cast&lt;char*&gt;(&amp;p) in
<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt;</td><td class="name" onclick="toggle('cxxStaticCastExpr0')"><a name="cxxStaticCastExpr0Anchor">cxxStaticCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>&gt;...</td></tr>
<tr><td colspan="4" class="doc" id="cxxStaticCastExpr0"><pre>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&lt;int&gt;(static_cast&lt;int&gt;(const_cast&lt;int&gt;(42)))))
@@ -1061,15 +1061,16 @@ NSString's "alloc". This matcher should match both message sends.
[[NSString alloc] initWithString:@"Hello"]
</pre></td></tr>
+
<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt;</td><td class="name" onclick="toggle('parenExpr0')"><a name="parenExpr0Anchor">parenExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenExpr.html">ParenExpr</a>&gt;...</td></tr>
<tr><td colspan="4" class="doc" id="parenExpr0"><pre>Matches parentheses used in expressions.
-Given
+Example matches (foo() + 1)
int foo() { return 1; }
int a = (foo() + 1);
-matches '(foo() + 1)'
</pre></td></tr>
+
<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt;</td><td class="name" onclick="toggle('returnStmt0')"><a name="returnStmt0Anchor">returnStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">ReturnStmt</a>&gt;...</td></tr>
<tr><td colspan="4" class="doc" id="returnStmt0"><pre>Matches return statements.
@@ -2177,6 +2178,17 @@ functionDecl(isConstexpr())
</pre></td></tr>
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>&gt;</td><td class="name" onclick="toggle('isDefaulted0')"><a name="isDefaulted0Anchor">isDefaulted</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefaulted0"><pre>Matches defaulted function declarations.
+
+Given:
+ class A { ~A(); };
+ class B { ~B() = default; };
+functionDecl(isDefaulted())
+ matches the declaration of ~B, but not ~A.
+</pre></td></tr>
+
+
<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>&gt;</td><td class="name" onclick="toggle('isDefinition2')"><a name="isDefinition2Anchor">isDefinition</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isDefinition2"><pre>Matches if a declaration has a body attached.
@@ -2192,17 +2204,6 @@ Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDec
</pre></td></tr>
-<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>&gt;</td><td class="name" onclick="toggle('isDefaulted0')"><a name="isDefaulted0Anchor">isDefaulted</a></td><td></td></tr>
-<tr><td colspan="4" class="doc" id="isDefaulted0"><pre>Matches defaulted function declarations.
-
-Given:
- class A { ~A(); };
- class B { ~B() = default; };
-functionDecl(isDefaulted())
- matches the declaration of ~B, but not ~A.
-</pre></td></tr>
-
-
<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>&gt;</td><td class="name" onclick="toggle('isDeleted0')"><a name="isDeleted0Anchor">isDeleted</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isDeleted0"><pre>Matches deleted function declarations.
diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py
index 9ecff049c96..9c05eb888c0 100644
--- a/clang/docs/tools/dump_ast_matchers.py
+++ b/clang/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
OpenPOWER on IntegriCloud