r351235 - Implement CXXCtorInitializer dump in terms of Visitor
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 15 12:17:33 PST 2019
Author: steveire
Date: Tue Jan 15 12:17:33 2019
New Revision: 351235
URL: http://llvm.org/viewvc/llvm-project?rev=351235&view=rev
Log:
Implement CXXCtorInitializer dump in terms of Visitor
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56707
Modified:
cfe/trunk/include/clang/AST/TextNodeDumper.h
cfe/trunk/lib/AST/ASTDumper.cpp
cfe/trunk/lib/AST/TextNodeDumper.cpp
Modified: cfe/trunk/include/clang/AST/TextNodeDumper.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TextNodeDumper.h?rev=351235&r1=351234&r2=351235&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TextNodeDumper.h (original)
+++ cfe/trunk/include/clang/AST/TextNodeDumper.h Tue Jan 15 12:17:33 2019
@@ -167,6 +167,8 @@ public:
void Visit(const Decl *D);
+ void Visit(const CXXCtorInitializer *Init);
+
void dumpPointer(const void *Ptr);
void dumpLocation(SourceLocation Loc);
void dumpSourceRange(SourceRange R);
Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=351235&r1=351234&r2=351235&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Tue Jan 15 12:17:33 2019
@@ -441,17 +441,7 @@ void ASTDumper::dumpAttr(const Attr *A)
void ASTDumper::dumpCXXCtorInitializer(const CXXCtorInitializer *Init) {
dumpChild([=] {
- OS << "CXXCtorInitializer";
- if (Init->isAnyMemberInitializer()) {
- OS << ' ';
- NodeDumper.dumpBareDeclRef(Init->getAnyMember());
- } else if (Init->isBaseInitializer()) {
- NodeDumper.dumpType(QualType(Init->getBaseClass(), 0));
- } else if (Init->isDelegatingInitializer()) {
- NodeDumper.dumpType(Init->getTypeSourceInfo()->getType());
- } else {
- llvm_unreachable("Unknown initializer type");
- }
+ NodeDumper.Visit(Init);
dumpStmt(Init->getInit());
});
}
Modified: cfe/trunk/lib/AST/TextNodeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TextNodeDumper.cpp?rev=351235&r1=351234&r2=351235&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TextNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/TextNodeDumper.cpp Tue Jan 15 12:17:33 2019
@@ -258,6 +258,20 @@ void TextNodeDumper::Visit(const Decl *D
OS << " constexpr";
}
+void TextNodeDumper::Visit(const CXXCtorInitializer *Init) {
+ OS << "CXXCtorInitializer";
+ if (Init->isAnyMemberInitializer()) {
+ OS << ' ';
+ dumpBareDeclRef(Init->getAnyMember());
+ } else if (Init->isBaseInitializer()) {
+ dumpType(QualType(Init->getBaseClass(), 0));
+ } else if (Init->isDelegatingInitializer()) {
+ dumpType(Init->getTypeSourceInfo()->getType());
+ } else {
+ llvm_unreachable("Unknown initializer type");
+ }
+}
+
void TextNodeDumper::dumpPointer(const void *Ptr) {
ColorScope Color(OS, ShowColors, AddressColor);
OS << ' ' << Ptr;
More information about the cfe-commits
mailing list