[llvm] [RemoveDIs][NFC] Introduce DbgRecord base class [1/3] (PR #78252)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 06:04:59 PST 2024


================
@@ -108,9 +108,13 @@ void BasicBlock::convertFromNewDbgValues() {
       continue;
 
     DPMarker &Marker = *Inst.DbgMarker;
-    for (DPValue &DPV : Marker.getDbgValueRange())
-      InstList.insert(Inst.getIterator(),
-                      DPV.createDebugIntrinsic(getModule(), nullptr));
+    for (DbgRecord &DPR : Marker.getDbgValueRange()) {
+      if (auto *DPV = dyn_cast<DPValue>(&DPR))
+        InstList.insert(Inst.getIterator(),
+                        DPV->createDebugIntrinsic(getModule(), nullptr));
+      else
+        llvm_unreachable("unsupported entity kind");
----------------
jmorse wrote:

IMO this wants some kind of indication that we're dealing with DbgRecords / DPValues in the error message, if/when this pops up for developers, they're going to immediately want to know "it's debug-info at fault", which might not be obvious otherwise.

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


More information about the llvm-commits mailing list