forked from OSchip/llvm-project
[PS5] Add PS5 as a legal triple component
This commit is contained in:
parent
ee394177e6
commit
077f90315b
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue