[llvm] 144ca1e - [PS4] Allow triple to reflect the new company name.
Paul Robinson via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 4 09:43:30 PST 2021
Author: Paul Robinson
Date: 2021-02-04T09:43:17-08:00
New Revision: 144ca1e5bc1c7ba3a673d0e4b5603cb57f71cfcf
URL: https://github.com/llvm/llvm-project/commit/144ca1e5bc1c7ba3a673d0e4b5603cb57f71cfcf
DIFF: https://github.com/llvm/llvm-project/commit/144ca1e5bc1c7ba3a673d0e4b5603cb57f71cfcf.diff
LOG: [PS4] Allow triple to reflect the new company name.
Added:
Modified:
llvm/lib/Support/Triple.cpp
llvm/unittests/ADT/TripleTest.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index 4f483c965282..40c4f3db8b53 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -479,6 +479,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("apple", Triple::Apple)
.Case("pc", Triple::PC)
.Case("scei", Triple::SCEI)
+ .Case("sie", Triple::SCEI)
.Case("fsl", Triple::Freescale)
.Case("ibm", Triple::IBM)
.Case("img", Triple::ImaginationTechnologies)
diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/ADT/TripleTest.cpp
index ff6c2dde4b16..0e49a1aa143a 100644
--- a/llvm/unittests/ADT/TripleTest.cpp
+++ b/llvm/unittests/ADT/TripleTest.cpp
@@ -111,6 +111,17 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::Musl, T.getEnvironment());
+ // PS4 has two spellings for the vendor.
+ T = Triple("x86_64-scei-ps4");
+ EXPECT_EQ(Triple::x86_64, T.getArch());
+ EXPECT_EQ(Triple::SCEI, T.getVendor());
+ EXPECT_EQ(Triple::PS4, T.getOS());
+
+ T = Triple("x86_64-sie-ps4");
+ EXPECT_EQ(Triple::x86_64, T.getArch());
+ EXPECT_EQ(Triple::SCEI, T.getVendor());
+ EXPECT_EQ(Triple::PS4, T.getOS());
+
T = Triple("powerpc-ibm-aix");
EXPECT_EQ(Triple::ppc, T.getArch());
EXPECT_EQ(Triple::IBM, T.getVendor());
More information about the llvm-commits
mailing list