diff options
author | Ed Schouten <ed@nuxi.nl> | 2017-06-25 08:19:37 +0000 |
---|---|---|
committer | Ed Schouten <ed@nuxi.nl> | 2017-06-25 08:19:37 +0000 |
commit | fc7d8c45e2ea70737c3730c3286316807c446c4b (patch) | |
tree | 72f26f5ac3afd64e355ee93f9fcee117724c5372 | |
parent | 750feae3fa82662bc6156e908661f069882986c9 (diff) |
Add support for Ananas platform
Ananas is a home-brew operating system, mainly for amd64 machines. After
using GCC for quite some time, it has switched to clang and never looked
back - yet, having to manually patch things is annoying, so it'd be much
nicer if this was in the official tree.
More information:
https://github.com/zhmu/ananas/
https://rink.nu/projects/ananas.html
Submitted by: Rink Springer
Differential Revision: https://reviews.llvm.org/D32937
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306237 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/Triple.h | 1 | ||||
-rw-r--r-- | lib/Support/Triple.cpp | 2 | ||||
-rw-r--r-- | unittests/ADT/TripleTest.cpp | 6 |
3 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 26a991812a3..cd560658ca4 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -147,6 +147,7 @@ public: enum OSType { UnknownOS, + Ananas, CloudABI, Darwin, DragonFly, diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 320aede79fb..2687a67556d 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -174,6 +174,7 @@ StringRef Triple::getOSTypeName(OSType Kind) { switch (Kind) { case UnknownOS: return "unknown"; + case Ananas: return "ananas"; case CloudABI: return "cloudabi"; case Darwin: return "darwin"; case DragonFly: return "dragonfly"; @@ -455,6 +456,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { static Triple::OSType parseOS(StringRef OSName) { return StringSwitch<Triple::OSType>(OSName) + .StartsWith("ananas", Triple::Ananas) .StartsWith("cloudabi", Triple::CloudABI) .StartsWith("darwin", Triple::Darwin) .StartsWith("dragonfly", Triple::DragonFly) diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp index af4592ba095..16732c9578d 100644 --- a/unittests/ADT/TripleTest.cpp +++ b/unittests/ADT/TripleTest.cpp @@ -200,6 +200,12 @@ TEST(TripleTest, ParsedIDs) { EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); EXPECT_EQ(Triple::UnknownOS, T.getOS()); + T = Triple("x86_64-unknown-ananas"); + EXPECT_EQ(Triple::x86_64, T.getArch()); + EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); + EXPECT_EQ(Triple::Ananas, T.getOS()); + EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); + T = Triple("x86_64-unknown-cloudabi"); EXPECT_EQ(Triple::x86_64, T.getArch()); EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); |