[PATCH] OpenCL/SPIR - fix kernel_arg_type metadata node

Fraser Cormack fraser at codeplay.com
Wed Jul 30 06:29:30 PDT 2014


Hi,

So I just tried "unsigned" without the type name and clang still 
reported it as "unsigned int" and everything worked as expected. Does 
this sound good to commit?

Cheers,
Fraser

On 30/07/14 14:28, Pekka Jääskeläinen wrote:
> Hi,
>
> Is 'unsigned' (without the type name) legal in OpenCL C like it's in C?
> If so, it might still break with this (converts to 'u' instead of 
> 'uint'?). Otherwise LGTM.
>
> On 07/30/2014 02:04 PM, Fraser Cormack wrote:
>> Hi,
>>
>> This patch fixes a bug where the OpenCL kernel_arg_type metadata node
>> can mistakenly switch "unsigned" to "u" for non-canonical types.
>>
>> Before,
>>
>>      typedef unsigned int myunsignedint;
>>      kernel void foo4(__global unsigned int * X, __global myunsignedint
>> * Y) {}
>>
>> would have produced:
>>
>>      metadata !{metadata !"kernel_arg_type", metadata !"uint*", metadata
>> !"myunt*"}
>>
>> As it switched any occurrence of "unsigned " to "u".
>>
>> Cheers,
>> Fraser
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
>


-- 
Fraser Cormack
Compiler Developer
Codeplay Software Ltd
45 York Place, Edinburgh, EH1 3HP
Tel: 0131 466 0503
Fax: 0131 557 6600
Website: http://www.codeplay.com
Twitter: https://twitter.com/codeplaysoft

This email and any attachments may contain confidential and /or privileged information and  is for use  by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it,or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: 81 Linkfield Street, Redhill RH1 6BY




More information about the cfe-commits mailing list