[flang-commits] [flang] [flang][debug] Improve handling of dummy character arguments. (PR #108283)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Tue Sep 17 07:13:23 PDT 2024


abidh wrote:

> I feel this situation will happen a lot and it would be more generic to add a small fircg.dbg.declare operation that accept any type and that you can generate in DebugTypeGenerator regardless of what is the defining operation (if there is even one).
> 
> You could even probably just use llvm.intr.dbg.value already here since FIR uses the same integer types as LLVM, except for the index type. (the llvm.intr.dbg.value accepts any LLVM_Type, which are types that are defined by [this helper](https://github.com/llvm/llvm-project/blob/f25b09199ab8026bf50364cfc8d49a860fb9a760/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp#L763) and include signeless MLIR integer type and the MLIR floating point types generated by flang).
> 
> It would be fine to deal with the index case by generating a convert to i64 I think.

Thanks for the review. The suggestion to use `llvm.intr.dbg.value` directly here is very useful It will make handling such cases much easier. I have updated the PR accordingly.

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


More information about the flang-commits mailing list