Skip to content

Commit cc1eae6

Browse files
authored
1 parent 6a5469b commit cc1eae6

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def warn_drv_unsupported_option_for_processor : Warning<
143143
def warn_drv_unsupported_openmp_library : Warning<
144144
"the library '%0=%1' is not supported, OpenMP will not be enabled">,
145145
InGroup<OptionIgnored>;
146-
def warn_openmp_experimental : Warning<
147-
"OpenMP support in flang is still experimental">,
146+
def warn_openmp_incomplete : Warning<
147+
"OpenMP support for version %0 in flang is still incomplete">,
148148
InGroup<ExperimentalOption>;
149149

150150
def err_drv_invalid_thread_model_for_target : Error<

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,6 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
906906

907907
if (Args.hasArg(options::OPT_fopenmp_force_usm))
908908
CmdArgs.push_back("-fopenmp-force-usm");
909-
// TODO: OpenMP support isn't "done" yet, so for now we warn that it
910-
// is experimental.
911-
D.Diag(diag::warn_openmp_experimental);
912909

913910
// FIXME: Clang supports a whole bunch more flags here.
914911
break;

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,9 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
11381138
unsigned numErrorsBefore = diags.getNumErrors();
11391139
llvm::Triple t(res.getTargetOpts().triple);
11401140

1141-
// By default OpenMP is set to 3.1 version
1142-
res.getLangOpts().OpenMPVersion = 31;
1141+
constexpr unsigned newestFullySupported = 31;
1142+
// By default OpenMP is set to the most recent fully supported version
1143+
res.getLangOpts().OpenMPVersion = newestFullySupported;
11431144
res.getFrontendOpts().features.Enable(
11441145
Fortran::common::LanguageFeature::OpenMP);
11451146
if (auto *arg =
@@ -1164,6 +1165,9 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
11641165
if (!value.getAsInteger(/*radix=*/10, version)) {
11651166
if (llvm::is_contained(ompVersions, version)) {
11661167
res.getLangOpts().OpenMPVersion = version;
1168+
1169+
if (version > newestFullySupported)
1170+
diags.Report(clang::diag::warn_openmp_incomplete) << version;
11671171
} else if (llvm::is_contained(oldVersions, version)) {
11681172
const unsigned diagID =
11691173
diags.getCustomDiagID(clang::DiagnosticsEngine::Warning,

flang/test/Driver/fopenmp.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@
7474
! CHECK-LD-ANYMD: "{{.*}}ld{{(.exe)?}}"
7575
! CHECK-LD-ANYMD: "-l{{(omp|gomp|iomp5md)}}"
7676
!
77-
! RUN: %flang -fopenmp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-EXPERIMENTAL
77+
! RUN: %flang -fopenmp -fopenmp-version=40 -c %s -S -o - 2>&1 | FileCheck %s --check-prefix=CHECK-INCOMPLETE
7878
!
79-
! CHECK-EXPERIMENTAL: flang{{.*}}: warning: OpenMP support in flang is still experimental
79+
! CHECK-INCOMPLETE: warning: OpenMP support for version 40 in flang is still incomplete

0 commit comments

Comments
 (0)