List Clang-Query Matchers

370 Views Asked by At

Is there a way to list all possible matchers in clang-query? The AST matcher reference list is not necessarily the most up-to-date version. Even the list in ASTMatchers.h clang header (clang-6.0.0) does not show what is currently available. For example, the equalsNode matcher is included in the list, while it is not available in clang-query.

1

There are 1 best solutions below

0
On

It seems that some of the matchers have defects and are still in progress. Therefore, although their names are included in the ASTMatchers.h header file, they can not be used. This can be deduced from the following comment at clang-6.0.0/lib/ASTMatchers/Dynamic/Registry.cpp:Line 95:

// TODO: Here is the list of the missing matchers, grouped by reason.
//
// Need Variant/Parser fixes:
// ofKind
//
// Polymorphic + argument overload:
// findAll
//
// Other:
// equalsNode

REGISTER_OVERLOADED_2(callee);
...

As can be seen, equalsNode is also one of the missing matchers. The supported matchers are registered in the following lines.