This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] don't make an MDTuple just to leak it
ClosedPublic

Authored by vtjnash on Apr 3 2023, 1:42 PM.

Details

Summary

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)

Diff Detail

Event Timeline

vtjnash created this revision.Apr 3 2023, 1:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 1:42 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
vtjnash requested review of this revision.Apr 3 2023, 1:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 1:42 PM
vtjnash edited the summary of this revision. (Show Details)Apr 3 2023, 1:51 PM
vtjnash added a reviewer: aprantl.
aprantl accepted this revision.Apr 3 2023, 4:25 PM

Nice find.

This revision is now accepted and ready to land.Apr 3 2023, 4:25 PM
This revision was landed with ongoing or failed builds.Apr 4 2023, 5:02 AM
This revision was automatically updated to reflect the committed changes.