File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ class Triple {
198
198
NVCL, // NVIDIA OpenCL
199
199
AMDHSA, // AMD HSA Runtime
200
200
PS4,
201
+ PS5,
201
202
ELFIAMCU,
202
203
TvOS, // Apple tvOS
203
204
WatchOS, // Apple watchOS
@@ -677,6 +678,16 @@ class Triple {
677
678
getOS () == Triple::PS4;
678
679
}
679
680
681
+ // / Tests whether the target is the PS5 platform.
682
+ bool isPS5 () const {
683
+ return getArch () == Triple::x86_64 &&
684
+ getVendor () == Triple::SCEI &&
685
+ getOS () == Triple::PS5;
686
+ }
687
+
688
+ // / Tests whether the target is the PS4 or PS5 platform.
689
+ bool isPS () const { return isPS4 () || isPS5 (); }
690
+
680
691
// / Tests whether the target is Android
681
692
bool isAndroid () const { return getEnvironment () == Triple::Android; }
682
693
Original file line number Diff line number Diff line change @@ -231,6 +231,7 @@ StringRef Triple::getOSTypeName(OSType Kind) {
231
231
case NetBSD: return " netbsd" ;
232
232
case OpenBSD: return " openbsd" ;
233
233
case PS4: return " ps4" ;
234
+ case PS5: return " ps5" ;
234
235
case RTEMS: return " rtems" ;
235
236
case Solaris: return " solaris" ;
236
237
case TvOS: return " tvos" ;
@@ -569,6 +570,7 @@ static Triple::OSType parseOS(StringRef OSName) {
569
570
.StartsWith (" nvcl" , Triple::NVCL)
570
571
.StartsWith (" amdhsa" , Triple::AMDHSA)
571
572
.StartsWith (" ps4" , Triple::PS4)
573
+ .StartsWith (" ps5" , Triple::PS5)
572
574
.StartsWith (" elfiamcu" , Triple::ELFIAMCU)
573
575
.StartsWith (" tvos" , Triple::TvOS)
574
576
.StartsWith (" watchos" , Triple::WatchOS)
Original file line number Diff line number Diff line change @@ -140,6 +140,11 @@ TEST(TripleTest, ParsedIDs) {
140
140
EXPECT_EQ (Triple::SCEI, T.getVendor ());
141
141
EXPECT_EQ (Triple::PS4, T.getOS ());
142
142
143
+ T = Triple (" x86_64-sie-ps5" );
144
+ EXPECT_EQ (Triple::x86_64, T.getArch ());
145
+ EXPECT_EQ (Triple::SCEI, T.getVendor ());
146
+ EXPECT_EQ (Triple::PS5, T.getOS ());
147
+
143
148
T = Triple (" powerpc-ibm-aix" );
144
149
EXPECT_EQ (Triple::ppc, T.getArch ());
145
150
EXPECT_EQ (Triple::IBM, T.getVendor ());
You can’t perform that action at this time.
0 commit comments