steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a subscriber: cfe-commits.
Repository: rC Clang https://reviews.llvm.org/D56707 Files: include/clang/AST/TextNodeDumper.h lib/AST/ASTDumper.cpp lib/AST/TextNodeDumper.cpp Index: lib/AST/TextNodeDumper.cpp =================================================================== --- lib/AST/TextNodeDumper.cpp +++ lib/AST/TextNodeDumper.cpp @@ -258,6 +258,20 @@ 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; Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -441,17 +441,7 @@ 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()); }); } Index: include/clang/AST/TextNodeDumper.h =================================================================== --- include/clang/AST/TextNodeDumper.h +++ include/clang/AST/TextNodeDumper.h @@ -167,6 +167,8 @@ void Visit(const Decl *D); + void Visit(const CXXCtorInitializer *Init); + void dumpPointer(const void *Ptr); void dumpLocation(SourceLocation Loc); void dumpSourceRange(SourceRange R);
Index: lib/AST/TextNodeDumper.cpp =================================================================== --- lib/AST/TextNodeDumper.cpp +++ lib/AST/TextNodeDumper.cpp @@ -258,6 +258,20 @@ 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; Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -441,17 +441,7 @@ 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()); }); } Index: include/clang/AST/TextNodeDumper.h =================================================================== --- include/clang/AST/TextNodeDumper.h +++ include/clang/AST/TextNodeDumper.h @@ -167,6 +167,8 @@ void Visit(const Decl *D); + void Visit(const CXXCtorInitializer *Init); + void dumpPointer(const void *Ptr); void dumpLocation(SourceLocation Loc); void dumpSourceRange(SourceRange R);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits