[llvm] [DebugInfo][RemoveDIs] Avoid leaking trailing DPMarkers (PR #74458)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 06:11:05 PST 2023


================
@@ -1030,6 +1037,7 @@ void BasicBlock::spliceDebugInfoImpl(BasicBlock::iterator Dest, BasicBlock *Src,
     DPMarker *TrailingDPValues = getTrailingDPValues();
     if (TrailingDPValues) {
       FirstMarker->absorbDebugValues(*TrailingDPValues, true);
+      TrailingDPValues->eraseFromParent();
----------------
OCHyams wrote:

Should `absorbDebugValues` call `eraseFromParent`? Rather than calling it all the `absorbDebugValues` call sites. AFAICT absorb always absorbs all the DPValues, so it would probably be a rare case that we want to keep the absorbed-from marker around?

https://github.com/llvm/llvm-project/pull/74458


More information about the llvm-commits mailing list