[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:44:01 PDT 2019
steveire updated this revision to Diff 199178.
steveire added a comment.
Format
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61834/new/
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.199178.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190512/2db5eed1/attachment-0001.bin>
More information about the cfe-commits
mailing list