[all-commits] [llvm/llvm-project] 7c7294: [llvm][DebugInfo] Attach object-pointer to DISubpr...

Michael Buch via All-commits all-commits at lists.llvm.org
Fri Jan 17 07:28:09 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c729418d721147bf1f2b257afd30f84721888ad
      https://github.com/llvm/llvm-project/commit/7c729418d721147bf1f2b257afd30f84721888ad
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2025-01-17 (Fri, 17 Jan 2025)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
    M llvm/test/DebugInfo/NVPTX/debug-info.ll
    M llvm/test/DebugInfo/X86/DW_AT_object_pointer.ll
    M llvm/test/DebugInfo/X86/dwarf-public-names.ll
    M llvm/test/tools/llvm-dwarfdump/X86/statistics.ll

  Log Message:
  -----------
  [llvm][DebugInfo] Attach object-pointer to DISubprogram declarations (#122742)

Currently Clang only attaches `DW_AT_object_pointer` to
`DW_TAG_subprogram` definitions. LLDB constructs C++ method types from
their `DW_TAG_subprogram` declaration, which is also the point at which
it needs to determine whether a method is static or not. LLDB's
heuristic for this could be very simple if we emitted
`DW_AT_object_pointer` on declarations. But since we don't, LLDB has to
guess whether an argument is an implicit object parameter based on the
DW_AT_name and DW_AT_type.

To simplify LLDB's job (and to eventually support C++23's explicit
object parameters), this patch adds the `DIFlagObjectPointer` to
`DISubprogram` declarations.

For reference, GCC attaches the object-pointer DIE to both the
definition and declaration: https://godbolt.org/z/3TWjTfWon

Fixes https://github.com/llvm/llvm-project/issues/120973



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