[cfe-dev] Fwd: "generic" address space

Mon P Wang monping at apple.com
Mon Jul 14 23:36:27 PDT 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>  
>> wrote:
>>> 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,  
>>> especially
>>> 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  
>>> if
>>> an argument and a parameter type are compatible.
>>
>> I don't really like this approach: you're introducing a fake type  
>> that
>> 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  
>>> different
>>> 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.
>
>
> Thanks,
>  -- Mon Ping

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080714/f300dc8f/attachment.html>


More information about the cfe-dev mailing list