[PATCH] D20602: Add .rgba syntax extension to ext_vector_type types

Pirama Arumuga Nainar via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 11:02:21 PDT 2016


pirama added inline comments.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:7900
@@ -7897,1 +7899,3 @@
+def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
+  "vector component name '%0' is an OpenCL 2.2 extension">;
 } // end of sema category
----------------
Anastasia wrote:
> Could it be an error instead for CL <2.2? It isn't a valid feature and we have already rejected similar cases with an error. 
> 
> How about changing to something like:
>   "vector component name '%0' is not supported in earlier than OpenCL version 2.2"
> 
> See similar diagnostics above - err_opencl_invalid_read_write, err_opencl_unknown_type_specifier.
> 
> Using extension might be confusing because we have core spec and extension spec in OpenCL.
Since .rgba is just a syntactic feature in the frontend that requires no support from the runtime, should this be an error?  Making this an ExtWarn, like Richard suggested, will reject these under -pedantic-errors.  But I'll let you make this call.

I'll update the diagnostic message to the following, if that's ok:

> "vector component name '%0' cannot be used earlier than OpenCL version 2.2.




http://reviews.llvm.org/D20602





More information about the cfe-commits mailing list