Skip to content

Commit 8b09d38

Browse files
committed
Handle review comments.
Use the arguments to the TargetOp in the subroutine type created for it.
1 parent b4d7e29 commit 8b09d38

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
@@ -507,6 +507,12 @@ void AddDebugInfoPass::handleFuncOp(mlir::func::FuncOp funcOp,
507507
mlir::DistinctAttr::create(mlir::UnitAttr::get(context));
508508
llvm::SmallVector<mlir::LLVM::DITypeAttr> types;
509509
types.push_back(mlir::LLVM::DINullTypeAttr::get(context));
510+
for (auto arg : targetOp.getRegion().getArguments()) {
511+
auto tyAttr = typeGen.convertType(fir::unwrapRefType(arg.getType()),
512+
fileAttr, cuAttr, /*declOp=*/nullptr);
513+
types.push_back(tyAttr);
514+
}
515+
CC = llvm::dwarf::getCallingConvention("DW_CC_normal");
510516
mlir::LLVM::DISubroutineTypeAttr spTy =
511517
mlir::LLVM::DISubroutineTypeAttr::get(context, CC, types);
512518
if (lineTableOnly) {

0 commit comments

Comments
 (0)