[PATCH] D61834: Add a Visit overload for DynTypedNode to ASTNodeTraverser

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 12 13:15:59 PDT 2019


steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rC Clang

https://reviews.llvm.org/D61834

Files:
  include/clang/AST/ASTNodeTraverser.h


Index: include/clang/AST/ASTNodeTraverser.h
===================================================================
--- include/clang/AST/ASTNodeTraverser.h
+++ include/clang/AST/ASTNodeTraverser.h
@@ -205,6 +205,27 @@
     });
   }
 
+  void Visit(const ast_type_traits::DynTypedNode& N) {
+    if (const auto *D = N.get<Decl>())
+      Visit(D);
+    else if (const auto *S = N.get<Stmt>())
+      Visit(S);
+    else if (const auto* QT = N.get<QualType>())
+      Visit(*QT);
+    else if (const auto *T = N.get<Type>())
+      Visit(T);
+    else if (const auto *A = N.get<Attr>())
+      Visit(A);
+    else if (const auto *C = N.get<CXXCtorInitializer>())
+      Visit(C);
+    else if (const auto *C = N.get<OMPClause>())
+      Visit(C);
+    else if (const auto *C = N.get<comments::FullComment>())
+      Visit(C, C);
+    else if (const auto* T = N.get<TemplateArgument>())
+      Visit(*T);
+  }
+
   void dumpDeclContext(const DeclContext *DC) {
     if (!DC)
       return;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61834.199174.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190512/bbbbdb51/attachment.bin>


More information about the cfe-commits mailing list