[cfe-dev] OpenCL and Type Poisoning

Chris Lattner clattner at apple.com
Wed Jan 26 10:58:04 PST 2011


On Jan 26, 2011, at 10:41 AM, John McCall wrote:

> On Jan 26, 2011, at 12:02 AM, Speziale Ettore wrote:
>> I have tried to implement an "openlcl_kernel_poison" pragma, but I've
>> seen that the pragma construct is too far from what I want to do. Thus,
>> I've tried to implement the same think with an attribute:
>> 
>> typedef long size_t __attribute__((opencl_kernel_poison));
> 
> Having an attribute on typedefs makes sense to me.  It does not make
> any sense as a type qualifier;  among other things, it's a property of types,
> not something that makes a different type.
> 
> I don't think the OpenCL poisoning semantics are generic enough to be
> worth supporting in the standard compiler.

I agree.  For constraints like this, it is best for an opencl compiler to walk the parsed AST and do custom validity checks as an AST walk.  There is no need to do this as part of Sema.

-Chris



More information about the cfe-dev mailing list