forked from OSchip/llvm-project
Add powerpc-ibm-aix to Triple. Patch by Kai.
llvm-svn: 165792
This commit is contained in:
parent
d4a2f5bbfa
commit
d5772de0eb
|
@ -76,7 +76,8 @@ public:
|
|||
SCEI,
|
||||
BGP,
|
||||
BGQ,
|
||||
Freescale
|
||||
Freescale,
|
||||
IBM
|
||||
};
|
||||
enum OSType {
|
||||
UnknownOS,
|
||||
|
@ -101,7 +102,8 @@ public:
|
|||
RTEMS,
|
||||
NativeClient,
|
||||
CNK, // BG/P Compute-Node Kernel
|
||||
Bitrig
|
||||
Bitrig,
|
||||
AIX
|
||||
};
|
||||
enum EnvironmentType {
|
||||
UnknownEnvironment,
|
||||
|
|
|
@ -98,6 +98,7 @@ const char *Triple::getVendorTypeName(VendorType Kind) {
|
|||
case BGP: return "bgp";
|
||||
case BGQ: return "bgq";
|
||||
case Freescale: return "fsl";
|
||||
case IBM: return "ibm";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid VendorType!");
|
||||
|
@ -128,6 +129,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
|
|||
case NativeClient: return "nacl";
|
||||
case CNK: return "cnk";
|
||||
case Bitrig: return "bitrig";
|
||||
case AIX: return "aix";
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid OSType");
|
||||
|
@ -278,6 +280,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
|
|||
.Case("bgp", Triple::BGP)
|
||||
.Case("bgq", Triple::BGQ)
|
||||
.Case("fsl", Triple::Freescale)
|
||||
.Case("ibm", Triple::IBM)
|
||||
.Default(Triple::UnknownVendor);
|
||||
}
|
||||
|
||||
|
@ -304,6 +307,7 @@ static Triple::OSType parseOS(StringRef OSName) {
|
|||
.StartsWith("nacl", Triple::NativeClient)
|
||||
.StartsWith("cnk", Triple::CNK)
|
||||
.StartsWith("bitrig", Triple::Bitrig)
|
||||
.StartsWith("aix", Triple::AIX)
|
||||
.Default(Triple::UnknownOS);
|
||||
}
|
||||
|
||||
|
|
|
@ -105,6 +105,18 @@ TEST(TripleTest, ParsedIDs) {
|
|||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc-ibm-aix");
|
||||
EXPECT_EQ(Triple::ppc, T.getArch());
|
||||
EXPECT_EQ(Triple::IBM, T.getVendor());
|
||||
EXPECT_EQ(Triple::AIX, T.getOS());
|
||||
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc64-ibm-aix");
|
||||
EXPECT_EQ(Triple::ppc64, T.getArch());
|
||||
EXPECT_EQ(Triple::IBM, T.getVendor());
|
||||
EXPECT_EQ(Triple::AIX, 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