[llvm] [RemoveDIs][NFC] Add DPLabel class [2/3] (PR #82376)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 07:08:00 PST 2024


================
@@ -4581,7 +4581,7 @@ void AssemblyWriter::printDbgRecord(const DbgRecord &DR) {
   if (auto *DPV = dyn_cast<DPValue>(&DR))
     printDPValue(*DPV);
   else
-    llvm_unreachable("unsupported dbg record");
+    printDPLabel(cast<DPLabel>(DR));
----------------
OCHyams wrote:

I said I'd done the unreachable approach elsewhere, but I've actually done a mix (in future patches) of whatever looks right at the site. I'll go with unreachable here as there's not much in it, but I might push back against this pattern in the next patches - in some cases it's much cleaner to just cast (imo), but we can discuss that in those patches!

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


More information about the llvm-commits mailing list