简体   繁体   中英

List Clang-Query Matchers

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM