[PATCH] D136086: [llvm] Add MorphOS to Triple`
Jonathan Schleifer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 17 08:11:26 PDT 2022
js created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
js requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This adds MorphOS to the Triple. It adds the enum as well as parsing.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D136086
Files:
llvm/include/llvm/ADT/Triple.h
llvm/lib/Support/Triple.cpp
llvm/unittests/ADT/TripleTest.cpp
Index: llvm/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/unittests/ADT/TripleTest.cpp
+++ llvm/unittests/ADT/TripleTest.cpp
@@ -804,6 +804,12 @@
EXPECT_EQ(Triple::Amplification, T.getEnvironment());
EXPECT_FALSE(T.supportsCOMDAT());
+ T = Triple("powerpc-unknown-morphos");
+ EXPECT_EQ(Triple::ppc, T.getArch());
+ EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
+ EXPECT_EQ(Triple::MorphOS, T.getOS());
+ EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}
Index: llvm/lib/Support/Triple.cpp
===================================================================
--- llvm/lib/Support/Triple.cpp
+++ llvm/lib/Support/Triple.cpp
@@ -225,6 +225,7 @@
case MacOSX: return "macosx";
case Mesa3D: return "mesa3d";
case Minix: return "minix";
+ case MorphOS: return "morphos";
case NVCL: return "nvcl";
case NaCl: return "nacl";
case NetBSD: return "netbsd";
@@ -587,6 +588,7 @@
.StartsWith("wasi", Triple::WASI)
.StartsWith("emscripten", Triple::Emscripten)
.StartsWith("shadermodel", Triple::ShaderModel)
+ .StartsWith("morphos", Triple::MorphOS)
.Default(Triple::UnknownOS);
}
Index: llvm/include/llvm/ADT/Triple.h
===================================================================
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -220,7 +220,8 @@
WASI, // Experimental WebAssembly OS
Emscripten,
ShaderModel, // DirectX ShaderModel
- LastOSType = ShaderModel
+ MorphOS,
+ LastOSType = MorphOS
};
enum EnvironmentType {
UnknownEnvironment,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136086.468210.patch
Type: text/x-patch
Size: 1701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221017/2ae0e556/attachment.bin>
More information about the llvm-commits
mailing list