[PATCH] D20630: [OpenCL] Allow -std=cl|CL1.1|CL1.2|CL2.0 in driver

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 07:00:45 PDT 2016


Anastasia added inline comments.

================
Comment at: lib/Frontend/CompilerInvocation.cpp:1587-1589
@@ -1579,3 +1586,4 @@
+    .Case("cl", LangStandard::lang_opencl)
     .Case("CL1.1", LangStandard::lang_opencl11)
     .Case("CL1.2", LangStandard::lang_opencl12)
     .Case("CL2.0", LangStandard::lang_opencl20)
----------------
rsmith wrote:
> yaxunl wrote:
> > rsmith wrote:
> > > How about changing these to the lowercase form too, and treating the uppercase versions as (deprecated) synonyms? (And likewise changing LangStandards.def to list the lowercase versions, perhaps with the uppercase versions as aliases.)
> > -cl-std=CL1.1|CL1.2|CL2.0 is defined by OpenCL spec. Allowing lower case may cause some confusion.
> > 
> > -cl-std=cl is not part of OpenCL spec.
> > 
> > How about keeping all -cl-std= options big letters and all -std= options small letters?
> What? The OpenCL spec does not get to dictate our command-line argument syntax. If they think they do, they're just mistaken.
OpenCL spec s5.8.4.5 standardizes the compiler option controlling the OpenCL C version to be as Sam mentioned above:
  -cl-std=CL1.1|CL1.2|CL2.0

But this is a part of driver compilation API, and surely doesn't have anything to do with standalone Clang itself.

However, I must say using uppercase letters for CL version is quite common in OpenCL community while using lowercase format is more common for C community.

I don't have much preference here to be honest, as soon as we are consistent in one way or another. 


http://reviews.llvm.org/D20630





More information about the cfe-commits mailing list