aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorJameson Nash <vtjnash@gmail.com>2023-04-04 07:42:25 -0400
committerJameson Nash <vtjnash@gmail.com>2023-04-04 08:01:47 -0400
commit9eda46b1817f60378143846477ef71f0131a121d (patch)
tree86ec589d3da17fde502d1a2eac9357a95d0aed52 /llvm/lib/IR/DIBuilder.cpp
parentb2f5ab6a41e32bfd8151225b6032ca869f4e142f (diff)
downloadllvm-9eda46b1817f60378143846477ef71f0131a121d.zip
llvm-9eda46b1817f60378143846477ef71f0131a121d.tar.gz
llvm-9eda46b1817f60378143846477ef71f0131a121d.tar.bz2
[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
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index eacfa47..b958443 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -96,8 +96,7 @@ void DIBuilder::finalize() {
if (!RetainValues.empty())
CUNode->replaceRetainedTypes(MDTuple::get(VMContext, RetainValues));
- DISubprogramArray SPs = MDTuple::get(VMContext, AllSubprograms);
- for (auto *SP : SPs)
+ for (auto *SP : AllSubprograms)
finalizeSubprogram(SP);
for (auto *N : RetainValues)
if (auto *SP = dyn_cast<DISubprogram>(N))