[DWARF] Revert sharing subprograms across CUs
authorJeremy Morse <jeremy.morse@sony.com>
Mon, 9 Aug 2021 11:40:21 +0000 (12:40 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Mon, 9 Aug 2021 11:43:43 +0000 (12:43 +0100)
commitd4ce9e463d51b18547dbd181884046abf77c5c91
tree6b784d679eb2372ffaa948011ee6d0c9ba93ef2f
parent0dda5425318a5785e3e19cfe369a43b221b9642d
[DWARF] Revert sharing subprograms across CUs

This patch is a revert of e08f205f5c2c. In that patch, DW_TAG_subprograms
were permitted to be referenced across CU boundaries, to improve stack
trace construction using call site information. Unfortunately, as
documented in PR48790, the way that subprograms are "owned" by dwarf units
is sufficiently complicated that subprograms end up in unexpected units,
invalidating cross-unit references.

There's no obvious way to easily fix this, and several attempts have
failed. Revert this to ensure correct DWARF is always emitted.

Three tests change in addition to the reversion, but they're all very
light alterations.

Differential Revision: https://reviews.llvm.org/D107076
14 files changed:
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/test/DebugInfo/AArch64/unretained-declaration-subprogram.ll [deleted file]
llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-indirect-param.mir
llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir
llvm/test/DebugInfo/MIR/X86/callsite-stack-value.mir
llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir
llvm/test/DebugInfo/X86/convert-loclist.ll
llvm/test/DebugInfo/X86/fission-call-site.ll [deleted file]
llvm/test/DebugInfo/X86/lto-cross-cu-call-origin-ref.ll [deleted file]
llvm/test/DebugInfo/X86/subprogram-across-cus.ll [new file with mode: 0644]