Skip to content

Commit 01461c6

Browse files
committed
[flang][debug] Allow variable from non-entry blocks.
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. I have opened #118314 to address the original issue. Once that PR is merged, we can lift this restriction as well.
1 parent 808b1c1 commit 01461c6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

flang/lib/Optimizer/Transforms/AddDebugInfo.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,7 @@ void AddDebugInfoPass::handleFuncOp(mlir::func::FuncOp funcOp,
503503
funcOp->setLoc(builder.getFusedLoc({l}, spAttr));
504504

505505
funcOp.walk([&](fir::cg::XDeclareOp declOp) {
506-
// FIXME: We currently dont handle variables that are not in the entry
507-
// blocks of the fuctions. These may be variable or arguments used in the
508-
// OpenMP target regions.
509-
if (&funcOp.front() == declOp->getBlock())
510-
handleDeclareOp(declOp, fileAttr, spAttr, typeGen, symbolTable);
506+
handleDeclareOp(declOp, fileAttr, spAttr, typeGen, symbolTable);
511507
});
512508
// commonBlockMap ensures that we don't create multiple DICommonBlockAttr of
513509
// the same name in one function. But it is ok (rather required) to create

0 commit comments

Comments
 (0)