Skip to content

Commit 32d9144

Browse files
authored
[flang][openacc] Only issue a warning when acc routine func is not found (#70964)
Do not issue a hard error when the function in acc routine directive is not present in the current translation unit. Only issue a warning.
1 parent d871456 commit 32d9144

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

flang/lib/Lower/OpenACC.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,9 +3295,12 @@ void Fortran::lower::finalizeOpenACCRoutineAttachment(
32953295
mlir::func::FuncOp funcOp =
32963296
mod.lookupSymbol<mlir::func::FuncOp>(mapping.first);
32973297
if (!funcOp)
3298-
llvm::report_fatal_error(
3299-
"could not find function to attach OpenACC routine information.");
3300-
attachRoutineInfo(funcOp, mapping.second);
3298+
mlir::emitWarning(mod.getLoc(),
3299+
llvm::Twine("function '") + llvm::Twine(mapping.first) +
3300+
llvm::Twine("' in acc routine directive is not "
3301+
"found in this translation unit."));
3302+
else
3303+
attachRoutineInfo(funcOp, mapping.second);
33013304
}
33023305
accRoutineInfos.clear();
33033306
}

0 commit comments

Comments
 (0)