[PATCH] D56707: Implement CXXCtorInitializer dump in terms of Visitor
Stephen Kelly via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 15 12:22:02 PST 2019
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());
});
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56707.181852.patch
Type: text/x-patch
Size: 2091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190115/08d7032a/attachment-0001.bin>
More information about the cfe-commits
mailing list