Skip to content

Commit fb063cc

Browse files
committed
Handle review comments.
Use the arguments to the TargetOp in the subroutine type created for it.
1 parent 73fbd7b commit fb063cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

flang/lib/Optimizer/Transforms/AddDebugInfo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,12 @@ void AddDebugInfoPass::handleFuncOp(mlir::func::FuncOp funcOp,
506506
mlir::DistinctAttr::create(mlir::UnitAttr::get(context));
507507
llvm::SmallVector<mlir::LLVM::DITypeAttr> types;
508508
types.push_back(mlir::LLVM::DINullTypeAttr::get(context));
509+
for (auto arg : targetOp.getRegion().getArguments()) {
510+
auto tyAttr = typeGen.convertType(fir::unwrapRefType(arg.getType()),
511+
fileAttr, cuAttr, /*declOp=*/nullptr);
512+
types.push_back(tyAttr);
513+
}
514+
CC = llvm::dwarf::getCallingConvention("DW_CC_normal");
509515
mlir::LLVM::DISubroutineTypeAttr spTy =
510516
mlir::LLVM::DISubroutineTypeAttr::get(context, CC, types);
511517
if (lineTableOnly) {

0 commit comments

Comments
 (0)