[DebugMetadata][DwarfDebug] Support function-local types in lexical block scopes...
authorVladislav Dzhidzhoev <vdzhidzhoev@accesssoftek.com>
Mon, 19 Jun 2023 14:42:05 +0000 (16:42 +0200)
committerVladislav Dzhidzhoev <vdzhidzhoev@accesssoftek.com>
Mon, 19 Jun 2023 14:42:43 +0000 (16:42 +0200)
commit66511b401042f28c74d2ded3aac76d19a53bd7c4
treec8e755fe154051a38273ff6d9df808db9814a658
parentfa45f81ff7ea9fc2a2a40fea8dd7626ecc3a8dbb
[DebugMetadata][DwarfDebug] Support function-local types in lexical block scopes (4/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

Similar to imported declarations, the patch tracks function-local types in
DISubprogram's 'retainedNodes' field. DwarfDebug is adjusted in accordance with
the aforementioned metadata change and provided a support of function-local
types scoped within a lexical block.

The patch assumes that DICompileUnit's 'enums field' no longer tracks local
types and DwarfDebug would assert if any locally-scoped types get placed there.

Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com>
Differential Revision: https://reviews.llvm.org/D144006

Depends on D144005
23 files changed:
clang/test/CodeGen/debug-info-codeview-unnamed.c
clang/test/CodeGen/debug-info-unused-types.c
clang/test/CodeGen/debug-info-unused-types.cpp
clang/test/CodeGenCXX/debug-info-access.cpp
clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp
clang/test/CodeGenCXX/debug-info-codeview-unnamed.cpp
clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp
clang/test/CodeGenCXX/debug-lambda-this.cpp
llvm/include/llvm/IR/DIBuilder.h
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/IR/DIBuilder.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/Bitcode/upgrade-cu-locals.ll
llvm/test/Bitcode/upgrade-cu-locals.ll.bc
llvm/test/DebugInfo/Generic/inlined-local-type.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/lexical-block-retained-types.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/lexical-block-types.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/local-type-as-template-parameter.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll
llvm/test/DebugInfo/X86/set.ll