Skip to content

Commit

Permalink
[flang][openacc] Only issue a warning when acc routine func is not fo…
Browse files Browse the repository at this point in the history
…und (#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.
  • Loading branch information
clementval committed Nov 1, 2023
1 parent d871456 commit 32d9144
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flang/lib/Lower/OpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3295,9 +3295,12 @@ void Fortran::lower::finalizeOpenACCRoutineAttachment(
mlir::func::FuncOp funcOp =
mod.lookupSymbol<mlir::func::FuncOp>(mapping.first);
if (!funcOp)
llvm::report_fatal_error(
"could not find function to attach OpenACC routine information.");
attachRoutineInfo(funcOp, mapping.second);
mlir::emitWarning(mod.getLoc(),
llvm::Twine("function '") + llvm::Twine(mapping.first) +
llvm::Twine("' in acc routine directive is not "
"found in this translation unit."));
else
attachRoutineInfo(funcOp, mapping.second);
}
accRoutineInfos.clear();
}
Expand Down

0 comments on commit 32d9144

Please sign in to comment.