mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 06:29:59 +00:00
Add triple support for the IBM BG/P and BG/Q supercomputers.
llvm-svn: 153882
This commit is contained in:
parent
6c4e6016b5
commit
d6e526ae11
@ -72,7 +72,9 @@ public:
|
||||
|
||||
Apple,
|
||||
PC,
|
||||
SCEI
|
||||
SCEI,
|
||||
BGP,
|
||||
BGQ
|
||||
};
|
||||
enum OSType {
|
||||
UnknownOS,
|
||||
@ -95,7 +97,8 @@ public:
|
||||
Haiku,
|
||||
Minix,
|
||||
RTEMS,
|
||||
NativeClient
|
||||
NativeClient,
|
||||
CNK // BG/P Compute-Node Kernel
|
||||
};
|
||||
enum EnvironmentType {
|
||||
UnknownEnvironment,
|
||||
|
@ -88,6 +88,8 @@ const char *Triple::getVendorTypeName(VendorType Kind) {
|
||||
case Apple: return "apple";
|
||||
case PC: return "pc";
|
||||
case SCEI: return "scei";
|
||||
case BGP: return "bgp";
|
||||
case BGQ: return "bgq";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid VendorType!");
|
||||
@ -116,6 +118,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
|
||||
case Minix: return "minix";
|
||||
case RTEMS: return "rtems";
|
||||
case NativeClient: return "nacl";
|
||||
case CNK: return "cnk";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid OSType");
|
||||
@ -258,6 +261,8 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
|
||||
.Case("apple", Triple::Apple)
|
||||
.Case("pc", Triple::PC)
|
||||
.Case("scei", Triple::SCEI)
|
||||
.Case("bgp", Triple::BGP)
|
||||
.Case("bgq", Triple::BGQ)
|
||||
.Default(Triple::UnknownVendor);
|
||||
}
|
||||
|
||||
@ -282,6 +287,7 @@ static Triple::OSType parseOS(StringRef OSName) {
|
||||
.StartsWith("minix", Triple::Minix)
|
||||
.StartsWith("rtems", Triple::RTEMS)
|
||||
.StartsWith("nacl", Triple::NativeClient)
|
||||
.StartsWith("cnk", Triple::CNK)
|
||||
.Default(Triple::UnknownOS);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,24 @@ TEST(TripleTest, ParsedIDs) {
|
||||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::GNU, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc-bgp-linux");
|
||||
EXPECT_EQ(Triple::ppc, T.getArch());
|
||||
EXPECT_EQ(Triple::BGP, T.getVendor());
|
||||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc-bgp-cnk");
|
||||
EXPECT_EQ(Triple::ppc, T.getArch());
|
||||
EXPECT_EQ(Triple::BGP, T.getVendor());
|
||||
EXPECT_EQ(Triple::CNK, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc64-bgq-linux");
|
||||
EXPECT_EQ(Triple::ppc64, T.getArch());
|
||||
EXPECT_EQ(Triple::BGQ, T.getVendor());
|
||||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc-dunno-notsure");
|
||||
EXPECT_EQ(Triple::ppc, T.getArch());
|
||||
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
|
||||
|
Loading…
Reference in New Issue
Block a user