|
11 | 11 |
|
12 | 12 | #include "clang/Basic/CodeGenOptions.h" |
13 | 13 | #include "clang/Driver/CommonArgs.h" |
| 14 | +#include "clang/Driver/OptionUtils.h" |
14 | 15 | #include "clang/Driver/Options.h" |
15 | 16 | #include "llvm/Frontend/Debug/Options.h" |
16 | 17 | #include "llvm/Support/Path.h" |
@@ -772,6 +773,13 @@ static void renderRemarksOptions(const ArgList &Args, ArgStringList &CmdArgs, |
772 | 773 | } |
773 | 774 | } |
774 | 775 |
|
| 776 | +static std::string OpenMPVersionToString(int Version) { |
| 777 | + int Major = Version / 10; |
| 778 | + int Minor = Version % 10; |
| 779 | + |
| 780 | + return llvm::Twine{Major}.concat(".").concat(llvm::Twine{Minor}).str(); |
| 781 | +} |
| 782 | + |
775 | 783 | void Flang::ConstructJob(Compilation &C, const JobAction &JA, |
776 | 784 | const InputInfo &Output, const InputInfoList &Inputs, |
777 | 785 | const ArgList &Args, const char *LinkingOutput) const { |
@@ -906,9 +914,14 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, |
906 | 914 |
|
907 | 915 | if (Args.hasArg(options::OPT_fopenmp_force_usm)) |
908 | 916 | 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); |
| 917 | + |
| 918 | + // TODO: OpenMP support for newer versions of the standard is incomplete. |
| 919 | + if (int Version = |
| 920 | + getLastArgIntValue(Args, options::OPT_fopenmp_version_EQ, 0)) { |
| 921 | + if (Version >= 40) |
| 922 | + D.Diag(diag::warn_openmp_incomplete) |
| 923 | + << OpenMPVersionToString(Version); |
| 924 | + } |
912 | 925 |
|
913 | 926 | // FIXME: Clang supports a whole bunch more flags here. |
914 | 927 | break; |
|
0 commit comments