[llvm] [RemoveDIs] Update Coroutine passes to handle DPValues (PR #74480)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 02:52:48 PST 2023


================
@@ -1259,9 +1276,17 @@ static void buildFrameDebugInfo(Function &F, coro::Shape &Shape,
         7, (MDTuple::get(F.getContext(), RetainedNodesVec)));
   }
 
-  DBuilder.insertDeclare(Shape.FramePtr, FrameDIVar,
-                         DBuilder.createExpression(), DILoc,
-                         Shape.getInsertPtAfterFramePtr());
+  if (UseNewDbgInfoFormat) {
+    DPValue *NewDPV = new DPValue(ValueAsMetadata::get(Shape.FramePtr),
----------------
OCHyams wrote:

The `BasicBlock` owns it indirectly.  It's tied to the lifetime of the block, while not actually being part of the Value hierarchy. The `DPMarker` owns the `DPValue` memory, and `BasicBlock` owns the `DPMarker`s. Just like instructions, `eraseFromParent` can be called to delete these.

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


More information about the llvm-commits mailing list