This is an archive of the discontinued LLVM Phabricator instance.

[PR40778][Sema] Adjust address space of operands in builtin operators
ClosedPublic

Authored by Anastasia on Feb 27 2019, 8:16 AM.

Details

Summary

Adjust address space for references and pointer operands of builtin operators.

Currently this patch only changes addr space for OpenCL in assignment ( = and |=) operator, that is needed to fix the bug in the testcase reported in:
https://bugs.llvm.org/show_bug.cgi?id=40778

If general direction is fine I plan to generalize to other operators too.

Diff Detail

Repository
rC Clang

Event Timeline

Anastasia created this revision.Feb 27 2019, 8:16 AM
Anastasia updated this revision to Diff 188566.Feb 27 2019, 9:11 AM
Anastasia edited the summary of this revision. (Show Details)

I think the right model is that a builtin operator candidate exists for all possible address-space qualifiers on the pointer/reference pointee, and it should be straightforward to only actually add candidates for the qualifier used by the corresponding operand.

Anastasia updated this revision to Diff 189527.Mar 6 2019, 9:35 AM

I now create overloads for all address spaces that are being called.

Looks great, thanks!

rjmccall accepted this revision.Mar 6 2019, 7:28 PM
This revision is now accepted and ready to land.Mar 6 2019, 7:28 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2019, 8:43 AM
Herald added a subscriber: kristina. · View Herald Transcript