[llvm] [DLCov][NFC] Propagate annotated DebugLocs through transformations (PR #138047)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 03:55:21 PDT 2025


================
@@ -251,8 +259,12 @@ class IRBuilderBase {
   /// not on \p Src will be dropped from MetadataToCopy.
   void CollectMetadataToCopy(Instruction *Src,
                              ArrayRef<unsigned> MetadataKinds) {
-    for (unsigned K : MetadataKinds)
-      AddOrRemoveMetadataToCopy(K, Src->getMetadata(K));
+    for (unsigned K : MetadataKinds) {
+      if (K == LLVMContext::MD_dbg)
+        SetCurrentDebugLocation(Src->getDebugLoc());
----------------
OCHyams wrote:

Could this change behaviour in non-coverage builds if Src has no loc?

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


More information about the llvm-commits mailing list