[PATCH] D61837: Make it possible control matcher traversal kind with ASTContext

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 16 11:49:54 PDT 2019


steveire added inline comments.


================
Comment at: include/clang/AST/ASTContext.h:562-563
 public:
+  ast_type_traits::TraversalKind GetTraversalKind() const { return Traversal; }
+  void SetTraversalKind(ast_type_traits::TraversalKind TK) { Traversal = TK; }
+
----------------
aaron.ballman wrote:
> This doesn't match our coding guidelines. Should be `getTraversalKind()`, etc. Same below.
I think clang still uses uppercase names everywhere. Can you be more specific?


================
Comment at: include/clang/AST/ASTContext.h:565-568
+  const Expr *TraverseIgnored(const Expr *E);
+  Expr *TraverseIgnored(Expr *E);
+  ast_type_traits::DynTypedNode
+  TraverseIgnored(const ast_type_traits::DynTypedNode &N);
----------------
aaron.ballman wrote:
> Is there a reason we don't want these functions to be marked `const`?
It looks like they can be const.


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:718
+template <typename T>
+internal::Matcher<T> traverse(ast_type_traits::TraversalKind TK,
+                              const internal::Matcher<T> &InnerMatcher) {
----------------
aaron.ballman wrote:
> Is this an API we should be exposing to clang-query as well? Will those users be able to use a string literal for the traversal kind, like they already do for attribute kinds (etc)?
Yes, I thought about that, but in a follow-up patch. First, I aim to extend the `TraversalKind` enum with `TK_IgnoreInvisble`.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61837





More information about the cfe-commits mailing list