[PATCH] D19071: [OpenCL] Add predefined macros.

Xiuli PAN via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 13 20:21:27 PDT 2016


pxli168 added inline comments.

================
Comment at: lib/Frontend/InitPreprocessor.cpp:421
@@ +420,3 @@
+    switch (LangOpts.OpenCLVersion) {
+    case 0:
+    case 100:
----------------
What is 0 stand for as OpenCLVersion, it seems the default OpenCLVersion if we did not pass any -cl-std=CLXX is 100.
So maybe we did not need this case 0:

================
Comment at: lib/Frontend/InitPreprocessor.cpp:439
@@ +438,3 @@
+    if (LangOpts.OpenCLVersion >= 110)
+      Builder.defineMacro("CL_VERSION_1_1", "110");
+    if (LangOpts.OpenCLVersion >= 120)
----------------
These macros maybe need for all cl version, and in the header we should compare  __OPENCL_C_VERSION__ with CL_VERSION_2_0 instead of the integer 200 in the header of  http://reviews.llvm.org/D18369? 


http://reviews.llvm.org/D19071





More information about the cfe-commits mailing list