[Patch]OpenCL size_t and ptrdiff_t as builtin types

Tanya Lattner lattner at apple.com
Fri Feb 8 13:50:22 PST 2013


Guy,

I do not believe that the spec requires that size_t be a keyword/built in type. So adding this to Clang is not a required part of the language. The spec only has one real constraint to size_t that I can find, which is the error you have added. This could be implemented another way that doesn't require that size_t be a builtin type. It is not ideal, but there is an option.

I think making this a builtin type may have implications that this patch does not cover (i.e. promotion and conversion rules), in addition to just more bloat to the compiler.

I'm leaning towards it not being a built in type.

-Tanya



On Feb 6, 2013, at 12:13 PM, "Benyei, Guy" <guy.benyei at intel.com> wrote:

> Thanks Joey.
> Any other comments about this fix, or should I go and commit it?
> 
> Thanks
>   Guy Benyei
> 
> -----Original Message-----
> From: Joey Gouly [mailto:Joey.Gouly at arm.com] 
> Sent: Tuesday, February 05, 2013 16:35
> To: Benyei, Guy; cfe-commits at cs.uiuc.edu
> Subject: RE: [Patch]OpenCL size_t and ptrdiff_t as builtin types
> 
> Hi Guy,
> 
> This patch looks good to me.
> 
> I changed the code a bit around your changes in lib/Sema/SemaDecl.cpp, but it will be easy to fix.
> 
> Thanks,
> Joey
> 
> From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Benyei, Guy
> Sent: 05 February 2013 13:11
> To: cfe-commits at cs.uiuc.edu
> Subject: RE: [Patch]OpenCL size_t and ptrdiff_t as builtin types
> 
> Any comments on this patch?
> 
> Thanks
>   Guy Benyei
> 
> 
> From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Benyei, Guy
> Sent: Wednesday, January 30, 2013 22:46
> To: cfe-commits at cs.uiuc.edu
> Subject: [Patch]OpenCL size_t and ptrdiff_t as builtin types
> 
> Hello,
> Attached a patch that makes OpenCL size_t and ptrdiff_t types Clang builtin types.
> In OpenCL size_t is not a library define, but an actual keyword, a type that is available without special includes, and it also has some specific restriction.
> 
> Please review
> 
> Thanks
>    Guy Benyei
> 
> 
> 
> 
> -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.
> 
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list