Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions llvm/include/llvm/TargetParser/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class Triple {
SUSE,
OpenEmbedded,
Intel,
LastVendorType = Intel
Meta,
LastVendorType = Meta
};
enum OSType {
UnknownOS,
Expand Down Expand Up @@ -307,8 +308,8 @@ class Triple {
Mlibc,

PAuthTest,

LastEnvironmentType = PAuthTest
MTIA,
LastEnvironmentType = MTIA
};
enum ObjectFormatType {
UnknownObjectFormat,
Expand Down
6 changes: 6 additions & 0 deletions llvm/lib/TargetParser/Triple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
case PC: return "pc";
case SCEI: return "scei";
case SUSE: return "suse";
case Meta:
return "meta";
}

llvm_unreachable("Invalid VendorType!");
Expand Down Expand Up @@ -391,6 +393,8 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
case OpenHOS: return "ohos";
case PAuthTest:
return "pauthtest";
case MTIA:
return "mtia";
case LLVM:
return "llvm";
case Mlibc:
Expand Down Expand Up @@ -678,6 +682,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
.Case("intel", Triple::Intel)
.Case("meta", Triple::Meta)
.Default(Triple::UnknownVendor);
}

Expand Down Expand Up @@ -781,6 +786,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
.StartsWith("pauthtest", Triple::PAuthTest)
.StartsWith("llvm", Triple::LLVM)
.StartsWith("mlibc", Triple::Mlibc)
.StartsWith("mtia", Triple::MTIA)
.Default(Triple::UnknownEnvironment);
}

Expand Down
6 changes: 6 additions & 0 deletions llvm/unittests/TargetParser/TripleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::UnknownOS, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());

T = Triple("riscv64-meta-unknown-mtia");
EXPECT_EQ(Triple::riscv64, T.getArch());
EXPECT_EQ(Triple::Meta, T.getVendor());
EXPECT_EQ(Triple::UnknownOS, T.getOS());
EXPECT_EQ(Triple::MTIA, T.getEnvironment());

T = Triple("riscv64-unknown-linux");
EXPECT_EQ(Triple::riscv64, T.getArch());
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
Expand Down