aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-08-12 09:02:46 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-08-12 09:03:08 +0200
commit9f1fb45201e59945acc7e48fc394bba4064d52f5 (patch)
tree800ed9eb2de2c731cca7b733cf2697cd2fefc04d /src/codegen
parent8af4d651088abba258c40cefdf8f9140cf1d8b57 (diff)
downloadzig-9f1fb45201e59945acc7e48fc394bba4064d52f5.tar.gz
zig-9f1fb45201e59945acc7e48fc394bba4064d52f5.zip
llvm: Move some OS selection prongs for clarity.
This makes it clearer which OSs are not known to or supported by LLVM at all vs the ones where we're intentionally passing choosing "unknown".
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index be8293db22..4e455467c4 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -110,7 +110,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.netbsd => "netbsd",
.openbsd => "openbsd",
.solaris, .illumos => "solaris",
- .windows => "windows",
+ .windows, .uefi => "windows",
.zos => "zos",
.haiku => "haiku",
.rtems => "rtems",
@@ -128,7 +128,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.hurd => "hurd",
.wasi => "wasi",
.emscripten => "emscripten",
- .uefi => "windows",
.macos => "macosx",
.ios => "ios",
.tvos => "tvos",
@@ -205,14 +204,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
return switch (os_tag) {
- .freestanding,
- .other,
- .opencl,
- .opengl,
- .plan9,
- .contiki,
- => .UnknownOS,
-
+ .freestanding => .UnknownOS,
.windows, .uefi => .Win32,
.dragonfly => .DragonFly,
.freebsd => .FreeBSD,
@@ -231,6 +223,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
.cuda => .CUDA,
.nvcl => .NVCL,
.amdhsa => .AMDHSA,
+ .opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples
.ps4 => .PS4,
.ps5 => .PS5,
.elfiamcu => .ELFIAMCU,
@@ -247,6 +240,12 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
.shadermodel => .ShaderModel,
.vulkan => .Vulkan,
.serenity => .Serenity,
+
+ .opengl,
+ .plan9,
+ .contiki,
+ .other,
+ => .UnknownOS,
};
}