aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorerichkeane <ekeane@nvidia.com>2025-07-17 07:43:14 -0700
committererichkeane <ekeane@nvidia.com>2025-07-17 09:12:36 -0700
commit011d38bdac95647a872a5faa339465e26535df35 (patch)
treed1672bf079660343769083ca93e3773422852e73 /clang/lib/Frontend
parentd97c224e8cbba9158ebda6f12f9a06b09534ae29 (diff)
downloadllvm-011d38bdac95647a872a5faa339465e26535df35.zip
llvm-011d38bdac95647a872a5faa339465e26535df35.tar.gz
llvm-011d38bdac95647a872a5faa339465e26535df35.tar.bz2
[OpenACC] Update OpenACC macro, remove override macro
As we are now Sema-complete for OpenACC 3.4 (and thus have a conforming implementation, in all modes), we can now set the _OPENACC macro correctly. Additionally, we remove the temporary 'override' functionality, which was intended to allow people to experiment with this. We aren't having a deprecation period as OpenACC support is still considered experimental.
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp12
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp12
2 files changed, 4 insertions, 20 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 6ab36d86..3a36250 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3913,12 +3913,8 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts,
if (Opts.OpenMPCUDAMode)
GenerateArg(Consumer, OPT_fopenmp_cuda_mode);
- if (Opts.OpenACC) {
+ if (Opts.OpenACC)
GenerateArg(Consumer, OPT_fopenacc);
- if (!Opts.OpenACCMacroOverride.empty())
- GenerateArg(Consumer, OPT_openacc_macro_override,
- Opts.OpenACCMacroOverride);
- }
// The arguments used to set Optimize, OptimizeSize and NoInlineDefine are
// generated from CodeGenOptions.
@@ -4424,13 +4420,9 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
Args.hasArg(options::OPT_fopenmp_cuda_mode);
// OpenACC Configuration.
- if (Args.hasArg(options::OPT_fopenacc)) {
+ if (Args.hasArg(options::OPT_fopenacc))
Opts.OpenACC = true;
- if (Arg *A = Args.getLastArg(options::OPT_openacc_macro_override))
- Opts.OpenACCMacroOverride = A->getValue();
- }
-
if (Arg *A = Args.getLastArg(OPT_ffp_contract)) {
StringRef Val = A->getValue();
if (Val == "fast")
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 38b2e0c..382ccd6 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -639,16 +639,8 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
}
}
- if (LangOpts.OpenACC) {
- // FIXME: When we have full support for OpenACC, we should set this to the
- // version we support. Until then, set as '1' by default, but provide a
- // temporary mechanism for users to override this so real-world examples can
- // be tested against.
- if (!LangOpts.OpenACCMacroOverride.empty())
- Builder.defineMacro("_OPENACC", LangOpts.OpenACCMacroOverride);
- else
- Builder.defineMacro("_OPENACC", "1");
- }
+ if (LangOpts.OpenACC)
+ Builder.defineMacro("_OPENACC", "202506");
}
/// Initialize the predefined C++ language feature test macros defined in