[PATCH] D56641: NFC: Move dumping of QualType node to TextNodeDumper

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 12 09:14:47 PST 2019


steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.

Repository:
  rC Clang

https://reviews.llvm.org/D56641

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
@@ -172,6 +172,14 @@
     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;
Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -422,11 +422,7 @@
     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: include/clang/AST/TextNodeDumper.h
===================================================================
--- include/clang/AST/TextNodeDumper.h
+++ include/clang/AST/TextNodeDumper.h
@@ -161,6 +161,8 @@
 
   void Visit(const Type *T);
 
+  void Visit(QualType T);
+
   void dumpPointer(const void *Ptr);
   void dumpLocation(SourceLocation Loc);
   void dumpSourceRange(SourceRange R);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56641.181450.patch
Type: text/x-patch
Size: 1399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190112/bcb1a888/attachment.bin>


More information about the cfe-commits mailing list