[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 10:20:25 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
----------------
Topotuna wrote:
> Anastasia wrote:
> > 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. 
> That diagnostic is responsible for `__opencl_c_3d_image_writes` feature while current commit addresses `__opencl_c_images`. I wanted to keep commits separate and was planning to finish transitioning from `IsOpenCLC30` to `IsOpenCLC30Compatible` in a future commit.
> 
> I agree that `IsOpenCLC30Compatible` would be clearer. Thank you.
Ok, let's just only rename it for now and add a FIXME comment explaining that the variables should be unified later on.

I suspect your subsequent commits would include the unification?


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