summaryrefslogtreecommitdiffstats
path: root/clang/docs/tools
diff options
context:
space:
mode:
authorSamuel Benzaquen <sbenza@google.com>2013-07-15 19:25:06 +0000
committerSamuel Benzaquen <sbenza@google.com>2013-07-15 19:25:06 +0000
commit79656e19c8b8919f461367f5c03c3eb27be5548b (patch)
tree50710f3b018bcbc4f2dad09ecb09f1b9d4aa0d22 /clang/docs/tools
parent31209cc8ebb30bc546b34f28273634af3a4850b0 (diff)
downloadbcm5719-llvm-79656e19c8b8919f461367f5c03c3eb27be5548b.tar.gz
bcm5719-llvm-79656e19c8b8919f461367f5c03c3eb27be5548b.zip
Add support for type traversal matchers.
Summary: Fixup the type traversal macros/matchers to specify the supported types. Make the marshallers a little more generic to support any variadic function. Update the doc script. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1023 llvm-svn: 186340
Diffstat (limited to 'clang/docs/tools')
-rw-r--r--clang/docs/tools/dump_ast_matchers.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py
index 267cdb054c9..bbf48c7646d 100644
--- a/clang/docs/tools/dump_ast_matchers.py
+++ b/clang/docs/tools/dump_ast_matchers.py
@@ -160,14 +160,17 @@ def act_on_decl(declaration, comment, allowed_types):
m = re.match(""".*AST_TYPE(LOC)?_TRAVERSE_MATCHER\(
\s*([^\s,]+\s*),
- \s*(?:[^\s,]+\s*)
+ \s*(?:[^\s,]+\s*),
+ \s*AST_POLYMORPHIC_SUPPORTED_TYPES_([^(]*)\(([^)]*)\)
\)\s*;\s*$""", declaration, flags=re.X)
if m:
- loc = m.group(1)
- name = m.group(2)
- result_types = extract_result_types(comment)
- if not result_types:
- raise Exception('Did not find allowed result types for: %s' % name)
+ loc, name, n_results, results = m.groups()[0:4]
+ result_types = [r.strip() for r in results.split(',')]
+
+ comment_result_types = extract_result_types(comment)
+ if (comment_result_types and
+ sorted(result_types) != sorted(comment_result_types)):
+ raise Exception('Inconsistent documentation for: %s' % name)
for result_type in result_types:
add_matcher(result_type, name, 'Matcher<Type>', comment)
if loc:
OpenPOWER on IntegriCloud