diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2017-09-14 06:50:05 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2017-09-14 06:50:05 +0000 |
commit | 679cc5075b7bf047ffcb20154cf000e50e15cb38 (patch) | |
tree | 4e802161233e6107a46e492d01922d4d36e8c904 | |
parent | a31c940251feae02186fe4e7e9ab8030274e0913 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313231 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/Triple.h | 7 | ||||
-rw-r--r-- | lib/Support/Triple.cpp | 2 | ||||
-rw-r--r-- | unittests/ADT/TripleTest.cpp | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 91ab8554d13..4e1e218da78 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -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 { diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 73dc59ce41b..8dc582ab95a 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -216,6 +216,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) { 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 parseEnvironment(StringRef EnvironmentName) { 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) diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp index 0cedbd5a723..db11f426490 100644 --- a/unittests/ADT/TripleTest.cpp +++ b/unittests/ADT/TripleTest.cpp @@ -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()); |