[all-commits] [llvm/llvm-project] ab4756: DebugInfo: Don't put types in type units if they r...

David Blaikie via All-commits all-commits at lists.llvm.org
Sun Jan 23 14:17:53 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab4756338c5b2216d52d9152b2f7e65f233c4dac
      https://github.com/llvm/llvm-project/commit/ab4756338c5b2216d52d9152b2f7e65f233c4dac
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2022-01-23 (Sun, 23 Jan 2022)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    M llvm/test/DebugInfo/X86/tu-to-non-tu.ll

  Log Message:
  -----------
  DebugInfo: Don't put types in type units if they reference internal linkage types

Doing this causes a declaration of the internal linkage (anonymous
namespace) type to be emitted in the type unit, which would then be
ambiguous as to which internal linkage definition it refers to (since
the name is only valid internally).

It's possible these internal linkage types could be resolved relative to
the unit the TU is referred to from - but that doesn't seem ideal, and
there's no reason to put the type in a type unit since it can only be
defined in one CU anyway (since otherwise it'd be an ODR violation) & so
avoiding the type unit should be a smaller DWARF encoding anyway.

This also addresses an issue with Simplified Template Names where the
template parameter could not be rebuilt from the declaration emitted
into the TU (specifically for an enum non-type template parameter, where
looking up the enumerators is necessary to rebuild the full template
name)




More information about the All-commits mailing list