Page MenuHomePhabricator

[lldb] Forcefully complete a type when adding nested classes

Authored by labath on Aug 14 2020, 5:36 AM.



With -flimit-debug-info, we can run into cases when we only have a class
as a declaration, but we do have a definition of a nested class. In this
case, clang will hit an assertion when adding a member to an incomplete
type (but only if it's adding a c++ class, and not C struct).

It turns out we already had code to handle a similar situation arising
in the -gmodules scenario. This extends the code to handle
-flimit-debug-info as well, and reorganizes bits of other code handling
completion of types to move functions doing similar things closer

Diff Detail

Event Timeline

labath created this revision.Aug 14 2020, 5:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2020, 5:36 AM
labath requested review of this revision.Aug 14 2020, 5:36 AM
teemperor accepted this revision.Aug 16 2020, 11:34 PM



You could just get the TypeSystemClang from the type (passing a different TypeSystemClang that is not type.getTypeSystem() would lead to strange bugs, so we might as well make that situation impossible by not giving the caller the option).

This revision is now accepted and ready to land.Aug 16 2020, 11:34 PM
This revision was landed with ongoing or failed builds.Aug 17 2020, 2:09 AM
This revision was automatically updated to reflect the committed changes.
MaskRay added inline comments.

In many cases rm -rf %t is not needed. split-file will unlink the output if it was originally a file.


No need to change now: -o is recommended (I think the arguments are (1) for aesthetic value (2) when llvm-mc fails, don't leave an empty file)

labath added inline comments.Aug 19 2020, 5:42 AM

Aha. That seems useful, albeit unexpected.