[ASTMatchers] Add mapAnyOf matcher
Make it possible to compose a matcher for different base nodes. This accepts one or more node matcher functors and zero or more matchers, composing the latter into the former. This allows composing of matchers where the same inner matcher name is used for the same concept, but with a different node functor. Currently, there is a limitation that the nodes must be in the same "clade", so while mapAnyOf(ifStmt, forStmt).with(hasBody(stmt())) can be used, functionDecl can not be added to the tuple. It is possible to use this in clang-query, but it will require changes to the QueryParser, so is deferred to a future review. Differential Revision: https://reviews.llvm.org/D94127
Loading
Please register or sign in to comment