diff options
author | Samuel Benzaquen <sbenza@google.com> | 2016-05-04 20:45:00 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2016-05-04 20:45:00 +0000 |
commit | a4076ea8a26dc837ee1321de2713d2d35ffad609 (patch) | |
tree | ba0d4b4812f462a0eed75089af415924a7e18460 /clang/docs | |
parent | baf7fd0b162864409b16b18086efc2151233b646 (diff) | |
download | bcm5719-llvm-a4076ea8a26dc837ee1321de2713d2d35ffad609.tar.gz bcm5719-llvm-a4076ea8a26dc837ee1321de2713d2d35ffad609.zip |
Fix the doc extraction script to work with hasAnyName and with equalsNode.
The change from llvm::VariadicFunction to internal::VariadicFunction
broke the extraction of hasAnyName().
equalsNode was broken because the argument type is 'const XXXX*' and
the internal space caused a failure on the regex.
llvm-svn: 268548
Diffstat (limited to 'clang/docs')
-rw-r--r-- | clang/docs/LibASTMatchersReference.html | 37 | ||||
-rw-r--r-- | clang/docs/tools/dump_ast_matchers.py | 6 |
2 files changed, 37 insertions, 6 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index d17a32d7a48..bd0f53f5b1b 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -410,7 +410,7 @@ decl(hasDeclContext(translationUnitDecl())) Given typedef int X; - using Y = int; + using Y = int; typeAliasDecl() matches "using Y = int", but not "typedef int X" </pre></td></tr> @@ -421,7 +421,7 @@ typeAliasDecl() Given typedef int X; - using Y = int; + using Y = int; typedefDecl() matches "typedef int X", but not "using Y = int" </pre></td></tr> @@ -432,7 +432,7 @@ typedefDecl() Given typedef int X; - using Y = int; + using Y = int; typedefNameDecl() matches "typedef int X" and "using Y = int" </pre></td></tr> @@ -2238,6 +2238,13 @@ and reference to that variable declaration within a compound statement. </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('equalsNode0')"><a name="equalsNode0Anchor">equalsNode</a></td><td>const Decl* Other</td></tr> +<tr><td colspan="4" class="doc" id="equalsNode0"><pre>Matches if a node equals another node. + +Decl has pointer identity in the AST. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('hasAttr0')"><a name="hasAttr0Anchor">hasAttr</a></td><td>attr::Kind AttrKind</td></tr> <tr><td colspan="4" class="doc" id="hasAttr0"><pre>Matches declaration that has a given attribute. @@ -2898,6 +2905,13 @@ and reference to that variable declaration within a compound statement. </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('equalsNode1')"><a name="equalsNode1Anchor">equalsNode</a></td><td>const Stmt* Other</td></tr> +<tr><td colspan="4" class="doc" id="equalsNode1"><pre>Matches if a node equals another node. + +Stmt has pointer identity in the AST. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('isExpansionInFileMatching1')"><a name="isExpansionInFileMatching1Anchor">isExpansionInFileMatching</a></td><td>std::string RegExp</td></tr> <tr><td colspan="4" class="doc" id="isExpansionInFileMatching1"><pre>Matches AST nodes that were expanded within files whose name is partially matching a given regex. @@ -3072,6 +3086,13 @@ and reference to that variable declaration within a compound statement. </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('equalsNode2')"><a name="equalsNode2Anchor">equalsNode</a></td><td>const Type* Other</td></tr> +<tr><td colspan="4" class="doc" id="equalsNode2"><pre>Matches if a node equals another node. + +Type has pointer identity in the AST. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('realFloatingPointType0')"><a name="realFloatingPointType0Anchor">realFloatingPointType</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="realFloatingPointType0"><pre>Matches any real floating-point type (float, double, long double). @@ -3286,6 +3307,16 @@ expr(nullPointerConstant()) </pre></td></tr> +<tr><td>Matcher<internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>></td><td class="name" onclick="toggle('hasAnyName0')"><a name="hasAnyName0Anchor">hasAnyName</a></td><td>StringRef, ..., StringRef</td></tr> +<tr><td colspan="4" class="doc" id="hasAnyName0"><pre>Matches NamedDecl nodes that have any of the specified names. + +This matcher is only provided as a performance optimization of hasName. + hasAnyName(a, b, c) + is equivalent to, but faster than + anyOf(hasName(a), hasName(b), hasName(c)) +</pre></td></tr> + + <tr><td>Matcher<internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>></td><td class="name" onclick="toggle('isInTemplateInstantiation0')"><a name="isInTemplateInstantiation0Anchor">isInTemplateInstantiation</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isInTemplateInstantiation0"><pre>Matches statements inside of a template instantiation. diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py index 104189c4af3..45540405de9 100644 --- a/clang/docs/tools/dump_ast_matchers.py +++ b/clang/docs/tools/dump_ast_matchers.py @@ -95,7 +95,7 @@ def strip_doxygen(comment): def unify_arguments(args): """Gets rid of anything the user doesn't care about in the argument list.""" args = re.sub(r'internal::', r'', args) - args = re.sub(r'const\s+', r'', args) + args = re.sub(r'const\s+(.*)&', r'\1 ', args) args = re.sub(r'&', r' ', args) args = re.sub(r'(^|\s)M\d?(\s)', r'\1Matcher<*>\2', args) return args @@ -231,7 +231,7 @@ def act_on_decl(declaration, comment, allowed_types): m = re.match(r"""^\s*AST_MATCHER(_P)?(.?)(?:_OVERLOAD)?\( (?:\s*([^\s,]+)\s*,)? \s*([^\s,]+)\s* - (?:,\s*([^\s,]+)\s* + (?:,\s*([^,]+)\s* ,\s*([^\s,]+)\s*)? (?:,\s*([^\s,]+)\s* ,\s*([^\s,]+)\s*)? @@ -266,7 +266,7 @@ def act_on_decl(declaration, comment, allowed_types): # Parse Variadic functions. m = re.match( - r"""^.*llvm::VariadicFunction\s*<\s*([^,]+),\s*([^,]+),\s*[^>]+>\s* + r"""^.*internal::VariadicFunction\s*<\s*([^,]+),\s*([^,]+),\s*[^>]+>\s* ([a-zA-Z]*)\s*=\s*{.*};$""", declaration, flags=re.X) if m: |