[OpenCL] change default address space of pointers in CL2.0 mode

Matt Arsenault Matthew.Arsenault at amd.com
Mon Nov 17 14:48:11 PST 2014


On 11/17/2014 10:41 AM, Anastasia Stulova wrote:
> One of the difficulty is that Clang currently treats private address space
> just the same as if no address space qualifier was specified. That makes it
> difficult to find a right place to handle the default address space
> behaviour, because information becomes unavailable early on.

Would it be possible to change this? QualType can distinguish between 
hasAddressSpace() and getAddressSpace() == 0, but this isn't 
consistently used. A while ago I looked into fixing a problem with 
builtins where string literals don't work in OpenCL. Most notably, 
__builtin_nan doesn't work since the implicit conversion from the 
constant string to the no address space pointer of the builtin is 
rejected. I was thinking the correct thing to do would be to interpret 
the lack of an address space on the builtin as accepting any address 
space, and that would require consistently handling address space 0 
and/or making the private address space an explicit one like the others.

-Matt



More information about the cfe-commits mailing list