[PATCH] D45363: [OpenCL] Added -std/-cl-std=CL2.2/CLC++

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 6 08:29:17 PDT 2018


bader added inline comments.


================
Comment at: include/clang/Frontend/LangStandards.def:167
+LANGSTANDARD_ALIAS_DEPR(opencl22, "CL2.2")
+LANGSTANDARD_ALIAS_DEPR(opencl22, "clc++")
+LANGSTANDARD_ALIAS_DEPR(opencl22, "CLC++")
----------------
OpenCL C++ 1.0 specification defines only 'c++' value for -cl-std option.
Assuming that OpenCL C++ 1.0 might be supported by multiple OpenCL version, wouldn't 'CL2.2' confuse people?
As we have separate kernel language specification with independent version numbering, I think we should avoid using OpenCL API numbering for language version.

What is the naming scheme for next versions of OpenCL C++ specification? 'clc++N.M'?


================
Comment at: lib/Frontend/InitPreprocessor.cpp:428
   // OpenCL v1.0/1.1 s6.9, v1.2/2.0 s6.10: Preprocessor Directives and Macros.
-  if (LangOpts.OpenCL) {
+  if (LangOpts.OpenCL && !LangOpts.CPlusPlus) {
     // OpenCL v1.0 and v1.1 do not have a predefined macro to indicate the
----------------
I think we should not skip this section for OpenCL C++, but define OPENCL_CPP_VERSION macro.


https://reviews.llvm.org/D45363





More information about the cfe-commits mailing list