diff options
author | Samuel Benzaquen <sbenza@google.com> | 2014-03-10 15:40:23 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2014-03-10 15:40:23 +0000 |
commit | a083935d0ab092d801c726ade8f2d16ea0ca9ba1 (patch) | |
tree | 6f3b9a82dc4e42e7dfcabb32456f9d6fe9e3d9c3 /clang/docs/tools | |
parent | 84a12e18d3c6006ddd6659cd73aea402ac9d595e (diff) | |
download | bcm5719-llvm-a083935d0ab092d801c726ade8f2d16ea0ca9ba1.tar.gz bcm5719-llvm-a083935d0ab092d801c726ade8f2d16ea0ca9ba1.zip |
Add loc() to the dynamic registry.
Summary:
Add loc() to the dynamic registry.
Other fixes:
- Fix the polymorphic variant value to accept an exact match, even if
there are other possible conversions.
- Fix specifiesTypeLoc() to not crash on an empty
NestedNameSpecifierLoc.
Reviewers: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2928
llvm-svn: 203467
Diffstat (limited to 'clang/docs/tools')
-rw-r--r-- | clang/docs/tools/dump_ast_matchers.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py index c04df8573a5..4ece46ae34f 100644 --- a/clang/docs/tools/dump_ast_matchers.py +++ b/clang/docs/tools/dump_ast_matchers.py @@ -204,6 +204,25 @@ def act_on_decl(declaration, comment, allowed_types): add_matcher(result_type, name, args, comment) return + m = re.match(r"""^\s*AST_MATCHER_FUNCTION(_P)?(.?)(?:_OVERLOAD)?\( + (?:\s*([^\s,]+)\s*,)? + \s*([^\s,]+)\s* + (?:,\s*([^\s,]+)\s* + ,\s*([^\s,]+)\s*)? + (?:,\s*([^\s,]+)\s* + ,\s*([^\s,]+)\s*)? + (?:,\s*\d+\s*)? + \)\s*{\s*$""", declaration, flags=re.X) + if m: + p, n, result, name = m.groups()[0:4] + args = m.groups()[4:] + if n not in ['', '2']: + raise Exception('Cannot parse "%s"' % declaration) + args = ', '.join('%s %s' % (args[i], args[i+1]) + for i in range(0, len(args), 2) if args[i]) + add_matcher(result, name, args, comment) + return + m = re.match(r"""^\s*AST_MATCHER(_P)?(.?)(?:_OVERLOAD)?\( (?:\s*([^\s,]+)\s*,)? \s*([^\s,]+)\s* |