[cfe-commits] [cfe-dev] Clang and OpenCL address spaces
John McCall
rjmccall at apple.com
Mon Oct 18 13:44:56 PDT 2010
On Oct 18, 2010, at 1:38 PM, Peter Collingbourne wrote:
> On Mon, Oct 18, 2010 at 10:43:24AM -0700, John McCall wrote:
>> On Oct 18, 2010, at 10:33 AM, Peter Collingbourne wrote:
>>>> From my understanding of the OpenCL specification, setting the address
>>> space on an automatic variable is supposed to not only change the
>>> address space but also make the variable static (as the term is defined
>>> in standard C). Adding 'static' to the qualifier macro definitions
>>> won't work too well because the qualifiers can also appear in other
>>> places.
>>
>> If that's how OpenCL is specified to work, then changing the front-end to
>> automatically add 'static' to local variables of address-space-qualified type
>> is a very reasonable solution. We would accept a patch for this.
>
> Patch attached. OK to commit?
Generally okay. Two requests:
1) Please quote something appropriate from the OpenCL spec here.
2) This should almost certainly be conditioned on not having an explicit
storage class; if the user wrote 'auto' or 'register', we should not just ignore
that (unless the spec says to, but that would be wierd).
John.
More information about the cfe-commits
mailing list