[PATCH] D80685: [ASTMatchers] Add traversal-kind support to `DynTypedMatcher`
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 28 02:08:09 PDT 2020
gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/lib/ASTMatchers/ASTMatchersInternal.cpp:234
+DynTypedMatcher::constructWithTraversalKind(DynTypedMatcher InnerMatcher,
+ ast_type_traits::TraversalKind TK) {
+ InnerMatcher.Implementation =
----------------
It might read better as an instance method on `DynTypedMatcher`: `DynTypedMatcher::withTraversalKind()`. It is not unprecedented, see `dynCastTo()`.
================
Comment at: clang/unittests/ASTMatchers/ASTMatchersInternalTest.cpp:182
+ EXPECT_TRUE(TK.hasValue());
+ EXPECT_EQ(*TK, TK_AsIs);
+}
----------------
Please use `EXPECT_THAT(M.getTraversalKind(), llvm::ValueIs(TK_AsIs));` (also in tests below).
You'll need to include `llvm/Testing/Support/SupportHelpers.h`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80685/new/
https://reviews.llvm.org/D80685
More information about the cfe-commits
mailing list