[llvm] r313231 - [mips] Recognise the triple used by Debian for MIPS n32 ABI
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 23:50:05 PDT 2017
Author: atanasyan
Date: Wed Sep 13 23:50:05 2017
New Revision: 313231
URL: http://llvm.org/viewvc/llvm-project?rev=313231&view=rev
Log:
[mips] Recognise the triple used by Debian for MIPS n32 ABI
Triples like mips64-linux-gnuabin32 are documented in this article:
https://wiki.debian.org/Multiarch/Tuples
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/unittests/ADT/TripleTest.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=313231&r1=313230&r2=313231&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Wed Sep 13 23:50:05 2017
@@ -185,6 +185,7 @@ public:
UnknownEnvironment,
GNU,
+ GNUABIN32,
GNUABI64,
GNUEABI,
GNUEABIHF,
@@ -496,9 +497,9 @@ public:
bool isGNUEnvironment() const {
EnvironmentType Env = getEnvironment();
- return Env == Triple::GNU || Env == Triple::GNUABI64 ||
- Env == Triple::GNUEABI || Env == Triple::GNUEABIHF ||
- Env == Triple::GNUX32;
+ return Env == Triple::GNU || Env == Triple::GNUABIN32 ||
+ Env == Triple::GNUABI64 || Env == Triple::GNUEABI ||
+ Env == Triple::GNUEABIHF || Env == Triple::GNUX32;
}
bool isOSContiki() const {
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=313231&r1=313230&r2=313231&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Wed Sep 13 23:50:05 2017
@@ -216,6 +216,7 @@ StringRef Triple::getEnvironmentTypeName
switch (Kind) {
case UnknownEnvironment: return "unknown";
case GNU: return "gnu";
+ case GNUABIN32: return "gnuabin32";
case GNUABI64: return "gnuabi64";
case GNUEABIHF: return "gnueabihf";
case GNUEABI: return "gnueabi";
@@ -505,6 +506,7 @@ static Triple::EnvironmentType parseEnvi
return StringSwitch<Triple::EnvironmentType>(EnvironmentName)
.StartsWith("eabihf", Triple::EABIHF)
.StartsWith("eabi", Triple::EABI)
+ .StartsWith("gnuabin32", Triple::GNUABIN32)
.StartsWith("gnuabi64", Triple::GNUABI64)
.StartsWith("gnueabihf", Triple::GNUEABIHF)
.StartsWith("gnueabi", Triple::GNUEABI)
Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TripleTest.cpp?rev=313231&r1=313230&r2=313231&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Wed Sep 13 23:50:05 2017
@@ -332,6 +332,12 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNU, T.getEnvironment());
+ T = Triple("mips64el-img-linux-gnuabin32");
+ EXPECT_EQ(Triple::mips64el, T.getArch());
+ EXPECT_EQ(Triple::ImaginationTechnologies, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNUABIN32, T.getEnvironment());
+
T = Triple("mips64el-unknown-linux-gnuabi64");
EXPECT_EQ(Triple::mips64el, T.getArch());
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
More information about the llvm-commits
mailing list