[flang-commits] [flang] bfd3e25 - [flang][debug] Allow variable from non-entry blocks. (#125692)
via flang-commits
flang-commits at lists.llvm.org
Thu Feb 13 03:20:48 PST 2025
Author: Abid Qadeer
Date: 2025-02-13T11:20:45Z
New Revision: bfd3e25fddddde2e541dad4616350ce72cd9eeed
URL: https://github.com/llvm/llvm-project/commit/bfd3e25fddddde2e541dad4616350ce72cd9eeed
DIFF: https://github.com/llvm/llvm-project/commit/bfd3e25fddddde2e541dad4616350ce72cd9eeed.diff
LOG: [flang][debug] Allow variable from non-entry blocks. (#125692)
We currently drop the `DeclareOp` which are not in the entry block of
the function. This was done to side step a problem with the variables in
OpenMP target region. Now that issue has been addressed in #118314 so we
can lift this restriction as well.
Added:
Modified:
flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp b/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
index 49c9a737b2c59..81d09e023db24 100644
--- a/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+++ b/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
@@ -503,11 +503,7 @@ void AddDebugInfoPass::handleFuncOp(mlir::func::FuncOp funcOp,
funcOp->setLoc(builder.getFusedLoc({l}, spAttr));
funcOp.walk([&](fir::cg::XDeclareOp declOp) {
- // FIXME: We currently dont handle variables that are not in the entry
- // blocks of the fuctions. These may be variable or arguments used in the
- // OpenMP target regions.
- if (&funcOp.front() == declOp->getBlock())
- handleDeclareOp(declOp, fileAttr, spAttr, typeGen, symbolTable);
+ handleDeclareOp(declOp, fileAttr, spAttr, typeGen, symbolTable);
});
// commonBlockMap ensures that we don't create multiple DICommonBlockAttr of
// the same name in one function. But it is ok (rather required) to create
More information about the flang-commits
mailing list