[PATCH] D19524: [OpenCL] Fix pipe type dump.
Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 2 22:43:06 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL268364: [OpenCL] Fix pipe type dump. (authored by pxl).
Changed prior to commit:
http://reviews.llvm.org/D19524?vs=55161&id=55946#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19524
Files:
cfe/trunk/lib/AST/ASTDumper.cpp
cfe/trunk/lib/AST/TypePrinter.cpp
cfe/trunk/test/Misc/ast-dump-pipe.cl
cfe/trunk/test/SemaOpenCL/invalid-access-qualifier.cl
cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl
Index: cfe/trunk/lib/AST/ASTDumper.cpp
===================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp
+++ cfe/trunk/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());
}
Index: cfe/trunk/lib/AST/TypePrinter.cpp
===================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp
+++ cfe/trunk/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: cfe/trunk/test/Misc/ast-dump-pipe.cl
===================================================================
--- cfe/trunk/test/Misc/ast-dump-pipe.cl
+++ cfe/trunk/test/Misc/ast-dump-pipe.cl
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -triple spir64 -cl-std=CL2.0 -ast-dump -ast-dump-filter pipetype %s | FileCheck -strict-whitespace %s
+typedef pipe int pipetype;
+// CHECK: PipeType {{.*}} 'pipe int'
+// CHECK-NEXT: BuiltinType {{.*}} 'int'
Index: cfe/trunk/test/SemaOpenCL/invalid-access-qualifier.cl
===================================================================
--- cfe/trunk/test/SemaOpenCL/invalid-access-qualifier.cl
+++ cfe/trunk/test/SemaOpenCL/invalid-access-qualifier.cl
@@ -8,7 +8,7 @@
void test3(read_only read_only image1d_t i){} // expected-error{{multiple access qualifiers}}
#ifdef CL20
-void test4(read_write pipe int i){} // expected-error{{access qualifier 'read_write' can not be used for 'pipe'}}
+void test4(read_write pipe int i){} // expected-error{{access qualifier 'read_write' can not be used for 'pipe int'}}
#else
void test4(__read_write image1d_t i) {} // expected-error{{access qualifier '__read_write' can not be used for '__read_write image1d_t' earlier than OpenCL2.0 version}}
#endif
Index: cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl
===================================================================
--- cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl
+++ cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl
@@ -7,5 +7,5 @@
void test3(int pipe p){// expected-error {{cannot combine with previous 'int' declaration specifier}}
}
void test4() {
- pipe int p; // expected-error {{type 'pipe' can only be used as a function parameter}}
+ pipe int p; // expected-error {{type 'pipe int' can only be used as a function parameter}}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19524.55946.patch
Type: text/x-patch
Size: 2736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160503/9df74b37/attachment-0001.bin>
More information about the cfe-commits
mailing list