This is an archive of the discontinued LLVM Phabricator instance.

Include debug info for nested structs and classes
ClosedPublic

Authored by amccarth on Jun 24 2016, 4:00 PM.

Details

Summary

This includes nested types in the member list, even if there are no members of that type. Note that structs and classes have themselves as an "implicit struct" as the first member, so we skip implicit ones.

Most of the work (for me) was figuring out the tests that broke as a result of the ordering changes. In particular, please scrutinize the Objective C one, which doesn't actually nest a struct but has a member function with a pointer to an incomplete struct type.

Diff Detail

Repository
rL LLVM

Event Timeline

amccarth updated this revision to Diff 61853.Jun 24 2016, 4:00 PM
amccarth retitled this revision from to Include debug info for nested structs and classes.
amccarth updated this object.
amccarth added a reviewer: rnk.
amccarth added a subscriber: cfe-commits.
rnk added inline comments.Jun 29 2016, 12:49 PM
lib/CodeGen/CGDebugInfo.cpp
1075 ↗(On Diff #61853)

I would add && nestedRec->getDeclContext() == record to this condition to deal with the struct B { B(struct A*); }; test case.

test/CodeGenObjCXX/debug-info-cyclic.mm
11 ↗(On Diff #61853)

This is interesting, this test case shouldn't change. The lexical context for 'struct A' is B, but the semantic context is the surrounding TU. We should only list class members that use the parent class as their DeclContext.

Also, why is this an Obj-C++ test in the first place, it only uses C++...

amccarth marked 2 inline comments as done.Jun 29 2016, 2:00 PM
amccarth updated this revision to Diff 62283.Jun 29 2016, 2:01 PM

Applied suggestion from the comments, which eliminates the need to alter the ObjectiveC test.

rnk accepted this revision.Jun 30 2016, 8:17 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 30 2016, 8:17 AM
This revision was automatically updated to reflect the committed changes.