Summary:
Fix the dump of PipeType.
Now we will have "pipe int" and element type.
Reviewers: yaxunl, Anastasia
Subscribers: cfe-commits, bader
Differential Revision: http://reviews.llvm.org/D19524
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268364
91177308-0d34-0410-b5e6-
96231b3b80d8
void VisitAtomicType(const AtomicType *T) {
dumpTypeAsChild(T->getValueType());
}
+ void VisitPipeType(const PipeType *T) {
+ dumpTypeAsChild(T->getElementType());
+ }
void VisitAdjustedType(const AdjustedType *T) {
dumpTypeAsChild(T->getOriginalType());
}
void TypePrinter::printPipeBefore(const PipeType *T, raw_ostream &OS) {
IncludeStrongLifetimeRAII Strong(Policy);
- OS << "pipe";
+ OS << "pipe ";
+ print(T->getElementType(), OS, StringRef());
spaceBeforePlaceHolder(OS);
}
--- /dev/null
+// 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'
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
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}}
}