This revision was automatically updated to reflect the committed changes. Closed by commit rL351235: Implement CXXCtorInitializer dump in terms of Visitor (authored by steveire, committed by ). Herald added a subscriber: llvm-commits.
Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56707/new/ https://reviews.llvm.org/D56707 Files: cfe/trunk/include/clang/AST/TextNodeDumper.h cfe/trunk/lib/AST/ASTDumper.cpp cfe/trunk/lib/AST/TextNodeDumper.cpp Index: cfe/trunk/include/clang/AST/TextNodeDumper.h =================================================================== --- cfe/trunk/include/clang/AST/TextNodeDumper.h +++ cfe/trunk/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: cfe/trunk/lib/AST/TextNodeDumper.cpp =================================================================== --- cfe/trunk/lib/AST/TextNodeDumper.cpp +++ cfe/trunk/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: cfe/trunk/lib/AST/ASTDumper.cpp =================================================================== --- cfe/trunk/lib/AST/ASTDumper.cpp +++ cfe/trunk/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: cfe/trunk/include/clang/AST/TextNodeDumper.h =================================================================== --- cfe/trunk/include/clang/AST/TextNodeDumper.h +++ cfe/trunk/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: cfe/trunk/lib/AST/TextNodeDumper.cpp =================================================================== --- cfe/trunk/lib/AST/TextNodeDumper.cpp +++ cfe/trunk/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: cfe/trunk/lib/AST/ASTDumper.cpp =================================================================== --- cfe/trunk/lib/AST/ASTDumper.cpp +++ cfe/trunk/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()); }); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits