Skip to content

Commit

Permalink
[PS5] Handle visibility options same as PS4
Browse files Browse the repository at this point in the history
This update was missed in the initial rounds of upstreaming PS5.
  • Loading branch information
pogo59 committed Jan 17, 2023
1 parent eae8d22 commit 09e4449
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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())
Expand Down
Original file line number Diff line number Diff line change
@@ -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} = \
Expand All @@ -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} \
Expand All @@ -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"
Expand All @@ -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'
Expand All @@ -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 \
Expand All @@ -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"
Expand Down Expand Up @@ -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 \
Expand All @@ -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"
Expand Down

0 comments on commit 09e4449

Please sign in to comment.