r208015 - Build debug info for ObjC interface types at the end of the translation unit to ensure all ivars are included.

Jordan Rose jordan_rose at apple.com
Mon May 5 16:49:22 PDT 2014


On May 5, 2014, at 16:46 , David Blaikie <dblaikie at gmail.com> wrote:

> On Mon, May 5, 2014 at 4:38 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>> @interface is a definition of an ObjC class, but it doesn't contain all the ivars. @implementation can also contain ivars, but it's not in the redeclaration chain for the @interface/@class. Is this going to mess things up at all?
> 
> If the @implementation isn't in the redeclaration chain of the
> @interface, then I'm not sure how those two entities would be related
> in the debug info... but a cursory test (a simple @implementation
> placed at the end of the test case, containing a single @public int)
> does cause the debug info to have that member variable included in the
> debug info...
> 
> Is that the sort of case you were concerned about?

I guess so. I don't know enough about debug info generation to know what's important here, but this section scared me:

> A side benefit is that we also don't need the CompletedTypeCache
> anymore. Just rely on the declaration-ness of a type to decide whether
> its definition is yet to be emitted.

...since an ObjCInterfaceDecl is considered a definition long before we may have seen all the ivars. (In fact, you can only be sure you've seen all the ivars if the TU has an @implementation in it.)

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140505/49865153/attachment.html>


More information about the cfe-commits mailing list