[all-commits] [llvm/llvm-project] 9eda46: [DebugInfo] don't make an MDTuple just to leak it

Jameson Nash via All-commits all-commits at lists.llvm.org
Tue Apr 4 05:02:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9eda46b1817f60378143846477ef71f0131a121d
      https://github.com/llvm/llvm-project/commit/9eda46b1817f60378143846477ef71f0131a121d
  Author: Jameson Nash <vtjnash at gmail.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M llvm/include/llvm/IR/DIBuilder.h
    M llvm/lib/IR/DIBuilder.cpp

  Log Message:
  -----------
  [DebugInfo] don't make an MDTuple just to leak it

There does not seem to be any purpose to allocating this object, which
is Metadata, so LLVM will simply leak it until the context is destroyed
(the subprogram metadata it contains are distinct, so there is little
chance of it being reused later). This should not have a functional
change.

This seems to be left over from an earlier design, when it used to call
```
CUNode->replaceSubprograms(SPs.get());
```
here also. (removed in http://reviews.llvm.org/D19034)

Reviewed By: aprantl

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




More information about the All-commits mailing list