[PATCH] D19524: [OpenCL] Fix pipe type dump.

Xiuli PAN via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 01:41:17 PDT 2016


pxli168 created this revision.
pxli168 added reviewers: Anastasia, yaxunl.
pxli168 added subscribers: bader, cfe-commits.

Fix the dump of PipeType.
Now we will have "pipe int" and element type.

http://reviews.llvm.org/D19524

Files:
  lib/AST/ASTDumper.cpp
  lib/AST/TypePrinter.cpp

Index: lib/AST/TypePrinter.cpp
===================================================================
--- lib/AST/TypePrinter.cpp
+++ lib/AST/TypePrinter.cpp
@@ -895,7 +895,8 @@
 void TypePrinter::printPipeBefore(const PipeType *T, raw_ostream &OS) {
   IncludeStrongLifetimeRAII Strong(Policy);
 
-  OS << "pipe";
+  OS << "pipe ";
+  print(T->getElementType(), OS, StringRef());
   spaceBeforePlaceHolder(OS);
 }
 
Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -404,6 +404,9 @@
     void VisitAtomicType(const AtomicType *T) {
       dumpTypeAsChild(T->getValueType());
     }
+    void VisitPipeType(const PipeType *T) {
+      dumpTypeAsChild(T->getElementType());
+    }
     void VisitAdjustedType(const AdjustedType *T) {
       dumpTypeAsChild(T->getOriginalType());
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19524.54971.patch
Type: text/x-patch
Size: 885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160426/3ee1f907/attachment.bin>


More information about the cfe-commits mailing list