]> granicus.if.org Git - clang/commitdiff
[ASTDump] NFC: Move dumping of QualType node to TextNodeDumper
authorStephen Kelly <steveire@gmail.com>
Mon, 14 Jan 2019 20:15:29 +0000 (20:15 +0000)
committerStephen Kelly <steveire@gmail.com>
Mon, 14 Jan 2019 20:15:29 +0000 (20:15 +0000)
Reviewers: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D56641

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351116 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/TextNodeDumper.h
lib/AST/ASTDumper.cpp
lib/AST/TextNodeDumper.cpp

index b562d30ef36d70619d8ca1e6a7ffca1cca6747de..239435e98b76360323fc0166afcc4597b6cfa29e 100644 (file)
@@ -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);
index 7af1f8163508f12b8ae9272e3a3a2b7c6a0750b5..93a5f8b8a236385463caa493e02e4940a91a84e2 100644 (file)
@@ -422,11 +422,7 @@ void ASTDumper::dumpTypeAsChild(QualType T) {
     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);
   });
 }
index 1a618ce71bdf4cb3ee026de1fa2490e22e769af1..c106d0814d33f9548d1edc65762206cd7a04eced 100644 (file)
@@ -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;