[cfe-dev] Fix for PR4701

David Chisnall csdavec at swansea.ac.uk
Fri Aug 14 13:56:21 PDT 2009


Hi Everyone,

This patch provides an actual fix (as opposed to my previous attempt,  
which just moved the bugs around) for PR4701, where code accessing  
fields declared on Objective-C pseudo-builtin types id and Class broke.

With this patch applied, all test pass and programs that include the  
GNU runtime's <obj/objc-api.h> compile correctly.

I am not totally convinced by the approach here.  If a redefinition of  
id or Class is encountered, this is stored any any attempt to access a  
field on one of these builtins is then implicitly cast to the real  
type.  This is quite ugly, but seems less ugly than doing it the other  
way around (adding special cases to all of the Objective-C stuff to  
let struct objc_object* act as a receiver, and so on).

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.diff
Type: application/octet-stream
Size: 8271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090814/d9162469/attachment.obj>


More information about the cfe-dev mailing list