From bdbc2db5360e043c7e32cabeaa230cf91f5e51e2 Mon Sep 17 00:00:00 2001 From: Orlando Cazalet-Hyams Date: Wed, 13 Dec 2023 11:20:53 +0000 Subject: [PATCH] [RemoveDIs] Enable conversion from dbg.declare to DPValue (#74090) Note that all the patches that implement support for declare-style DPValues have tests that are "rotten green" test without this patch (i.e., they pass at the moment without testing what we want them to test). See the Pull Request for more detail on this. --- llvm/lib/IR/BasicBlock.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index f364c56a42c528..8e776744f22d7f 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -73,7 +73,10 @@ void BasicBlock::convertToNewDbgValues() { SmallVector DPVals; for (Instruction &I : make_early_inc_range(InstList)) { assert(!I.DbgMarker && "DbgMarker already set on old-format instrs?"); - if (DbgValueInst *DVI = dyn_cast(&I)) { + if (DbgVariableIntrinsic *DVI = dyn_cast(&I)) { + if (isa(DVI)) + continue; + // Convert this dbg.value to a DPValue. DPValue *Value = new DPValue(DVI); DPVals.push_back(Value);