summaryrefslogtreecommitdiffstats
path: root/clang/docs/tools/dump_ast_matchers.py
diff options
context:
space:
mode:
authorSamuel Benzaquen <sbenza@google.com>2016-05-04 20:45:00 +0000
committerSamuel Benzaquen <sbenza@google.com>2016-05-04 20:45:00 +0000
commita4076ea8a26dc837ee1321de2713d2d35ffad609 (patch)
treeba0d4b4812f462a0eed75089af415924a7e18460 /clang/docs/tools/dump_ast_matchers.py
parentbaf7fd0b162864409b16b18086efc2151233b646 (diff)
downloadbcm5719-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/tools/dump_ast_matchers.py')
-rw-r--r--clang/docs/tools/dump_ast_matchers.py6
1 files changed, 3 insertions, 3 deletions
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:
OpenPOWER on IntegriCloud