Skip to content

Commit 2619e5f

Browse files
author
git apple-llvm automerger
committed
Merge commit '011d38bdac95' from llvm.org/main into next
2 parents 1f245b3 + 011d38b commit 2619e5f

File tree

7 files changed

+6
-65
lines changed

7 files changed

+6
-65
lines changed

clang/include/clang/Basic/LangOptions.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,6 @@ class LangOptions : public LangOptionsBase {
668668
// received as a result of a standard operator new (-fcheck-new)
669669
bool CheckNew = false;
670670

671-
// In OpenACC mode, contains a user provided override for the _OPENACC macro.
672-
// This exists so that we can override the macro value and test our incomplete
673-
// implementation on real-world examples.
674-
std::string OpenACCMacroOverride;
675-
676671
/// The HLSL root signature version for dxil.
677672
llvm::dxbc::RootSignatureVersion HLSLRootSigVer =
678673
llvm::dxbc::RootSignatureVersion::V1_1;

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,19 +1449,6 @@ def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">,
14491449
HelpText<"Do not override toolchain to compile HIP source to relocatable">;
14501450
}
14511451

1452-
// Clang specific/exclusive options for OpenACC.
1453-
def openacc_macro_override
1454-
: Separate<["-"], "fexperimental-openacc-macro-override">,
1455-
Visibility<[ClangOption, CC1Option]>,
1456-
Group<f_Group>,
1457-
HelpText<"Overrides the _OPENACC macro value for experimental testing "
1458-
"during OpenACC support development">;
1459-
def openacc_macro_override_EQ
1460-
: Joined<["-"], "fexperimental-openacc-macro-override=">,
1461-
Alias<openacc_macro_override>;
1462-
1463-
// End Clang specific/exclusive options for OpenACC.
1464-
14651452
def libomptarget_amdgpu_bc_path_EQ : Joined<["--"], "libomptarget-amdgpu-bc-path=">, Group<i_Group>,
14661453
HelpText<"Path to libomptarget-amdgcn bitcode library">;
14671454
def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group<i_Group>,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3854,15 +3854,6 @@ static void RenderOpenACCOptions(const Driver &D, const ArgList &Args,
38543854
return;
38553855

38563856
CmdArgs.push_back("-fopenacc");
3857-
3858-
if (Arg *A = Args.getLastArg(options::OPT_openacc_macro_override)) {
3859-
StringRef Value = A->getValue();
3860-
int Version;
3861-
if (!Value.getAsInteger(10, Version))
3862-
A->renderAsInput(Args, CmdArgs);
3863-
else
3864-
D.Diag(diag::err_drv_clang_unsupported) << Value;
3865-
}
38663857
}
38673858

38683859
static void RenderBuiltinOptions(const ToolChain &TC, const llvm::Triple &T,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4250,12 +4250,8 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts,
42504250
if (Opts.OpenMPCUDAMode)
42514251
GenerateArg(Consumer, OPT_fopenmp_cuda_mode);
42524252

4253-
if (Opts.OpenACC) {
4253+
if (Opts.OpenACC)
42544254
GenerateArg(Consumer, OPT_fopenacc);
4255-
if (!Opts.OpenACCMacroOverride.empty())
4256-
GenerateArg(Consumer, OPT_openacc_macro_override,
4257-
Opts.OpenACCMacroOverride);
4258-
}
42594255

42604256
// The arguments used to set Optimize, OptimizeSize and NoInlineDefine are
42614257
// generated from CodeGenOptions.
@@ -4869,13 +4865,9 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
48694865
Args.hasArg(options::OPT_fopenmp_cuda_mode);
48704866

48714867
// OpenACC Configuration.
4872-
if (Args.hasArg(options::OPT_fopenacc)) {
4868+
if (Args.hasArg(options::OPT_fopenacc))
48734869
Opts.OpenACC = true;
48744870

4875-
if (Arg *A = Args.getLastArg(options::OPT_openacc_macro_override))
4876-
Opts.OpenACCMacroOverride = A->getValue();
4877-
}
4878-
48794871
if (Arg *A = Args.getLastArg(OPT_ffp_contract)) {
48804872
StringRef Val = A->getValue();
48814873
if (Val == "fast")

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -639,16 +639,8 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
639639
}
640640
}
641641

642-
if (LangOpts.OpenACC) {
643-
// FIXME: When we have full support for OpenACC, we should set this to the
644-
// version we support. Until then, set as '1' by default, but provide a
645-
// temporary mechanism for users to override this so real-world examples can
646-
// be tested against.
647-
if (!LangOpts.OpenACCMacroOverride.empty())
648-
Builder.defineMacro("_OPENACC", LangOpts.OpenACCMacroOverride);
649-
else
650-
Builder.defineMacro("_OPENACC", "1");
651-
}
642+
if (LangOpts.OpenACC)
643+
Builder.defineMacro("_OPENACC", "202506");
652644
}
653645

654646
/// Initialize the predefined C++ language feature test macros defined in

clang/test/Driver/openacc.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,2 @@
11
// RUN: %clang -S -### -fopenacc %s 2>&1 | FileCheck %s --check-prefix=CHECK-DRIVER
22
// CHECK-DRIVER: "-cc1" {{.*}} "-fopenacc"
3-
4-
// RUN: %clang -S -### -fopenacc -fexperimental-openacc-macro-override=202211 %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACRO-OVERRIDE
5-
// RUN: %clang -S -### -fopenacc -fexperimental-openacc-macro-override 202211 %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACRO-OVERRIDE
6-
// CHECK-MACRO-OVERRIDE: "-cc1"{{.*}} "-fexperimental-openacc-macro-override" "202211"
7-
8-
// RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override=202211L %s 2>&1 | FileCheck %s --check-prefix=INVALID
9-
// RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override 202211L %s 2>&1 | FileCheck %s --check-prefix=INVALID
10-
// RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override=L202211 %s 2>&1 | FileCheck %s --check-prefix=INVALID
11-
// RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override L202211 %s 2>&1 | FileCheck %s --check-prefix=INVALID
12-
// RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override=2022L11 %s 2>&1 | FileCheck %s --check-prefix=INVALID
13-
// RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override 2022L11 %s 2>&1 | FileCheck %s --check-prefix=INVALID
14-
// INVALID: error: the clang compiler does not support

clang/test/Preprocessor/openacc.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
// RUN: %clang_cc1 -E -fopenacc %s | FileCheck %s --check-prefix=DEFAULT
2-
// RUN: %clang_cc1 -E -fopenacc -fexperimental-openacc-macro-override 202211 %s | FileCheck %s --check-prefix=OVERRIDE
32

4-
// DEFAULT: OpenACC:1:
5-
// OVERRIDE: OpenACC:202211:
3+
// DEFAULT: OpenACC:202506:
64
OpenACC:_OPENACC:
75

86
// RUN: %clang_cc1 -E -dM -fopenacc %s | FileCheck %s --check-prefix=MACRO_PRINT_DEF
9-
// RUN: %clang_cc1 -E -dM -fopenacc -fexperimental-openacc-macro-override 202211 %s | FileCheck %s --check-prefix=MACRO_PRINT_OVR
10-
// MACRO_PRINT_DEF: #define _OPENACC 1
11-
// MACRO_PRINT_OVR: #define _OPENACC 202211
7+
// MACRO_PRINT_DEF: #define _OPENACC 202506
128

139

0 commit comments

Comments
 (0)