[PATCH] D16040: [OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttr
Anastasia Stulova via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 26 04:30:11 PST 2016
Anastasia added inline comments.
================
Comment at: lib/Sema/SemaDeclAttr.cpp:5705
@@ -5669,8 +5704,3 @@
- // Walk the declarator structure, applying decl attributes that were in a type
- // position to the decl itself. This handles cases like:
- // int *__attr__(x)** D;
- // when X is a decl attribute.
- for (unsigned i = 0, e = PD.getNumTypeObjects(); i != e; ++i)
- if (const AttributeList *Attrs = PD.getTypeObject(i).getAttrs())
- ProcessDeclAttributeList(S, D, Attrs, /*IncludeCXX11Attributes=*/false);
+ // Skip pipe type, it will be processed twice with its element type
+ const ParmVarDecl *PDecl = llvm::dyn_cast<ParmVarDecl>(D);
----------------
Do you mean to remove "twice" here? As I think that's what you are trying to avoid.
================
Comment at: test/Parser/opencl-image-access.cl:2
@@ -1,2 +1,3 @@
// RUN: %clang_cc1 %s -fsyntax-only
+// RUN: %clang_cc1 %s -fsyntax-only -cl-std=CL2.0 -DCL20
----------------
please, add -verify flag
================
Comment at: test/Parser/opencl-image-access.cl:9
@@ -7,1 +8,3 @@
+#if CL20
__kernel void f__rw(__read_write image2d_t a) { }
+#endif
----------------
Btw, I can see that read_write is now accepted even if -cl-std=CL1.1. So essentially you don't need to add CL20 checks here.
But I might prepare a quick fix of it afterwards.
================
Comment at: test/SemaOpenCL/invalid-access-qualifier.cl:11
@@ +10,3 @@
+#ifdef CL20
+void test4(read_write image1d_t i){}
+
----------------
this is being tested in test/Parser/opencl-image-access.cl already
http://reviews.llvm.org/D16040
More information about the cfe-commits
mailing list