[flang-commits] [flang] [flang][debug] Place prologue_end on the first executable statement (PR #232025)
via flang-commits
flang-commits at lists.llvm.org
Thu Oct 15 05:31:32 PDT 2026
================
@@ -443,6 +443,11 @@ class DeclareOpConversion : public mlir::OpRewritePattern<hlfir::DeclareOp> {
firDeclareOp->setDiscardableAttrs(
declareOp->getDiscardableAttrDictionary());
+ // Give line 0 to code that materializes the HLFIR base.
+ if (auto fileLoc = loc->findInstanceOf<mlir::FileLineColLoc>())
+ loc = mlir::FileLineColLoc::get(fileLoc.getFilename(), /*line=*/0,
+ /*column=*/0);
----------------
jeanPerier wrote:
I am not sure it is OK to do this in general as we generate declare in the middle of the executable code too for temporaries.
https://github.com/llvm/llvm-project/pull/232025
More information about the flang-commits
mailing list