[all-commits] [llvm/llvm-project] dec8f1: [llvm][DebugInfo][clang] Finalize all declaration ...

Vladislav Dzhidzhoev via All-commits all-commits at lists.llvm.org
Mon Jun 2 06:23:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dec8f1314fbf77a2b557f12275b1a5e7c7a70f32
      https://github.com/llvm/llvm-project/commit/dec8f1314fbf77a2b557f12275b1a5e7c7a70f32
  Author: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
  Date:   2025-06-02 (Mon, 02 Jun 2025)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M llvm/lib/IR/DIBuilder.cpp

  Log Message:
  -----------
  [llvm][DebugInfo][clang] Finalize all declaration subprograms in DIBuilder::finalize() (#139914)

DIBuilder began tracking definition subprograms and finalizing them in
`DIBuilder::finalize()` in eb1bb4e419.
Currently, `finalizeSubprogram()` attaches local variables, imported
entities, and labels to the `retainedNodes:` field of a corresponding
subprogram.

After 75819aedf, the definition and some declaration subprograms are
finalized in `DIBuilder::finalize()`:
`AllSubprograms` holds references to definition subprograms.
`AllRetainTypes` holds references to declaration subprograms.
For DISubprogram elements of both variables, `finalizeSubprogram()` was
called there.

However, `retainTypes()` is not necessarily called for every declaration
subprogram (as in 40a3fcb0).

DIBuilder clients may also want to attach DILocalVariables to
declaration subprograms, for example, in 58bdf8f9a8.

Thus, the `finalizeSubprogram()` function is called for all definition
subprograms in `DIBuilder::finalize()` because they are stored in the
`AllSubprograms` by the `CreateFunction(isDefinition: true)` call. But
for the declaration subprograms, it should be called manually.

With this commit, `AllSubprograms` is used for holding and finalizing all DISubprograms.



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