llvm: Remove dead targetArch() and targetOs() functions.

These were leftovers from when we used the LLVM API to create modules.
This commit is contained in:
Alex Rønne Petersen 2024-12-03 20:09:38 +01:00
parent 09b39f77b7
commit 4e29c67eed
No known key found for this signature in database

View File

@ -301,102 +301,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
return llvm_triple.toOwnedSlice();
}
pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
return switch (os_tag) {
.freestanding => .UnknownOS,
.windows, .uefi => .Win32,
.dragonfly => .DragonFly,
.freebsd => .FreeBSD,
.fuchsia => .Fuchsia,
.ios => .IOS,
.linux => .Linux,
.ps3 => .Lv2,
.macos => .MacOSX,
.netbsd => .NetBSD,
.openbsd => .OpenBSD,
.solaris, .illumos => .Solaris,
.zos => .ZOS,
.haiku => .Haiku,
.rtems => .RTEMS,
.aix => .AIX,
.cuda => .CUDA,
.nvcl => .NVCL,
.amdhsa => .AMDHSA,
.opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples
.ps4 => .PS4,
.ps5 => .PS5,
.elfiamcu => .ELFIAMCU,
.tvos => .TvOS,
.watchos => .WatchOS,
.visionos => .XROS,
.mesa3d => .Mesa3D,
.amdpal => .AMDPAL,
.hermit => .HermitCore,
.hurd => .Hurd,
.wasi => .WASI,
.emscripten => .Emscripten,
.driverkit => .DriverKit,
.vulkan => .Vulkan,
.serenity => .Serenity,
.opengl,
.plan9,
.contiki,
.other,
=> .UnknownOS,
};
}
pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
return switch (arch_tag) {
.arm => .arm,
.armeb => .armeb,
.aarch64 => .aarch64,
.aarch64_be => .aarch64_be,
.arc => .arc,
.avr => .avr,
.bpfel => .bpfel,
.bpfeb => .bpfeb,
.csky => .csky,
.hexagon => .hexagon,
.loongarch32 => .loongarch32,
.loongarch64 => .loongarch64,
.m68k => .m68k,
.mips => .mips,
.mipsel => .mipsel,
.mips64 => .mips64,
.mips64el => .mips64el,
.msp430 => .msp430,
.powerpc => .ppc,
.powerpcle => .ppcle,
.powerpc64 => .ppc64,
.powerpc64le => .ppc64le,
.amdgcn => .amdgcn,
.riscv32 => .riscv32,
.riscv64 => .riscv64,
.sparc => .sparc,
.sparc64 => .sparcv9, // In LLVM, sparc64 == sparcv9.
.s390x => .systemz,
.thumb => .thumb,
.thumbeb => .thumbeb,
.x86 => .x86,
.x86_64 => .x86_64,
.xcore => .xcore,
.xtensa => .xtensa,
.nvptx => .nvptx,
.nvptx64 => .nvptx64,
.spirv => .spirv,
.spirv32 => .spirv32,
.spirv64 => .spirv64,
.kalimba => .kalimba,
.lanai => .lanai,
.wasm32 => .wasm32,
.wasm64 => .wasm64,
.ve => .ve,
.propeller1, .propeller2, .spu_2 => .UnknownArch,
};
}
pub fn supportsTailCall(target: std.Target) bool {
switch (target.cpu.arch) {
.wasm32, .wasm64 => return std.Target.wasm.featureSetHas(target.cpu.features, .tail_call),