llvm-project/clang/docs/tools
Nathan James f51a319cac
[ASTMatchers] Enhanced support for matchers taking Regex arguments
Added new Macros `AST(_POLYMORPHIC)_MATCHER_REGEX(_OVERLOAD)` that define a matchers that take a regular expression string and optionally regular expression flags. This lets users match against nodes while ignoring the case without having to manually use `[Aa]` or `[A-Fa-f]` in their regex. The other point this addresses is in the current state, matchers that use regular expressions have to compile them for each node they try to match on, Now the regular expression is compiled once when you define the matcher and used for every node that it tries to match against. If there is an error while compiling the regular expression an error will be logged to stderr showing the bad regex string and the reason it couldn't be compiled. The old behaviour of this was down to the Matcher implementation and some would assert, whereas others just would never match. Support for this has been added to the documentation script as well. Support for this has been added to dynamic matchers ensuring functionality is the same between the 2 use cases.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D82706
2020-07-02 14:52:25 +01:00
..
dump_ast_matchers.py [ASTMatchers] Enhanced support for matchers taking Regex arguments 2020-07-02 14:52:25 +01:00
dump_format_style.py [clang-format] ensure dump_format_style.py works with Python3 correctly 2020-05-07 19:52:12 +01:00
generate_formatted_state.py [clang][docs] Remove untracked files from formatted status 2020-06-28 09:49:39 +01:00