forked from OSchip/llvm-project
Add a Musl environment to the triple.
It will be used in clang. Patch by Lei Zhang. llvm-svn: 272660
This commit is contained in:
parent
be7aa544f0
commit
9768b0ae73
|
@ -179,6 +179,7 @@ public:
|
|||
EABI,
|
||||
EABIHF,
|
||||
Android,
|
||||
Musl,
|
||||
|
||||
MSVC,
|
||||
Itanium,
|
||||
|
|
|
@ -205,6 +205,7 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
|
|||
case EABI: return "eabi";
|
||||
case EABIHF: return "eabihf";
|
||||
case Android: return "android";
|
||||
case Musl: return "musl";
|
||||
case MSVC: return "msvc";
|
||||
case Itanium: return "itanium";
|
||||
case Cygnus: return "cygnus";
|
||||
|
@ -464,6 +465,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
|
|||
.StartsWith("code16", Triple::CODE16)
|
||||
.StartsWith("gnu", Triple::GNU)
|
||||
.StartsWith("android", Triple::Android)
|
||||
.StartsWith("musl", Triple::Musl)
|
||||
.StartsWith("msvc", Triple::MSVC)
|
||||
.StartsWith("itanium", Triple::Itanium)
|
||||
.StartsWith("cygnus", Triple::Cygnus)
|
||||
|
|
|
@ -93,6 +93,12 @@ TEST(TripleTest, ParsedIDs) {
|
|||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::GNU, T.getEnvironment());
|
||||
|
||||
T = Triple("x86_64-pc-linux-musl");
|
||||
EXPECT_EQ(Triple::x86_64, T.getArch());
|
||||
EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
EXPECT_EQ(Triple::Linux, T.getOS());
|
||||
EXPECT_EQ(Triple::Musl, T.getEnvironment());
|
||||
|
||||
T = Triple("powerpc-bgp-linux");
|
||||
EXPECT_EQ(Triple::ppc, T.getArch());
|
||||
EXPECT_EQ(Triple::BGP, T.getVendor());
|
||||
|
|
Loading…
Reference in New Issue