Skip to content

Commit 39fb4c7

Browse files
[flang][driver] add warning when using openmp
1 parent 48d19d7 commit 39fb4c7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning<
147147
def warn_drv_unsupported_openmp_library : Warning<
148148
"the library '%0=%1' is not supported, OpenMP will not be enabled">,
149149
InGroup<OptionIgnored>;
150+
def warn_openmp_experimental : Warning<
151+
"OpenMP support in flang is still experimental">,
152+
InGroup<ExperimentalOption>;
150153

151154
def err_drv_invalid_thread_model_for_target : Error<
152155
"invalid thread model '%0' in '%1' for this target">;

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,3 +1583,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;
15831583
// Warnings about using the non-standard extension having an explicit specialization
15841584
// with a storage class specifier.
15851585
def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">;
1586+
1587+
// A warning for options that enable a feature that is not yet complete
1588+
def ExperimentalOption : DiagGroup<"experimental-option">;
1589+

clang/lib/Driver/ToolChains/Flang.cpp

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

788788
if (Args.hasArg(options::OPT_fopenmp_force_usm))
789789
CmdArgs.push_back("-fopenmp-force-usm");
790+
// TODO: OpenMP support isn't "done" yet, so for now we warn that it
791+
// is experimental.
792+
D.Diag(diag::warn_openmp_experimental);
790793

791794
// FIXME: Clang supports a whole bunch more flags here.
792795
break;

0 commit comments

Comments
 (0)