diff options
author | Krzysztof Parzyszek <Krzysztof.Parzyszek@amd.com> | 2025-08-18 09:13:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-18 09:13:27 -0500 |
commit | ae75884130ceb31c6a0f8520e906ebbfd6636124 (patch) | |
tree | 899370eb329e87bd52929db83c2a4e013716f044 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 2497864e0973ba8c8fd16c8cbef7869e622256fa (diff) | |
download | llvm-ae75884130ceb31c6a0f8520e906ebbfd6636124.zip llvm-ae75884130ceb31c6a0f8520e906ebbfd6636124.tar.gz llvm-ae75884130ceb31c6a0f8520e906ebbfd6636124.tar.bz2 |
[Frontend][OpenMP] Add 6.1 as a valid OpenMP version (#153628)
Co-authored-by: Michael Klemm <michael.klemm@amd.com>
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 265ba8e..4719a24 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1187,6 +1187,7 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args, llvm::Triple t(res.getTargetOpts().triple); constexpr unsigned newestFullySupported = 31; + constexpr unsigned latestFinalized = 60; // By default OpenMP is set to the most recent fully supported version res.getLangOpts().OpenMPVersion = newestFullySupported; res.getFrontendOpts().features.Enable( @@ -1209,12 +1210,26 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args, diags.Report(diagID) << value << arg->getAsString(args) << versions.str(); }; + auto reportFutureVersion = [&](llvm::StringRef value) { + const unsigned diagID = diags.getCustomDiagID( + clang::DiagnosticsEngine::Warning, + "The specification for OpenMP version %0 is still under development; " + "the syntax and semantics of new features may be subject to change"); + std::string buffer; + llvm::raw_string_ostream versions(buffer); + llvm::interleaveComma(ompVersions, versions); + + diags.Report(diagID) << value; + }; + llvm::StringRef value = arg->getValue(); if (!value.getAsInteger(/*radix=*/10, version)) { if (llvm::is_contained(ompVersions, version)) { res.getLangOpts().OpenMPVersion = version; - if (version > newestFullySupported) + if (version > latestFinalized) + reportFutureVersion(value); + else if (version > newestFullySupported) diags.Report(clang::diag::warn_openmp_incomplete) << version; } else if (llvm::is_contained(oldVersions, version)) { const unsigned diagID = |