This patch exposes TraversalKind support in the DynTypedMatcher API. While
previously, the match method supported traversal logic, it was not possible to
set or get the traversal kind.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/ASTMatchers/ASTMatchersInternal.cpp | ||
---|---|---|
234 | It might read better as an instance method on DynTypedMatcher: DynTypedMatcher::withTraversalKind(). It is not unprecedented, see dynCastTo(). | |
clang/unittests/ASTMatchers/ASTMatchersInternalTest.cpp | ||
183 | Please use EXPECT_THAT(M.getTraversalKind(), llvm::ValueIs(TK_AsIs)); (also in tests below). You'll need to include llvm/Testing/Support/SupportHelpers.h. |
clang/lib/ASTMatchers/ASTMatchersInternal.cpp | ||
---|---|---|
234 | Agreed, thanks for the suggestion. | |
clang/unittests/ASTMatchers/ASTMatchersInternalTest.cpp | ||
183 | Thanks! This cleaned up the tests quite nicely. I also updated the CMake file. Please let me know if that looks right to you. Cargo-culted from other cmake files... |
It might read better as an instance method on DynTypedMatcher: DynTypedMatcher::withTraversalKind(). It is not unprecedented, see dynCastTo().