[OpenEmbedded] Add OpenEmbedded vendor

Summary: The lib paths are not correctly picked up for OpenEmbedded sysroots
(like arm-oe-linux-gnueabi). I fix this in a follow-up clang patch. But in
order to add the correct libs I need to detect if the vendor is oe. For this
reason, it is first necessary to teach llvm to detect oe vendor, which is what
this patch does.

Reviewers: chandlerc, compnerd, rengolin, javed.absar

Reviewed By: compnerd

Subscribers: kristof.beyls, dexonsmith, llvm-commits

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

llvm-svn: 336401
This commit is contained in:
Mandeep Singh Grang 2018-07-05 23:41:17 +00:00
parent 89e4abe7b7
commit 083f4d7da4
3 changed files with 10 additions and 1 deletions

View File

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

View File

@ -168,6 +168,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
case AMD: return "amd";
case Mesa: return "mesa";
case SUSE: return "suse";
case OpenEmbedded: return "oe";
}
llvm_unreachable("Invalid VendorType!");
@ -463,6 +464,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("amd", Triple::AMD)
.Case("mesa", Triple::Mesa)
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
.Default(Triple::UnknownVendor);
}

View File

@ -361,6 +361,12 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNUABI64, T.getEnvironment());
T = Triple("arm-oe-linux-gnueabi");
EXPECT_EQ(Triple::arm, T.getArch());
EXPECT_EQ(Triple::OpenEmbedded, T.getVendor());
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNUEABI, T.getEnvironment());
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}