[PATCH] D109002: [OpenCL] Supports optional image types in C++ for OpenCL 2021

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 1 02:33:47 PDT 2021


Anastasia added inline comments.


================
Comment at: clang/lib/Sema/SemaType.cpp:1729
     bool IsOpenCLC30 = (S.getLangOpts().OpenCLVersion == 300);
+    bool IsOpenCLC30Comp = S.getLangOpts().getOpenCLCompatibleVersion() == 300;
     // OpenCL C v3.0 s6.3.3 - OpenCL image types require __opencl_c_images
----------------
I think we should just replace `IsOpenCLC30` as it is when only used in the diagnostic that we should report the same as for OpenCL 3.0.


Also I would suggest changing name to `IsOpenCLC30Compatible` to make it clearer. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109002



More information about the cfe-commits mailing list