[PATCH] D64791: [OpenCL] Fix sampler initialization for C++ mode

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 16 05:02:30 PDT 2019


Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks!

I expect the example from the bug is going to compile now: https://bugs.llvm.org/show_bug.cgi?id=41009

Can you please close the bug after the commit.



================
Comment at: lib/Sema/SemaOverload.cpp:1854
     FromType = ToType;
+  } else if (ToType->isSamplerT() &&
+             From->isIntegerConstantExpr(S.getASTContext())) {
----------------
My only comment here is that we might be able to remove the same logic where it works just for C. But it can be done in a separate patch too.


================
Comment at: lib/Sema/SemaOverload.cpp:1856
+             From->isIntegerConstantExpr(S.getASTContext())) {
+    SCS.Second = ICK_Compatible_Conversion;
+    FromType = ToType;
----------------
No idea why we are adding separate conversion kind for event and queue types. Again, it might be something we can simplify above.


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

https://reviews.llvm.org/D64791





More information about the cfe-commits mailing list