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 | 9989dfb6402aedfbeed904f4f5ce204f01f854f8 (patch) | |
tree | 3bf2501dedcf1a5fb9d4ab66638f8b906c868493 /docs/tools | |
parent | 89ae1980327d09209515891f04063909da8a93ca (diff) | |
download | clang-9989dfb6402aedfbeed904f4f5ce204f01f854f8.tar.gz |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/tools')
-rw-r--r-- | docs/tools/dump_ast_matchers.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/tools/dump_ast_matchers.py b/docs/tools/dump_ast_matchers.py index c04df8573a..4ece46ae34 100644 --- a/docs/tools/dump_ast_matchers.py +++ b/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* |