Skip to content

Commit

Permalink
Don't generate debug info for variable in target region.
Browse files Browse the repository at this point in the history
These variables currently fail the llvm verifier tests as the scope
inside the variable is still point to the parent function of the
target region.
  • Loading branch information
abidh committed Jul 9, 2024
1 parent ac47098 commit 3450d4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ void AddDebugInfoPass::handleDeclareOp(fir::cg::XDeclareOp declOp,
if (fir::isDummyArgument(declOp.getMemref())) {
auto arg = llvm::cast<mlir::BlockArgument>(declOp.getMemref());
argNo = arg.getArgNumber() + 1;
}
} else if (llvm::isa<mlir::BlockArgument>(declOp.getMemref()))
// FIXME: Handle arguments which are not dummy. These may be arguments
// to things like OpenMP regions. They may need some extra processing
// (e.g. to set the scope correctly).
return;

auto tyAttr = typeGen.convertType(fir::unwrapRefType(declOp.getType()),
fileAttr, scopeAttr, declOp.getLoc());
Expand Down

0 comments on commit 3450d4b

Please sign in to comment.