SuccessChanges

Summary

  1. [ASTMatchers] Add mapAnyOf matcher (details)
Commit a7101450a42e4f1ed5af1a38a6def08f1b5b58fe by steveire
[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
The file was modifiedclang/docs/tools/dump_ast_matchers.py
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
The file was modifiedclang/docs/LibASTMatchersReference.html
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchersInternal.h
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h