[llvm] bdbc2db - [RemoveDIs] Enable conversion from dbg.declare to DPValue (#74090)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 03:20:57 PST 2023


Author: Orlando Cazalet-Hyams
Date: 2023-12-13T11:20:53Z
New Revision: bdbc2db5360e043c7e32cabeaa230cf91f5e51e2

URL: https://github.com/llvm/llvm-project/commit/bdbc2db5360e043c7e32cabeaa230cf91f5e51e2
DIFF: https://github.com/llvm/llvm-project/commit/bdbc2db5360e043c7e32cabeaa230cf91f5e51e2.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/IR/BasicBlock.cpp

Removed: 
    


################################################################################
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<DPValue *, 4> DPVals;
   for (Instruction &I : make_early_inc_range(InstList)) {
     assert(!I.DbgMarker && "DbgMarker already set on old-format instrs?");
-    if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(&I)) {
+    if (DbgVariableIntrinsic *DVI = dyn_cast<DbgVariableIntrinsic>(&I)) {
+      if (isa<DbgAssignIntrinsic>(DVI))
+        continue;
+
       // Convert this dbg.value to a DPValue.
       DPValue *Value = new DPValue(DVI);
       DPVals.push_back(Value);


        


More information about the llvm-commits mailing list