This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Fix sampler initialization for C++ mode
ClosedPublic

Authored by neil.hickey on Jul 16 2019, 4:30 AM.

Details

Summary

Sampler initialization from integer literal was broken in C++ mode for OpenCL. Fixing to allow functions that take a sampler to take an integer and for samplers to be initialized to integer values.

Diff Detail

Repository
rL LLVM

Event Timeline

neil.hickey created this revision.Jul 16 2019, 4:30 AM
Anastasia accepted this revision.Jul 16 2019, 5:02 AM

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.

lib/Sema/SemaOverload.cpp
1854 ↗(On Diff #210061)

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.

1856 ↗(On Diff #210061)

No idea why we are adding separate conversion kind for event and queue types. Again, it might be something we can simplify above.

This revision is now accepted and ready to land.Jul 16 2019, 5:02 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2019, 7:57 AM