[all-commits] [llvm/llvm-project] ef0dcb: [DWARF] Create subprogram's DIE in DISubprogram's ...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Wed Jan 27 04:42:57 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ef0dcb506300dc9644e8000c6028d14214be9d97
      https://github.com/llvm/llvm-project/commit/ef0dcb506300dc9644e8000c6028d14214be9d97
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-01-27 (Wed, 27 Jan 2021)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    A llvm/test/DebugInfo/X86/subprogram-across-cus.ll

  Log Message:
  -----------
  [DWARF] Create subprogram's DIE in DISubprogram's unit

This is a fix for PR48790. Over in D70350, subprogram DIEs were permitted
to be shared between CUs. However, the creation of a subprogram DIE can be
triggered early, from other CUs. The subprogram definition is then created
in one CU, and when the function is actually emitted children are attached
to the subprogram that expect to be in another CU. This breaks internal CU
references in the children.

Fix this by redirecting the creation of subprogram DIEs in
getOrCreateContextDIE to the CU specified by it's DISubprogram definition.
This ensures that the subprogram DIE is always created in the correct CU.

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




More information about the All-commits mailing list