[Mlir-commits] [mlir] [MLIR][LLVM] Fix debug value/declare import in face of landing pads (PR #132871)

Tobias Gysi llvmlistbot at llvm.org
Tue Mar 25 00:00:42 PDT 2025


================
@@ -2512,7 +2512,22 @@ ModuleImport::processDebugIntrinsic(llvm::DbgVariableIntrinsic *dbgIntr,
     Block *dominatedBlock = (*dominatedBlocks.begin())->getBlock();
     builder.setInsertionPoint(dominatedBlock->getTerminator());
   } else {
-    builder.setInsertionPointAfterValue(*argOperand);
+    Value insertPt = *argOperand;
+    if (!op) {
----------------
gysit wrote:

```suggestion
    if (auto blockArg = dyn_cast<BlockArgument>(*argOperand)) {
```
nit: Would moving the cast here be correct as well? I think this may clarify the intend of the if a bit better?

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


More information about the Mlir-commits mailing list