[flang][OpenMP] Remove experimental warning (#144915)

RFC:
https://discourse.llvm.org/t/rfc-removing-the-openmp-experimental-warning-for-llvm-21/86455

Fixes: #110008
This commit is contained in:
Tom Eccles
2025-06-26 14:09:21 +01:00
committed by GitHub
parent 6a5469bb81
commit cc1eae6ea2
4 changed files with 10 additions and 9 deletions

View File

@@ -1138,8 +1138,9 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
unsigned numErrorsBefore = diags.getNumErrors();
llvm::Triple t(res.getTargetOpts().triple);
// By default OpenMP is set to 3.1 version
res.getLangOpts().OpenMPVersion = 31;
constexpr unsigned newestFullySupported = 31;
// By default OpenMP is set to the most recent fully supported version
res.getLangOpts().OpenMPVersion = newestFullySupported;
res.getFrontendOpts().features.Enable(
Fortran::common::LanguageFeature::OpenMP);
if (auto *arg =
@@ -1164,6 +1165,9 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
if (!value.getAsInteger(/*radix=*/10, version)) {
if (llvm::is_contained(ompVersions, version)) {
res.getLangOpts().OpenMPVersion = version;
if (version > newestFullySupported)
diags.Report(clang::diag::warn_openmp_incomplete) << version;
} else if (llvm::is_contained(oldVersions, version)) {
const unsigned diagID =
diags.getCustomDiagID(clang::DiagnosticsEngine::Warning,