-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local impor…
…ted entities (3/7) RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544 Fixed PR51501 (tests from D112337). 1. Reuse of DISubprogram's 'retainedNodes' to track other function-local entities together with local variables and labels (this patch cares about function-local import while D144006 and D144008 use the same approach for local types and static variables). So, effectively this patch moves ownership of tracking local import from DICompileUnit's 'imports' field to DISubprogram's 'retainedNodes' and adjusts DWARF emitter for the new layout. The old layout is considered unsupported (DwarfDebug would assert on such debug metadata). DICompileUnit's 'imports' field is supposed to track global imported declarations as it does before. This addresses various FIXMEs and simplifies the next part of the patch. 2. Postpone emission of function-local imported entities from `DwarfDebug::endFunctionImpl()` to `DwarfDebug::endModule()`. While in `DwarfDebug::endFunctionImpl()` we do not have all the information about a parent subprogram or a referring subprogram (whether a subprogram inlined or not), so we can't guarantee we emit an imported entity correctly and place it in a proper subprogram tree. So now, we just gather needed details about the import itself and its parent entity (either a Subprogram or a LexicalBlock) during processing in `DwarfDebug::endFunctionImpl()`, but all the real work is done in `DwarfDebug::endModule()` when we have all the required information to make proper emission. Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com> Differential Revision: https://reviews.llvm.org/D144004
- Loading branch information
1 parent
aee3a9f
commit d80fdc6
Showing
35 changed files
with
769 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.