Skip to content

Commit 3450d4b

Browse files
committed
Don't generate debug info for variable in target region.
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.
1 parent ac47098 commit 3450d4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flang/lib/Optimizer/Transforms/AddDebugInfo.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ void AddDebugInfoPass::handleDeclareOp(fir::cg::XDeclareOp declOp,
103103
if (fir::isDummyArgument(declOp.getMemref())) {
104104
auto arg = llvm::cast<mlir::BlockArgument>(declOp.getMemref());
105105
argNo = arg.getArgNumber() + 1;
106-
}
106+
} else if (llvm::isa<mlir::BlockArgument>(declOp.getMemref()))
107+
// FIXME: Handle arguments which are not dummy. These may be arguments
108+
// to things like OpenMP regions. They may need some extra processing
109+
// (e.g. to set the scope correctly).
110+
return;
107111

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

0 commit comments

Comments
 (0)