[all-commits] [llvm/llvm-project] 30038d: [DWARF] Allow cross-CU references of subprogram de...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Tue Dec 10 14:10:45 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 30038da15b18ac4e34b9ea7a648382ae481e4770
      https://github.com/llvm/llvm-project/commit/30038da15b18ac4e34b9ea7a648382ae481e4770
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2019-12-10 (Tue, 10 Dec 2019)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    A llvm/test/DebugInfo/X86/lto-cross-cu-call-origin-ref.ll

  Log Message:
  -----------
  [DWARF] Allow cross-CU references of subprogram definitions

This allows a call site tag in CU A to reference a callee DIE in CU B
without resorting to creating an incomplete duplicate DIE for the callee
inside of CU A.

We already allow cross-CU references of subprogram declarations, so it
doesn't seem like definitions ought to be special.

This improves entry value evaluation and tail call frame synthesis in
the LTO setting. During LTO, it's common for cross-module inlining to
produce a call in some CU A where the callee resides in a different CU,
and there is no declaration subprogram for the callee anywhere. In this
case llvm would (unnecessarily, I think) emit an empty DW_TAG_subprogram
in order to fill in the call site tag. That empty 'definition' defeats
entry value evaluation etc., because the debugger can't figure out what
it means.

As a follow-up, maybe we could add a DWARF verifier check that a
DW_TAG_subprogram at least has a DW_AT_name attribute.

rdar://46577651

Differential Revision: https://reviews.llvm.org/D70350




More information about the All-commits mailing list