[flang-commits] [flang] 32d9144 - [flang][openacc] Only issue a warning when acc routine func is not found (#70964)
via flang-commits
flang-commits at lists.llvm.org
Wed Nov 1 13:00:03 PDT 2023
Author: Valentin Clement (バレンタイン クレメン)
Date: 2023-11-01T12:59:59-07:00
New Revision: 32d91449ef98c267715b346871912a34899a8e64
URL: https://github.com/llvm/llvm-project/commit/32d91449ef98c267715b346871912a34899a8e64
DIFF: https://github.com/llvm/llvm-project/commit/32d91449ef98c267715b346871912a34899a8e64.diff
LOG: [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.
Added:
Modified:
flang/lib/Lower/OpenACC.cpp
Removed:
################################################################################
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 738af5d60a8353f..809fd3b3be7cfdf 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -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();
}
More information about the flang-commits
mailing list