Skip to content

Commit 8ee2cb0

Browse files
abidhjoaosaffran
authored andcommitted
[flang][debug] Allow variable from non-entry blocks. (llvm#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 llvm#118314 so we can lift this restriction as well.
1 parent 6243c0b commit 8ee2cb0

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)