summaryrefslogtreecommitdiffstats
path: root/clang/docs/tools
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2018-01-17 16:50:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2018-01-17 16:50:14 +0000
commitae7ff385c696c2246ed29c664dc33f8c4495b02e (patch)
tree7238f54a4ffcb3c650d6a1f9c46f52ff978a74ec /clang/docs/tools
parent1491ca8911e4ae28020e647fe5e2da37df26c43a (diff)
downloadbcm5719-llvm-ae7ff385c696c2246ed29c664dc33f8c4495b02e.tar.gz
bcm5719-llvm-ae7ff385c696c2246ed29c664dc33f8c4495b02e.zip
Update dump_ast_matchers for many recent changes.
The html file hasn't been updated in a long time so there are quite a few changes in there. No matchers were removed though. llvm-svn: 322687
Diffstat (limited to 'clang/docs/tools')
-rwxr-xr-xclang/docs/tools/dump_ast_matchers.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py
index 45540405de9..ab7738fd768 100755
--- 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'\1 ', args)
+ args = re.sub(r'extern 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
@@ -150,11 +150,11 @@ def act_on_decl(declaration, comment, allowed_types):
comment, is_dyncast=True)
return
- # Parse the various matcher definition macros.
- m = re.match(""".*AST_TYPE_MATCHER\(
- \s*([^\s,]+\s*),
- \s*([^\s,]+\s*)
- \)\s*;\s*$""", declaration, flags=re.X)
+ # Special case of type matchers:
+ # AstTypeMatcher<ArgumentType> name
+ m = re.match(r""".*AstTypeMatcher\s*<
+ \s*([^\s>]+)\s*>
+ \s*([^\s;]+)\s*;\s*$""", declaration, flags=re.X)
if m:
inner, name = m.groups()
add_matcher('Type', name, 'Matcher<%s>...' % inner,
@@ -165,7 +165,8 @@ def act_on_decl(declaration, comment, allowed_types):
# comment, is_dyncast=True)
return
- m = re.match(""".*AST_TYPE(LOC)?_TRAVERSE_MATCHER\(
+ # Parse the various matcher definition macros.
+ m = re.match(""".*AST_TYPE(LOC)?_TRAVERSE_MATCHER(?:_DECL)?\(
\s*([^\s,]+\s*),
\s*(?:[^\s,]+\s*),
\s*AST_POLYMORPHIC_SUPPORTED_TYPES\(([^)]*)\)
@@ -256,8 +257,8 @@ def act_on_decl(declaration, comment, allowed_types):
# Parse ArgumentAdapting matchers.
m = re.match(
- r"""^.*ArgumentAdaptingMatcherFunc<.*>\s*(?:LLVM_ATTRIBUTE_UNUSED\s*)
- ([a-zA-Z]*)\s*=\s*{};$""",
+ r"""^.*ArgumentAdaptingMatcherFunc<.*>\s*
+ ([a-zA-Z]*);$""",
declaration, flags=re.X)
if m:
name = m.groups()[0]
@@ -267,7 +268,7 @@ def act_on_decl(declaration, comment, allowed_types):
# Parse Variadic functions.
m = re.match(
r"""^.*internal::VariadicFunction\s*<\s*([^,]+),\s*([^,]+),\s*[^>]+>\s*
- ([a-zA-Z]*)\s*=\s*{.*};$""",
+ ([a-zA-Z]*);$""",
declaration, flags=re.X)
if m:
result, arg, name = m.groups()[:3]
@@ -276,15 +277,15 @@ def act_on_decl(declaration, comment, allowed_types):
# Parse Variadic operator matchers.
m = re.match(
- r"""^.*VariadicOperatorMatcherFunc\s*<\s*([^,]+),\s*([^\s>]+)\s*>\s*
- ([a-zA-Z]*)\s*=\s*{.*};$""",
+ r"""^.*VariadicOperatorMatcherFunc\s*<\s*([^,]+),\s*([^\s]+)\s*>\s*
+ ([a-zA-Z]*);$""",
declaration, flags=re.X)
if m:
min_args, max_args, name = m.groups()[:3]
if max_args == '1':
add_matcher('*', name, 'Matcher<*>', comment)
return
- elif max_args == 'UINT_MAX':
+ elif max_args == 'std::numeric_limits<unsigned>::max()':
add_matcher('*', name, 'Matcher<*>, ..., Matcher<*>', comment)
return
OpenPOWER on IntegriCloud