[PATCH] D17438: [OpenCL] Add Sema checks for atomics and implicit declaration

Xiuli PAN via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 18:46:07 PST 2016


pxli168 added a comment.

It seems this patch is useless.
The spec does not tell about implicit declaration of function, but now clang with -triple spir will output err if there is implicit declaration of function.
I have read about spir and opencl spec but could not find anything talk about that.
If this is a clang bug then this patch is useless.

What do you think?


================
Comment at: lib/Sema/SemaDecl.cpp:3900
@@ -3899,1 +3899,3 @@
   if (!DeclaresAnything) {
+    // OpenCL C doesn't support bit-field, so declaration with no declarator
+    // has no use.
----------------
Anastasia wrote:
> I am still not convinced about this change? Could you give reference to spec or an example? I don't understand why you are trying to change default C behavior.
Just removed.

================
Comment at: lib/Sema/SemaDecl.cpp:7283
@@ -7276,3 +7282,3 @@
       return PtrPtrKernelParam;
-    return PointeeType.getAddressSpace() == 0 ? PrivatePtrKernelParam
-                                              : PtrKernelParam;
+    // Now generice address space is added, we need to handle like this
+    unsigned addrSpace = PointeeType.getAddressSpace();
----------------
Anastasia wrote:
> Why this code?
Removed.


http://reviews.llvm.org/D17438





More information about the cfe-commits mailing list