[cfe-dev] Proposal to simplify ObjC Type AST's

Fariborz Jahanian fjahanian at apple.com
Tue May 19 13:18:04 PDT 2009


On May 19, 2009, at 12:49 PM, steve naroff wrote:

>>
>> You are keeping ObjCInterfaceType for stand-alone interface (and  
>> presumably a variation for qualified interface type).
>> If so, then it is not clear to me how you do a type conversion from  
>> ObjCObjectPointerType to ObjCInterfaceType when user asks for it.
>> I know that it is rare, but it can happen as in the following test  
>> case:
>>
>> @interface I @end
>> I *pi;
>> int main()
>> {
>> 	return sizeof (*pi);
>> }
>>
>> I guess a more general question is does a pointer to  
>> ObjCInterfaceType conforms to  ObjCObjectPointerType?
>
> Great example. I think ObjCObjectPointerType would implement  
> getPointeeType(), which would return an ObjCInterfaceType. This is  
> what BlockPointerType and MemberPointerType do.
>
> Sema::CheckIndirectionOperand() will need to allow for this, since  
> the "*" will be implicit.
>
> Make sense?

Yes. There is still a question of what to do when 'id'/'Class' 's  
declaration seen in objc.h. Since you going to
treat them as first-class types. Then one possible solution is to  
#ifdef them out for clang as its has outlived its
usefulness.

- Fariborz

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


More information about the cfe-dev mailing list