Add SUSE vendor

Summary: SUSE's ARM triples end with -gnueabi even though they are hard-float. This requires special handling of SUSE ARM triples. Hence we need a way to differentiate the SUSE as vendor. This CL adds that.

Reviewers: chandlerc, compnerd, echristo, rengolin

Reviewed By: rengolin

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: https://reviews.llvm.org/D32426

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ismail Donmez 2017-04-24 11:18:29 +00:00
parent 2f681da9f4
commit 63dc9141ba
3 changed files with 10 additions and 1 deletions

View File

@ -140,7 +140,8 @@ public:
Myriad,
AMD,
Mesa,
LastVendorType = Mesa
SUSE,
LastVendorType = SUSE
};
enum OSType {
UnknownOS,

View File

@ -161,6 +161,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
case Myriad: return "myriad";
case AMD: return "amd";
case Mesa: return "mesa";
case SUSE: return "suse";
}
llvm_unreachable("Invalid VendorType!");
@ -443,6 +444,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("myriad", Triple::Myriad)
.Case("amd", Triple::AMD)
.Case("mesa", Triple::Mesa)
.Case("suse", Triple::SUSE)
.Default(Triple::UnknownVendor);
}

View File

@ -284,6 +284,12 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::FreeBSD, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
T = Triple("armv7hl-suse-linux-gnueabi");
EXPECT_EQ(Triple::arm, T.getArch());
EXPECT_EQ(Triple::SUSE, T.getVendor());
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNUEABI, T.getEnvironment());
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}