[clang] 09e4449 - [PS5] Handle visibility options same as PS4
Paul Robinson via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 17 11:28:01 PST 2023
Author: Paul Robinson
Date: 2023-01-17T11:27:51-08:00
New Revision: 09e4449901d7fc780806778181cf3136c1e08e98
URL: https://github.com/llvm/llvm-project/commit/09e4449901d7fc780806778181cf3136c1e08e98
DIFF: https://github.com/llvm/llvm-project/commit/09e4449901d7fc780806778181cf3136c1e08e98.diff
LOG: [PS5] Handle visibility options same as PS4
This update was missed in the initial rounds of upstreaming PS5.
Added:
clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
Removed:
clang/test/Driver/ps4-visibility-dllstorageclass.c
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 5462634aa96da..212b3faa2dc74 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 e7d9b122eed6d..1a54990da4764 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"
More information about the cfe-commits
mailing list