[cfe-dev] Fix for ObjC Class / id definition regression

Daniel Dunbar daniel at zuster.org
Sat Aug 8 12:40:45 PDT 2009


Hi David,

On Sat, Aug 8, 2009 at 10:07 AM, David Chisnall<theraven at sucs.org> wrote:
> The current code, which simply ignores the definition for any type
> named id or Class, is obviously wrong (and breaks lots of existing
> code, for example anything that includes the standard GNU runtime
> headers).

Probably makes sense to file a PR with a preprocessed input attached
to it for Steve to look at.

> A fix needs to allow fields on variables of type id and Class to be
> accessed with normal C semantics, but also allow the pointers with the
> id and Class types to be receivers for messages.

Which pointers within the types are used? We support isa via the
custom ObjCIsaExpr, but are there other fields which are used in
common code?

 - Daniel

> On 8 Aug 2009, at 15:58, David Chisnall wrote:
>
>> Please ignore this patch, it breaks more than it fixes (although the
>> problem is real and does prevent clang from working with any
>> Objective-
>> C programs on non-Apple platforms and possibly on Apple platforms with
>> the legacy runtime).
>>
>> David
>>
>> On 8 Aug 2009, at 15:46, David Chisnall wrote:
>>
>>> Hi,
>>>
>>> The attached diff fixes the recently-introduced regression where
>>> clang ignores the definitions of the Objective-C types in a header
>>> (although not, I believe, from a precompiled header, although I'd
>>> need to check that).  The attached test.m is a preprocessed file
>>> including one of the GNU runtime headers which demonstrates the
>>> problem.  This will also be a problem with the legacy Apple runtime,
>>> but not with the modern runtime (where these types are opaque).
>>>
>>> David
>>> <clang.diff><test.m>_______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list