svenvh added inline comments.

================
Comment at: lib/Frontend/InitPreprocessor.cpp:1063
+    auto OpenCLVersion =
+        LangOpts.OpenCLCPlusPlus ? 200 : LangOpts.OpenCLVersion;
+#define OPENCLEXT(Ext)                                                         
\
----------------
Why not set `OpenCLVersion` in `lib/Frontend/CompilerInvocation.cpp` instead?  
Then you wouldn't have to "override" the version in multiple places (which 
increases the risk of missing one or more places).


================
Comment at: lib/Sema/Sema.cpp:265
     addImplicitTypedef("event_t", Context.OCLEventTy);
-    if (getLangOpts().OpenCLVersion >= 200) {
+    if (getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) {
       addImplicitTypedef("clk_event_t", Context.OCLClkEventTy);
----------------
This also exposes the OpenCL 2.0 types in OpenCL C++ mode; it would be good to 
mention that in the commit message.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57824/new/

https://reviews.llvm.org/D57824



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to