aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorZahira Ammarguellat <zahira.ammarguellat@intel.com>2025-01-29 07:51:02 -0500
committerGitHub <noreply@github.com>2025-01-29 07:51:02 -0500
commit978e0839ae2feb5ddda3e4e0b5a7ddba1727d2d8 (patch)
treec5b96d3034af26f98ee0949d12d29843d78cbdf5 /clang/lib
parent66e0498dafbfa7f8fd7deaa88ae62bdf38a12113 (diff)
downloadllvm-978e0839ae2feb5ddda3e4e0b5a7ddba1727d2d8.zip
llvm-978e0839ae2feb5ddda3e4e0b5a7ddba1727d2d8.tar.gz
llvm-978e0839ae2feb5ddda3e4e0b5a7ddba1727d2d8.tar.bz2
[OpenMP] Allow OMP6.0 features. (#122108)
Add support for the `-fopenmp-version=60` command line argument. It is needed for https://github.com/llvm/llvm-project/pull/119891 (`#pragma omp stripe`) which will be the first OpenMP 6.0 directive implemented. Add regression tests for Clang in `-fopenmp-version=60` mode.
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 2097a83..8411217 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4215,7 +4215,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
}
}
- // Check if -fopenmp is specified and set default version to 5.0.
+ // Check if -fopenmp is specified and set default version to 5.1.
Opts.OpenMP = Args.hasArg(OPT_fopenmp) ? 51 : 0;
// Check if -fopenmp-simd is specified.
bool IsSimdSpecified =
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 17f624e..542e26b6 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -1466,9 +1466,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
case 50:
Builder.defineMacro("_OPENMP", "201811");
break;
+ case 51:
+ Builder.defineMacro("_OPENMP", "202011");
+ break;
case 52:
Builder.defineMacro("_OPENMP", "202111");
break;
+ case 60:
+ Builder.defineMacro("_OPENMP", "202411");
+ break;
default: // case 51:
// Default version is OpenMP 5.1
Builder.defineMacro("_OPENMP", "202011");