[PATCH] D56640: NFC: Canonicalize handling of TypeLocInfo

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


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

No need to avoid the Visit method.


Repository:
  rC Clang

https://reviews.llvm.org/D56640

Files:
  lib/AST/ASTDumper.cpp


Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -122,6 +122,9 @@
     void VisitComplexType(const ComplexType *T) {
       dumpTypeAsChild(T->getElementType());
     }
+    void VisitLocInfoType(const LocInfoType *T) {
+      dumpTypeAsChild(T->getTypeSourceInfo()->getType());
+    }
     void VisitPointerType(const PointerType *T) {
       dumpTypeAsChild(T->getPointeeType());
     }
@@ -434,10 +437,6 @@
     if (!T) {
       return;
     }
-    if (const LocInfoType *LIT = llvm::dyn_cast<LocInfoType>(T)) {
-      dumpTypeAsChild(LIT->getTypeSourceInfo()->getType());
-      return;
-    }
     TypeVisitor<ASTDumper>::Visit(T);
 
     QualType SingleStepDesugar =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56640.181449.patch
Type: text/x-patch
Size: 776 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190112/005d12e3/attachment.bin>


More information about the cfe-commits mailing list