[PATCH] D118453: [DebugInfo][InstrRef][NFC] Free resources at an earlier stage, to avoid double accounting
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 28 10:35:06 PST 2022
dblaikie added inline comments.
================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:2813-2814
+ // values. If we don't, we needlessy record the same info in memory twice.
+ delete[] MInLocs[bbnum];
+ delete[] MOutLocs[bbnum];
+ SavedLiveIns[bbnum].clear();
----------------
Orlando wrote:
> Is it worth setting to `nullptr` too, like you've done elsewhere?
Any chance `MInLocs`/`MOutLocs` to a better memory management scheme? Looks like at least `std::unique_ptr<std::unique_ptr<ValueIDNum[]>[]>` would model the ownership here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118453/new/
https://reviews.llvm.org/D118453
More information about the llvm-commits
mailing list