[llvm] [DebugInfo][RemoveDIs] Convert debug-info modes when loading bitcode (PR #78967)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 02:25:35 PST 2024


================
@@ -1048,9 +1048,16 @@ void Mapper::remapFunction(Function &F) {
       A.mutateType(TypeMapper->remapType(A.getType()));
 
   // Remap the instructions.
-  for (BasicBlock &BB : F)
-    for (Instruction &I : BB)
+  for (BasicBlock &BB : F) {
+    for (Instruction &I : BB) {
       remapInstruction(&I);
+      if (I.DbgMarker) {
+        for (DPValue &DPV : I.DbgMarker->getDbgValueRange()) {
+          remapDPValue(DPV);
+        }
+      }
----------------
SLTozer wrote:

```suggestion
      for (DPValue &DPV : I.getDbgValueRange())
        remapDPValue(DPV);
```

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


More information about the llvm-commits mailing list