[all-commits] [llvm/llvm-project] ddc2f1: [DWARF] Location-less inlined variables should not...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Wed Feb 3 09:34:03 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ddc2f1e3fb4f8f9ae7dd130e40b60cfc775eba24
      https://github.com/llvm/llvm-project/commit/ddc2f1e3fb4f8f9ae7dd130e40b60cfc775eba24
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-02-03 (Wed, 03 Feb 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
    M llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    A llvm/test/DebugInfo/Generic/no-empty-child-vars.ll
    M llvm/test/DebugInfo/NVPTX/debug-addr-class.ll
    M llvm/test/DebugInfo/NVPTX/debug-info.ll
    M llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll

  Log Message:
  -----------
  [DWARF] Location-less inlined variables should not have DW_TAG_variable

Discussed in this thread:

  https://lists.llvm.org/pipermail/llvm-dev/2021-January/148139.html

DwarfDebug::collectEntityInfo accidentally distinguishes between variable
locations that never have a location specified, and variable locations that
have an empty location specified. The latter leads to the creation of an
empty variable referring to the abstract origin.

Fix this by seeking a non-empty location before producing a concrete
entity, to guarantee a DW_AT_location will be produced. Other loops in
collectEntityInfo and endFunctionImpl take care of examining the
retainedNodes collection and ensuring optimised-out variables are created.

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




More information about the All-commits mailing list