From 09e4449901d7fc780806778181cf3136c1e08e98 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Tue, 17 Jan 2023 11:26:51 -0800 Subject: [PATCH] [PS5] Handle visibility options same as PS4 This update was missed in the initial rounds of upstreaming PS5. --- clang/lib/Driver/ToolChains/Clang.cpp | 4 +++- ...orageclass.c => ps4-ps5-visibility-dllstorageclass.c} | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) rename clang/test/Driver/{ps4-visibility-dllstorageclass.c => ps4-ps5-visibility-dllstorageclass.c} (94%) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 5462634..212b3fa 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -6033,7 +6033,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fvisibility=protected"); } - if (!RawTriple.isPS4()) + // PS4/PS5 process these options in addClangTargetOptions. + if (!RawTriple.isPS()) { if (const Arg *A = Args.getLastArg(options::OPT_fvisibility_from_dllstorageclass, options::OPT_fno_visibility_from_dllstorageclass)) { @@ -6047,6 +6048,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_fvisibility_externs_nodllstorageclass_EQ); } } + } if (const Arg *A = Args.getLastArg(options::OPT_mignore_xcoff_visibility)) { if (Triple.isOSAIX()) diff --git a/clang/test/Driver/ps4-visibility-dllstorageclass.c b/clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c similarity index 94% rename from clang/test/Driver/ps4-visibility-dllstorageclass.c rename to clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c index e7d9b12..1a54990 100644 --- a/clang/test/Driver/ps4-visibility-dllstorageclass.c +++ b/clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c @@ -1,4 +1,4 @@ -// Check behaviour of -fvisibility-from-dllstorageclass options for PS4 +// Check behaviour of -fvisibility-from-dllstorageclass options for PS4/PS5. // DEFINE: %{triple} = // DEFINE: %{run} = \ @@ -11,6 +11,8 @@ // DEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // // REDEFINE: %{run} = \ // REDEFINE: %clang -### -target %{triple} \ @@ -26,6 +28,8 @@ // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // DEFAULTS: "-fvisibility-from-dllstorageclass" // DEFAULTS-SAME: "-fvisibility-dllexport=protected" @@ -51,6 +55,8 @@ // REDEFINE: --implicit-check-not=warning: // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // UNUSED: warning: argument unused during compilation: '-fvisibility-dllexport=hidden' // UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-nodllstorageclass=protected' @@ -71,6 +77,8 @@ // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // REDEFINE: %{run} = \ // REDEFINE: %clang -### -target x86_64-scei-ps4 \ @@ -87,6 +95,8 @@ // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // SOME: "-fvisibility-from-dllstorageclass" // SOME-SAME: "-fvisibility-dllexport=protected" @@ -114,6 +124,8 @@ // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // REDEFINE: %{run} = \ // REDEFINE: %clang -### -target x86_64-scei-ps4 \ @@ -136,6 +148,8 @@ // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass // REDEFINE: %{triple} = x86_64-scei-ps4 // RUN: %{run} +// REDEFINE: %{triple} = x86_64-sie-ps5 +// RUN: %{run} // ALL: "-fvisibility-from-dllstorageclass" // ALL-SAME: "-fvisibility-dllexport=hidden" -- 2.7.4