[all-commits] [llvm/llvm-project] fc0993: [AsmPrinter] Find a DIE's unit by its owner, not b...

Arcadiy Ivanov via All-commits all-commits at lists.llvm.org
Fri Oct 2 09:49:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc0993001ce85dc5f485ddb26bea29fd8ee15ac9
      https://github.com/llvm/llvm-project/commit/fc0993001ce85dc5f485ddb26bea29fd8ee15ac9
  Author: Arcadiy Ivanov <arcadiy at ivanov.biz>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/DIE.h
    M llvm/lib/CodeGen/AsmPrinter/DIE.cpp
    A llvm/test/tools/llvm-dwarfutil/ELF/X86/dwarf5-partial-unit-ref-addr.test
    M llvm/unittests/CodeGen/DIETest.cpp

  Log Message:
  -----------
  [AsmPrinter] Find a DIE's unit by its owner, not by its tag (#219660)

[AsmPrinter] Find a DIE's unit by its owner
Fix DIE::getUnitDie() for DW_TAG_partial_unit. The existing parent walk
recognizes unit roots by tag but omits partial units, so a cross-unit
DW_FORM_ref_addr can reach getDebugSectionOffset() without a unit and
assert.

Have getUnit() walk the parent chain until Owner contains a DIEUnit, then
derive getUnitDie() from that unit. A DIEUnit owns its unit DIE, so this
handles every unit root tag without maintaining another tag list and
still returns null for a DIE tree that no DIEUnit owns. Use
dwarf::isUnitType for the constructor assertion as well. Update the
DIEUnit comments to describe the owner-based walk.

Add unit coverage for all four unit root tags and an unowned DIE tree.
Add a dwarfutil test for resolving DW_FORM_ref_addr into a partial unit
with and without garbage collection. Keep that test on the classic
linker and omit --verify because of #219613 and #219365.

Fixes #219650.

Assisted-by: Claude Code



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