[llvm] [Transforms] Debug values are not remapped when cloning. (PR #87747)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 05:49:26 PDT 2024


================
@@ -3648,6 +3648,33 @@ DIExpression *llvm::getExpressionForConstant(DIBuilder &DIB, const Constant &C,
   return nullptr;
 }
 
+void llvm::remapDebugVariable(ValueToValueMapTy &Mapping, Instruction *Inst) {
+  auto RemapDebugOperands = [&Mapping](auto *DV, auto Set) {
+    for (auto *Op : Set)
+      if (Instruction *InstOp = dyn_cast<Instruction>(Op)) {
----------------
OCHyams wrote:

I don't think that we need the `dyn_cast` checks now that you're passing in a `ValueToValueMapTy` given that the key is a `Value *`. Could you remove them please?

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


More information about the llvm-commits mailing list