[cfe-dev] OpenCL parsing / type support

Chris Lattner clattner at apple.com
Wed Mar 10 10:24:58 PST 2010


On Mar 9, 2010, at 11:42 PM, brdavs wrote:

> 
>> AFAIK, common opencl implementations have various hacks on
>> top of mainline clang, so I doubt clang mainline will be a
>> compliant implementation out of the box.
> 
> That's how it appears. For parsing only, what's missing is:
> 
> 1. address space qualifiers (eg., __global float*, __constant int, 
> __local char*) 
> 2. function qualifiers (eg, __kernel void foo(...) ),
> some builtin types (float4, float8, float16, image2d_t, etc.)

These are not magic parser features, in the opencl implementations I'm aware of, these are macros that come from an implicit #include.  These are #defines for various attributes, __global typically turns into __attribute__((address_space.  __kernel turns into attribute(annotate)

> 3. image access qualifiers (eg, __read_only, __write_only, 
> __read_write).

I don't know what these do, not familiar enough with OpenCL.

-Chris





More information about the cfe-dev mailing list