From ababa964752d5bfa6eb608c97f19d4e68df1d243 Mon Sep 17 00:00:00 2001 From: Orlando Cazalet-Hyams Date: Tue, 20 Feb 2024 16:00:55 +0000 Subject: [RemoveDIs][NFC] Introduce DbgRecord base class [1/3] (#78252) Patch 1 of 3 to add llvm.dbg.label support to the RemoveDIs project. The patch stack adds a new base class -> 1. Add DbgRecord base class for DPValue and the not-yet-added DPLabel class. 2. Add the DPLabel class. 3. Enable dbg.label conversion and add support to passes. Patches 1 and 2 are NFC. In the near future we also will rename DPValue to DbgVariableRecord and DPLabel to DbgLabelRecord, at which point we'll overhaul the function names too. The name DPLabel keeps things consistent for now. --- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index f875652..5651498 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1188,10 +1188,12 @@ void FastISel::handleDbgInfo(const Instruction *II) { MIMD = MIMetadata(); // Reverse order of debug records, because fast-isel walks through backwards. - for (DPValue &DPV : llvm::reverse(II->getDbgValueRange())) { + for (DbgRecord &DPR : llvm::reverse(II->getDbgValueRange())) { flushLocalValueMap(); recomputeInsertPt(); + DPValue &DPV = cast(DPR); + Value *V = nullptr; if (!DPV.hasArgList()) V = DPV.getVariableLocationOp(0); -- cgit v1.1