[flang-commits] [flang] [flang][debug] Keep the bounds of variables in stack slots at -O0. (PR #229876)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Tue Oct 13 02:57:45 PDT 2026


================
@@ -91,12 +94,40 @@ static mlir::LLVM::DITypeAttr genPlaceholderType(mlir::MLIRContext *context) {
                       /*bitSize=*/32, llvm::dwarf::DW_ATE_signed);
 }
 
+/// Return a stack slot holding \p val wherever the variable declared by
+/// \p declOp is visible.
+static fir::AllocaOp createBoundSlot(mlir::Value val,
+                                     fir::cg::XDeclareOp declOp) {
+  // Generate the slot and store with UnknownLoc so tha they dont impact the
----------------
abidh wrote:

Thanks for catching this. Fixed.

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


More information about the flang-commits mailing list