diff options
| author | Samuel Benzaquen <sbenza@google.com> | 2013-08-16 16:19:42 +0000 |
|---|---|---|
| committer | Samuel Benzaquen <sbenza@google.com> | 2013-08-16 16:19:42 +0000 |
| commit | bd7d887f186808d19e37d526ba543e0e2dc29397 (patch) | |
| tree | 82fbac426f8aba0b777bb53defbd0c034d34e1c5 /clang/docs | |
| parent | 8522270d7e2cb0c5417de0f58b20761cf9273f3d (diff) | |
| download | bcm5719-llvm-bd7d887f186808d19e37d526ba543e0e2dc29397.tar.gz bcm5719-llvm-bd7d887f186808d19e37d526ba543e0e2dc29397.zip | |
Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
Summary:
Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
This facilitates dynamic registration. Change the registry code to use the regular overload resolution mechanism for adaptative matchers.
Reviewers: klimek
CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1402
llvm-svn: 188560
Diffstat (limited to 'clang/docs')
| -rw-r--r-- | clang/docs/LibASTMatchersReference.html | 28 | ||||
| -rw-r--r-- | clang/docs/tools/dump_ast_matchers.py | 10 |
2 files changed, 28 insertions, 10 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index f127455fe6a..544e06dc7b6 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -631,6 +631,15 @@ Example matches x() </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('floatLiteral0')"><a name="floatLiteral0Anchor">floatLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="floatLiteral0"><pre>Matches float literals of all sizes encodings, e.g. +1.0, 1.0f, 1.0L and 1e10. + +Does not match implicit conversions such as + float a = 10; +</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('forRangeStmt0')"><a name="forRangeStmt0Anchor">forRangeStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>>...</td></tr> <tr><td colspan="4" class="doc" id="forRangeStmt0"><pre>Matches range-based for statements. @@ -699,11 +708,10 @@ initList() <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('integerLiteral0')"><a name="integerLiteral0Anchor">integerLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="integerLiteral0"><pre>Matches integer literals of all sizes encodings. - -Not matching character-encoded integers such as L'a'. +<tr><td colspan="4" class="doc" id="integerLiteral0"><pre>Matches integer literals of all sizes encodings, e.g. +1, 1L, 0x1 and 1U. -Example matches 1, 1L, 0x1, 1U +Does not match character-encoded integers such as L'a'. </pre></td></tr> @@ -2025,7 +2033,7 @@ Usable as: Any Matcher </pre></td></tr> -<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEach0')"><a name="forEach0Anchor">forEach</a></td><td>Matcher<ChildT> ChildMatcher</td></tr> +<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEach0')"><a name="forEach0Anchor">forEach</a></td><td>Matcher<*></td></tr> <tr><td colspan="4" class="doc" id="forEach0"><pre>Matches AST nodes that have child AST nodes that match the provided matcher. @@ -2043,7 +2051,7 @@ Usable as: Any Matcher </pre></td></tr> -<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEachDescendant0')"><a name="forEachDescendant0Anchor">forEachDescendant</a></td><td>Matcher<DescendantT> DescendantMatcher</td></tr> +<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEachDescendant0')"><a name="forEachDescendant0Anchor">forEachDescendant</a></td><td>Matcher<*></td></tr> <tr><td colspan="4" class="doc" id="forEachDescendant0"><pre>Matches AST nodes that have descendant AST nodes that match the provided matcher. @@ -2067,7 +2075,7 @@ Usable as: Any Matcher </pre></td></tr> -<tr><td>Matcher<*></td><td class="name" onclick="toggle('has0')"><a name="has0Anchor">has</a></td><td>Matcher<ChildT> ChildMatcher</td></tr> +<tr><td>Matcher<*></td><td class="name" onclick="toggle('has0')"><a name="has0Anchor">has</a></td><td>Matcher<*></td></tr> <tr><td colspan="4" class="doc" id="has0"><pre>Matches AST nodes that have child AST nodes that match the provided matcher. @@ -2082,7 +2090,7 @@ Usable as: Any Matcher </pre></td></tr> -<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasAncestor0')"><a name="hasAncestor0Anchor">hasAncestor</a></td><td>Matcher<AncestorT> AncestorMatcher</td></tr> +<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasAncestor0')"><a name="hasAncestor0Anchor">hasAncestor</a></td><td>Matcher<*></td></tr> <tr><td colspan="4" class="doc" id="hasAncestor0"><pre>Matches AST nodes that have an ancestor that matches the provided matcher. @@ -2095,7 +2103,7 @@ Usable as: Any Matcher </pre></td></tr> -<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasDescendant0')"><a name="hasDescendant0Anchor">hasDescendant</a></td><td>Matcher<DescendantT> DescendantMatcher</td></tr> +<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasDescendant0')"><a name="hasDescendant0Anchor">hasDescendant</a></td><td>Matcher<*></td></tr> <tr><td colspan="4" class="doc" id="hasDescendant0"><pre>Matches AST nodes that have descendant AST nodes that match the provided matcher. @@ -2111,7 +2119,7 @@ Usable as: Any Matcher </pre></td></tr> -<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasParent0')"><a name="hasParent0Anchor">hasParent</a></td><td>Matcher<ParentT> ParentMatcher</td></tr> +<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasParent0')"><a name="hasParent0Anchor">hasParent</a></td><td>Matcher<*></td></tr> <tr><td colspan="4" class="doc" id="hasParent0"><pre>Matches AST nodes that have a parent that matches the provided matcher. diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py index 08a7d961ff5..e72426eafbf 100644 --- a/clang/docs/tools/dump_ast_matchers.py +++ b/clang/docs/tools/dump_ast_matchers.py @@ -230,6 +230,16 @@ def act_on_decl(declaration, comment, allowed_types): add_matcher(result_type, name, args, comment) return + # Parse ArgumentAdapting matchers. + m = re.match( + r"""^.*ArgumentAdaptingMatcherFunc<.*>\s*([a-zA-Z]*)\s*=\s*{};$""", + declaration, flags=re.X) + if m: + name = m.groups()[0] + add_matcher('*', name, 'Matcher<*>', comment) + return + + # Parse free standing matcher functions, like: # Matcher<ResultType> Name(Matcher<ArgumentType> InnerMatcher) { m = re.match(r"""^\s*(.*)\s+ |

