This makes sure that we associate DIEs that are imported from other CUs with the appropriate decl context.
Without this fix, nested classes can be dumped directly into their CU context if their parent was imported from another CU.
Differential D68278
Fix evaluation of nested classes with parent from other CU jarin on Oct 1 2019, 8:37 AM. Authored by
Details This makes sure that we associate DIEs that are imported from other CUs with the appropriate decl context. Without this fix, nested classes can be dumped directly into their CU context if their parent was imported from another CU.
Diff Detail Event TimelineComment Actions Just a bit more context (we were discussing this with Jaroslav offline): without this line, the GetClangDeclContextForDie method will fail to locate the clang decl context for the OuterA::Inner class because the class OuterA has been parsed and linked to the DIE in other.cpp's debug info when the first expression was evaluated. I've looked through the code and this fix makes sense to me, but I am not super-familiar with this, so I'd appreciate if someone could have another look.
Comment Actions A few short comments what the role of the different classes/members play in the test case would be helpful. E.g. "This member/variable/expressions triggers the loading of Decl Foo in that CU". I'll take a closer look tomorrow, but on the first looks this patch LGTM. Thanks!
Comment Actions The fix makes sense to me, I wonder if we have a similar issue w/ namespaces or perhaps they are handled differently. Comment Actions I have added some comments to the test (I hope it is not too overboard), removed the LEVEL stuff from the Makefile and fixed the formatting. Comment Actions Just a few nitpicks about some minor typos, otherwise this LGTM. Thanks for the patch! I assume you need someone to commit this for you?
Comment Actions Fixed the nits, thanks for the careful review! I will indeed need someone to submit this for me. Thanks in advance :-)
|
This level stuff is no longer necessary.