[cfe-dev] Fwd: "generic" address space
Mon P Wang
monping at apple.com
Tue Jul 15 01:36:27 CDT 2008
Forgot to send it to the entire list.
Begin forwarded message:
> From: Mon P Wang <wangmp at apple.com>
> Date: July 14, 2008 11:22:42 PM PDT
> To: Eli Friedman <eli.friedman at gmail.com>
> Subject: Re: [cfe-dev] "generic" address space
> Hi Eli,
> On Jul 14, 2008, at 10:46 PM, Eli Friedman wrote:
>> On Mon, Jul 14, 2008 at 10:21 PM, Mon P Wang <wangmp at apple.com>
>>> To generate this in Clang, I didn't want to require the user to have
>>> to specify what specific address spaces a builtin can take,
>>> if the intrinsic is supported on the address space for a particular
>>> machine. So, I added the concept to ASQualType the concept of a
>>> "generic" address space that can be used in the parameter type of a
>>> function prototype. This concept is used when we checking to see
>>> an argument and a parameter type are compatible.
>> I don't really like this approach: you're introducing a fake type
>> isn't actually usable by user code, which seems messy at best. I
>> think it would be better to handle this like __builtin_shufflevector,
>> where typechecking gets done by a custom validator.
> What you suggest sounds like a reasonable alternative. I'll take a
> look into doing it this way for any built-in of this flavor.
>>> I'm also going to change clang to generate an error if the compiler
>>> needs to do an implicit cast between to pointers pointing at
>>> address spaces. Typically, this operation doesn't make sense. Note
>>> that users can still do explicit cast between address spaces.
>> I think that's fine; of course, please submit this patch separately.
> Sure no problem.
> -- Mon Ping
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev