[PATCH] D80654: WIP: Make it possible to use the traverse() matcher in clang-query

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 14:10:12 PDT 2020


ymandel added a comment.

Thanks, this looks quite useful. I should be able to look it over in full tomorrow.



================
Comment at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:383
+  static DynTypedMatcher
+  constructTraversalWrapper(const DynTypedMatcher &InnerMatcher,
+                            ast_type_traits::TraversalKind TK);
----------------
I need this for my fix to Transformer. In fact, this is the only thing I need, rather than an overload of `traverse` for `DynTypedMatcher`.  Do you want me to split this into its own patch and send to you? Or, vice versa?

Also, whay `const DynTypedMatcher &InnerMatcher`? Given that it is immediately copied, why not just `DynTypedMatcher InnerMatcher`, which at least allows the caller to move-construct the argument and avoid the copy?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80654/new/

https://reviews.llvm.org/D80654





More information about the cfe-commits mailing list