[clang] 634c8ef - [PS5] Allow dllimport/dllexport same as PS4
Paul Robinson via cfe-commits
cfe-commits at lists.llvm.org
Thu May 26 07:01:40 PDT 2022
Author: Paul Robinson
Date: 2022-05-26T07:01:30-07:00
New Revision: 634c8ef69a836f3436d027b03965965bad6f3ff0
URL: https://github.com/llvm/llvm-project/commit/634c8ef69a836f3436d027b03965965bad6f3ff0
DIFF: https://github.com/llvm/llvm-project/commit/634c8ef69a836f3436d027b03965965bad6f3ff0.diff
LOG: [PS5] Allow dllimport/dllexport same as PS4
Added:
Modified:
clang/include/clang/Basic/TargetInfo.h
clang/lib/Sema/SemaTemplate.cpp
clang/test/CodeGen/ps4-dllimport-dllexport.c
clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp
clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
clang/test/CodeGenCXX/windows-itanium-dllexport.cpp
clang/test/Sema/dllimport.c
clang/test/SemaCXX/dllexport.cpp
clang/test/SemaCXX/dllimport.cpp
llvm/include/llvm/ADT/Triple.h
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h
index 470d153d845de..e4b5f0b751c48 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -1195,12 +1195,12 @@ class TargetInfo : public virtual TransferrableTargetInfo,
/// Microsoft C++ code using dllimport/export attributes?
virtual bool shouldDLLImportComdatSymbols() const {
return getTriple().isWindowsMSVCEnvironment() ||
- getTriple().isWindowsItaniumEnvironment() || getTriple().isPS4();
+ getTriple().isWindowsItaniumEnvironment() || getTriple().isPS();
}
// Does this target have PS4 specific dllimport/export handling?
virtual bool hasPS4DLLImportExport() const {
- return getTriple().isPS4() ||
+ return getTriple().isPS() ||
// Windows Itanium support allows for testing the SCEI flavour of
// dllimport/export handling on a Windows system.
(getTriple().isWindowsItaniumEnvironment() &&
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 4a42969c34d3f..b11b97e12403c 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -9760,7 +9760,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
if (!getDLLAttr(Def) && getDLLAttr(Specialization) &&
(Context.getTargetInfo().shouldDLLImportComdatSymbols() &&
- !Context.getTargetInfo().getTriple().isPS4())) {
+ !Context.getTargetInfo().getTriple().isPS())) {
// An explicit instantiation definition can add a dll attribute to a
// template with a previous instantiation declaration. MinGW doesn't
// allow this.
@@ -9778,7 +9778,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
!PreviouslyDLLExported && Specialization->hasAttr<DLLExportAttr>();
if (Old_TSK == TSK_ImplicitInstantiation && NewlyDLLExported &&
(Context.getTargetInfo().shouldDLLImportComdatSymbols() &&
- !Context.getTargetInfo().getTriple().isPS4())) {
+ !Context.getTargetInfo().getTriple().isPS())) {
// An explicit instantiation definition can add a dll attribute to a
// template with a previous implicit instantiation. MinGW doesn't allow
// this. We limit clang to only adding dllexport, to avoid potentially
diff --git a/clang/test/CodeGen/ps4-dllimport-dllexport.c b/clang/test/CodeGen/ps4-dllimport-dllexport.c
index a945000e7e323..efcdc4d7a5c48 100644
--- a/clang/test/CodeGen/ps4-dllimport-dllexport.c
+++ b/clang/test/CodeGen/ps4-dllimport-dllexport.c
@@ -1,9 +1,5 @@
-// RUN: %clang_cc1 \
-// RUN: -triple x86_64-scei-ps4 \
-// RUN: -fdeclspec \
-// RUN: -Werror \
-// RUN: -emit-llvm %s -o - | \
-// RUN: FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fdeclspec -Werror -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 -fdeclspec -Werror -emit-llvm %s -o - | FileCheck %s
__declspec(dllexport) int export_int;
diff --git a/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp b/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
index f0327567d5d08..432ef7835ddc5 100644
--- a/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
+++ b/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-windows-gnu -fdeclspec -emit-llvm -o - %s | FileCheck %s -DDSO_ATTRS="dso_local dllexport"
// RUN: %clang_cc1 -triple x86_64-windows-itanium -fdeclspec -emit-llvm -o - %s | FileCheck %s -DDSO_ATTRS="dso_local dllexport"
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fdeclspec -emit-llvm -o - %s | FileCheck %s -DDSO_ATTRS=dllexport
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 -fdeclspec -emit-llvm -o - %s | FileCheck %s -DDSO_ATTRS=dllexport
struct __declspec(dllexport) A {
virtual void m();
diff --git a/clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp b/clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp
index 87d0686d34980..77f0be81a6935 100644
--- a/clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp
+++ b/clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp
@@ -39,6 +39,7 @@
// RUN: %clang_cc1 -no-opaque-pointers -I%S -fdeclspec -triple x86_64-unknown-windows-itanium -emit-llvm -o - %s -fhalf-no-semantic-interposition | FileCheck %s -check-prefix=WI
// RUN: %clang_cc1 -no-opaque-pointers -I%S -fdeclspec -triple x86_64-scei-windows-itanium -emit-llvm -o - %s -fhalf-no-semantic-interposition | FileCheck %s --check-prefixes=PS4,SCEI_WI
// RUN: %clang_cc1 -no-opaque-pointers -I%S -fdeclspec -triple x86_64-scei-ps4 -emit-llvm -o - %s -fhalf-no-semantic-interposition | FileCheck %s --check-prefixes=PS4,SCEI_PS4
+// RUN: %clang_cc1 -no-opaque-pointers -I%S -fdeclspec -triple x86_64-sie-ps5 -emit-llvm -o - %s -fhalf-no-semantic-interposition | FileCheck %s --check-prefixes=PS4,SCEI_PS4
#include <typeinfo>
diff --git a/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp b/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
index 726be73550229..3a5693275824f 100644
--- a/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
+++ b/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -std=c++11 -triple i686-windows -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-MS
// RUN: %clang_cc1 -std=c++11 -triple i686-windows-itanium -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-IA
// RUN: %clang_cc1 -std=c++11 -triple x86_64-scei-ps4 -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-PS4
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-sie-ps5 -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-PS4
template <typename>
struct s {};
diff --git a/clang/test/CodeGenCXX/windows-itanium-dllexport.cpp b/clang/test/CodeGenCXX/windows-itanium-dllexport.cpp
index 6b30369e6835c..c09fa30d761af 100644
--- a/clang/test/CodeGenCXX/windows-itanium-dllexport.cpp
+++ b/clang/test/CodeGenCXX/windows-itanium-dllexport.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -emit-llvm -triple i686-windows-itanium -fdeclspec %s -o - | FileCheck %s --check-prefixes=CHECK,WI
// RUN: %clang_cc1 -emit-llvm -triple x86_64-scei-ps4 -fdeclspec %s -o - | FileCheck %s --check-prefixes=CHECK,PS4
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-sie-ps5 -fdeclspec %s -o - | FileCheck %s --check-prefixes=CHECK,PS4
#define JOIN2(x, y) x##y
#define JOIN(x, y) JOIN2(x, y)
diff --git a/clang/test/Sema/dllimport.c b/clang/test/Sema/dllimport.c
index e5e378379c614..26ee0a7e80ed6 100644
--- a/clang/test/Sema/dllimport.c
+++ b/clang/test/Sema/dllimport.c
@@ -7,6 +7,7 @@
// RUN: %clang_cc1 -triple x86_64-windows-itanium -fsyntax-only -fms-extensions -verify -std=c11 -DWI %s
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fsyntax-only -fms-extensions -verify -std=c11 -DWI %s
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fsyntax-only -fms-extensions -verify -std=c99 -DWI %s
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 -fsyntax-only -fms-extensions -verify -std=c11 -DWI %s
// Invalid usage.
__declspec(dllimport) typedef int typedef1;
diff --git a/clang/test/SemaCXX/dllexport.cpp b/clang/test/SemaCXX/dllexport.cpp
index b4af68086b940..4aa1427563a2e 100644
--- a/clang/test/SemaCXX/dllexport.cpp
+++ b/clang/test/SemaCXX/dllexport.cpp
@@ -5,6 +5,7 @@
// RUN: %clang_cc1 -triple i686-windows-itanium -fsyntax-only -fms-extensions -verify -std=c++11 -Wunsupported-dll-base-class-template -DWI %s
// RUN: %clang_cc1 -triple x86_64-windows-itanium -fsyntax-only -fms-extensions -verify -std=c++1y -Wunsupported-dll-base-class-template -DWI %s
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fsyntax-only -fdeclspec -verify -std=c++1y -Wunsupported-dll-base-class-template -DWI %s
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 -fsyntax-only -fdeclspec -verify -std=c++1y -Wunsupported-dll-base-class-template -DWI %s
// Helper structs to make templates more expressive.
struct ImplicitInst_Exported {};
diff --git a/clang/test/SemaCXX/dllimport.cpp b/clang/test/SemaCXX/dllimport.cpp
index 642cdd07a6642..c5291d925523d 100644
--- a/clang/test/SemaCXX/dllimport.cpp
+++ b/clang/test/SemaCXX/dllimport.cpp
@@ -7,6 +7,7 @@
// RUN: %clang_cc1 -triple x86_64-windows-itanium -fsyntax-only -fms-extensions -verify -std=c++17 -Wunsupported-dll-base-class-template -DWI %s
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fsyntax-only -fdeclspec -verify -std=c++11 -Wunsupported-dll-base-class-template -DWI %s
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fsyntax-only -fdeclspec -verify -std=c++17 -Wunsupported-dll-base-class-template -DWI %s
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 -fsyntax-only -fdeclspec -verify -std=c++17 -Wunsupported-dll-base-class-template -DWI %s
// Helper structs to make templates more expressive.
struct ImplicitInst_Imported {};
diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h
index b1deb3e7b9a7a..e54663c6eff06 100644
--- a/llvm/include/llvm/ADT/Triple.h
+++ b/llvm/include/llvm/ADT/Triple.h
@@ -928,7 +928,7 @@ class Triple {
}
/// Tests if the environment supports dllimport/export annotations.
- bool hasDLLImportExport() const { return isOSWindows() || isPS4(); }
+ bool hasDLLImportExport() const { return isOSWindows() || isPS(); }
/// @}
/// @name Mutators
More information about the cfe-commits
mailing list