From ce912e29640e0a3b39a5c304c86bdbb5fff67169 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 19 Sep 2018 17:52:37 -0400 Subject: [PATCH] add HermitCore target --- src/target.cpp | 7 +++++++ src/target.hpp | 1 + src/zig_llvm.h | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/target.cpp b/src/target.cpp index 5cc5f789fbf1adaa8bba1fa2086ff950f80aa1a6..fcb7ce862f4cd569b5eb660f09ffeb6401267600 100644 --- a/src/target.cpp +++ b/src/target.cpp @@ -159,6 +159,7 @@ static const Os os_list[] = { OsMesa3D, OsContiki, OsAMDPAL, + OsHermitCore, OsZen, }; @@ -301,6 +302,8 @@ static ZigLLVM_OSType get_llvm_os_type(Os os_type) { return ZigLLVM_Contiki; case OsAMDPAL: return ZigLLVM_AMDPAL; + case OsHermitCore: + return ZigLLVM_HermitCore; } zig_unreachable(); } @@ -370,6 +373,8 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) { return OsContiki; case ZigLLVM_AMDPAL: return OsAMDPAL; + case ZigLLVM_HermitCore: + return OsHermitCore; } zig_unreachable(); } @@ -410,6 +415,7 @@ const char *get_target_os_name(Os os_type) { case OsMesa3D: case OsContiki: case OsAMDPAL: + case OsHermitCore: return ZigLLVMGetOSTypeName(get_llvm_os_type(os_type)); } zig_unreachable(); @@ -783,6 +789,7 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) { case OsFuchsia: case OsContiki: case OsAMDPAL: + case OsHermitCore: zig_panic("TODO c type size in bits for this target"); } zig_unreachable(); diff --git a/src/target.hpp b/src/target.hpp index 0e0b1f2dc50e8589ea19cf594e7b0b62db2bc726..453bc99fb3128c20e6a639e31183132af4378297 100644 --- a/src/target.hpp +++ b/src/target.hpp @@ -50,6 +50,7 @@ enum Os { OsMesa3D, OsContiki, OsAMDPAL, + OsHermitCore, OsZen, }; diff --git a/src/zig_llvm.h b/src/zig_llvm.h index a005b3157e144b3f342d507a27de3898f0ab5fb7..5069ed9e245cc506a61be0cd6223016f5f7a7671 100644 --- a/src/zig_llvm.h +++ b/src/zig_llvm.h @@ -357,8 +357,9 @@ enum ZigLLVM_OSType { ZigLLVM_Mesa3D, ZigLLVM_Contiki, ZigLLVM_AMDPAL, // AMD PAL Runtime + ZigLLVM_HermitCore, // HermitCore Unikernel/Multikernel - ZigLLVM_LastOSType = ZigLLVM_AMDPAL + ZigLLVM_LastOSType = ZigLLVM_HermitCore }; // Synchronize with target.cpp::environ_list -- 2.54.0