Commit ce912e2964

Andrew Kelley <superjoe30@gmail.com>
2018-09-19 23:52:37
add HermitCore target
1 parent a4d61b5
Changed files (3)
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();
src/target.hpp
@@ -50,6 +50,7 @@ enum Os {
     OsMesa3D,
     OsContiki,
     OsAMDPAL,
+    OsHermitCore,
     OsZen,
 };
 
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