r351116 - [ASTDump] NFC: Move dumping of QualType node to TextNodeDumper
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 14 12:15:29 PST 2019
Author: steveire
Date: Mon Jan 14 12:15:29 2019
New Revision: 351116
URL: http://llvm.org/viewvc/llvm-project?rev=351116&view=rev
Log:
[ASTDump] NFC: Move dumping of QualType node to TextNodeDumper
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56641
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=351116&r1=351115&r2=351116&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TextNodeDumper.h (original)
+++ cfe/trunk/include/clang/AST/TextNodeDumper.h Mon Jan 14 12:15:29 2019
@@ -161,6 +161,8 @@ public:
void Visit(const Type *T);
+ void Visit(QualType T);
+
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=351116&r1=351115&r2=351116&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Mon Jan 14 12:15:29 2019
@@ -422,11 +422,7 @@ void ASTDumper::dumpTypeAsChild(QualType
return dumpTypeAsChild(SQT.Ty);
dumpChild([=] {
- OS << "QualType";
- NodeDumper.dumpPointer(T.getAsOpaquePtr());
- OS << " ";
- NodeDumper.dumpBareType(T, false);
- OS << " " << T.split().Quals.getAsString();
+ NodeDumper.Visit(T);
dumpTypeAsChild(T.split().Ty);
});
}
Modified: cfe/trunk/lib/AST/TextNodeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TextNodeDumper.cpp?rev=351116&r1=351115&r2=351116&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TextNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/TextNodeDumper.cpp Mon Jan 14 12:15:29 2019
@@ -172,6 +172,14 @@ void TextNodeDumper::Visit(const Type *T
OS << " imported";
}
+void TextNodeDumper::Visit(QualType T) {
+ OS << "QualType";
+ dumpPointer(T.getAsOpaquePtr());
+ OS << " ";
+ dumpBareType(T, false);
+ OS << " " << T.split().Quals.getAsString();
+}
+
void TextNodeDumper::dumpPointer(const void *Ptr) {
ColorScope Color(OS, ShowColors, AddressColor);
OS << ' ' << Ptr;
More information about the cfe-commits
mailing list