[PS5] Add PS5 as a legal triple component

This commit is contained in:
Paul Robinson 2022-04-04 13:55:35 -07:00
parent ee394177e6
commit 077f90315b
3 changed files with 18 additions and 0 deletions

View File

@ -198,6 +198,7 @@ public:
NVCL, // NVIDIA OpenCL
AMDHSA, // AMD HSA Runtime
PS4,
PS5,
ELFIAMCU,
TvOS, // Apple tvOS
WatchOS, // Apple watchOS
@ -677,6 +678,16 @@ public:
getOS() == Triple::PS4;
}
/// Tests whether the target is the PS5 platform.
bool isPS5() const {
return getArch() == Triple::x86_64 &&
getVendor() == Triple::SCEI &&
getOS() == Triple::PS5;
}
/// Tests whether the target is the PS4 or PS5 platform.
bool isPS() const { return isPS4() || isPS5(); }
/// Tests whether the target is Android
bool isAndroid() const { return getEnvironment() == Triple::Android; }

View File

@ -231,6 +231,7 @@ StringRef Triple::getOSTypeName(OSType Kind) {
case NetBSD: return "netbsd";
case OpenBSD: return "openbsd";
case PS4: return "ps4";
case PS5: return "ps5";
case RTEMS: return "rtems";
case Solaris: return "solaris";
case TvOS: return "tvos";
@ -569,6 +570,7 @@ static Triple::OSType parseOS(StringRef OSName) {
.StartsWith("nvcl", Triple::NVCL)
.StartsWith("amdhsa", Triple::AMDHSA)
.StartsWith("ps4", Triple::PS4)
.StartsWith("ps5", Triple::PS5)
.StartsWith("elfiamcu", Triple::ELFIAMCU)
.StartsWith("tvos", Triple::TvOS)
.StartsWith("watchos", Triple::WatchOS)

View File

@ -140,6 +140,11 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::SCEI, T.getVendor());
EXPECT_EQ(Triple::PS4, T.getOS());
T = Triple("x86_64-sie-ps5");
EXPECT_EQ(Triple::x86_64, T.getArch());
EXPECT_EQ(Triple::SCEI, T.getVendor());
EXPECT_EQ(Triple::PS5, T.getOS());
T = Triple("powerpc-ibm-aix");
EXPECT_EQ(Triple::ppc, T.getArch());
EXPECT_EQ(Triple::IBM, T.getVendor());