[llvm] [DebugInfo][RemoveDIs] Handle DPValues at remaining dbg.value using sites (PR #73788)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 01:18:41 PST 2023


================
@@ -534,6 +539,17 @@ static bool rewriteSingleStoreAlloca(
     }
   }
 
+  // Duplicate implementation for non-instr storage of debug-info in
+  // DPValue objects.
+  for (DPValue *DPV : Info.DPUsers) {
+    if (DPV->isAddressOfVariable()) {
+      ConvertDebugDeclareToDebugValue(DPV, Info.OnlyStore, DIB);
+      DPV->eraseFromParent();
+    } else if (DPV->getExpression()->startsWithDeref()) {
+      DPV->eraseFromParent();
+    }
+  }
----------------
OCHyams wrote:

Should these changes use the "loop body -> generic lambda" idiom? IMO the more places we can do that the better, since it's harder to accidentally introduce divergent behaviour. (I can also see the case for "these loops are small and simple"). WDYT?

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


More information about the llvm-commits mailing list