[all-commits] [llvm/llvm-project] 63074d: [DebugInfo][DwarfDebug] Move emission of globals f...
Vladislav Dzhidzhoev via All-commits
all-commits at lists.llvm.org
Wed Mar 4 11:32:34 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 63074da25d16376d4a5b27661d891623bf797fd3
https://github.com/llvm/llvm-project/commit/63074da25d16376d4a5b27661d891623bf797fd3
Author: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: 2026-03-04 (Wed, 04 Mar 2026)
Changed paths:
M lld/test/wasm/debuginfo.test
M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
M llvm/test/CodeGen/X86/dbg-distringtype-uint.ll
M llvm/test/DebugInfo/AArch64/DW_AT_APPLE_enum_kind.ll
M llvm/test/DebugInfo/AMDGPU/variable-locations.ll
M llvm/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll
M llvm/test/DebugInfo/Generic/debug-names-linkage-name.ll
M llvm/test/DebugInfo/Generic/dwarf5-debug-info-static-member.ll
M llvm/test/DebugInfo/Generic/inlined-static-var.ll
M llvm/test/DebugInfo/Generic/namespace.ll
M llvm/test/DebugInfo/MSP430/global-var.ll
M llvm/test/DebugInfo/NVPTX/debug-addr-class.ll
M llvm/test/DebugInfo/PowerPC/strict-dwarf.ll
M llvm/test/DebugInfo/WebAssembly/tls_pic_globals.ll
M llvm/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
M llvm/test/DebugInfo/X86/DW_AT_calling-convention.ll
M llvm/test/DebugInfo/X86/align_cpp11.ll
M llvm/test/DebugInfo/X86/align_objc.ll
M llvm/test/DebugInfo/X86/arange-and-stub.ll
M llvm/test/DebugInfo/X86/containing-type-extension-rust.ll
M llvm/test/DebugInfo/X86/debug-info-access.ll
M llvm/test/DebugInfo/X86/debug-info-static-member.ll
M llvm/test/DebugInfo/X86/debug-names-dwarf64.ll
M llvm/test/DebugInfo/X86/dwarf-aranges.ll
M llvm/test/DebugInfo/X86/dwarf-linkage-names.ll
M llvm/test/DebugInfo/X86/dwarfdump-DIImportedEntity_elements.ll
M llvm/test/DebugInfo/X86/generate-odr-hash.ll
M llvm/test/DebugInfo/X86/gnu-public-names.ll
M llvm/test/DebugInfo/X86/linkage-name.ll
M llvm/test/DebugInfo/X86/namelist1.ll
M llvm/test/DebugInfo/X86/prototyped.ll
M llvm/test/DebugInfo/X86/ref_addr_relocation.ll
M llvm/test/DebugInfo/X86/string-offsets-multiple-cus.ll
M llvm/test/DebugInfo/X86/string-offsets-table.ll
M llvm/test/DebugInfo/X86/template.ll
M llvm/test/DebugInfo/X86/tls.ll
M llvm/test/DebugInfo/X86/tu-to-non-tu.ll
M llvm/test/DebugInfo/X86/vla-global.ll
M llvm/test/DebugInfo/attr-btf_tag.ll
M llvm/test/MC/WebAssembly/debug-info.ll
M llvm/test/MC/WebAssembly/debug-info64.ll
M llvm/test/MC/WebAssembly/dwarfdump.ll
M llvm/test/MC/WebAssembly/dwarfdump64.ll
M llvm/test/tools/llvm-debuginfo-analyzer/DWARF/crash-thread-local-storage.test
Log Message:
-----------
[DebugInfo][DwarfDebug] Move emission of globals from beginModule() to endModule() (5/7) (#184219)
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
This patch moves the emission of global variables from
`DwarfDebug::beginModule()` to `DwarfDebug::endModule()`.
It has the following effects:
1. The order of debug entities in the resulting DWARF changes.
2. Currently, if a DISubprogram requires emission of both concrete
out-of-line and inlined subprogram DIEs, and such a subprogram contains
a static local variable, the DIE for the variable is emitted into the
concrete out-of-line subprogram DIE. As a result, the variable is not
available in debugger when breaking at the inlined function instance.
It happens because static locals are emitted in
`DwarfDebug::beginModule()`, but abstract DIEs for functions that are
not completely inlined away are created only later during
`DwarfDebug::endFunctionImpl()` calls.
With this patch, DIEs for static local variables of subprograms that
have both inlined and the concrete out-of-line instances are placed into
abstract subprogram DIEs. They become visible in debugger when breaking
at concrete out-of-line and inlined function instances.
`llvm/test/DebugInfo/Generic/inlined-static-var.ll` illustrates that.
3. It will allow to simplify abstract subprogram DIEs creation by
reverting https://github.com/llvm/llvm-project/pull/159104 later.
This is needed to simplify DWARF emission in a context of proper support
of function-local static variables which comes in the next patch
(https://reviews.llvm.org/D144008), making all function-local entities
handled in `DwarfDebug::endModuleImpl()`.
Authored-by: Kristina Bessonova <kbessonova at accesssoftek.com>
Co-authored-by: David Blaikie <dblaikie at gmail.com>
Co-authored-by: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list