]> granicus.if.org Git - clang/commit
Build debug info for ObjC interface types at the end of the translation unit to ensur...
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 5 May 2014 23:23:53 +0000 (23:23 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 5 May 2014 23:23:53 +0000 (23:23 +0000)
commitba7ed349fb550bbf11e19094f7755d03258c5499
treed6c69b953ef5be65d54a6c91408ebbefa15a2cff
parentd843795a42095f998d6531f6520c96a14060f1f0
Build debug info for ObjC interface types at the end of the translation unit to ensure all ivars are included.

This takes a different approach than the
completedType/requiresCompleteType work which relies on AST callbacks to
upgrade the type declaration to a definition. Instead, just defer
constructing the definition to the end of the translation unit.

This works because the definition is never needed by other debug info
(so far as I know), whereas the definition of a struct may be needed by
other debug info before the end of the translation unit (such as
emitting the definition of a member function which must refer to that
member function's declaration).

If we had a callback for whenever an IVar was added to an ObjC interface
we could use that, and remove the need for the ObjCInterfaceCache, which
might be nice. (also would need a callback for when it was more than
just a declaration so we could get properties, etc).

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.

There's still the PR19562 memory leak, but this should hopefully make
that a bit easier to approach.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208015 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
test/CodeGenObjC/debug-info-ivars-indirect.m