| ... | ... | @@ -301,102 +301,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { |
| 301 | 301 | return llvm_triple.toOwnedSlice(); |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | | pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType { |
| 305 | | return switch (os_tag) { |
| 306 | | .freestanding => .UnknownOS, |
| 307 | | .windows, .uefi => .Win32, |
| 308 | | .dragonfly => .DragonFly, |
| 309 | | .freebsd => .FreeBSD, |
| 310 | | .fuchsia => .Fuchsia, |
| 311 | | .ios => .IOS, |
| 312 | | .linux => .Linux, |
| 313 | | .ps3 => .Lv2, |
| 314 | | .macos => .MacOSX, |
| 315 | | .netbsd => .NetBSD, |
| 316 | | .openbsd => .OpenBSD, |
| 317 | | .solaris, .illumos => .Solaris, |
| 318 | | .zos => .ZOS, |
| 319 | | .haiku => .Haiku, |
| 320 | | .rtems => .RTEMS, |
| 321 | | .aix => .AIX, |
| 322 | | .cuda => .CUDA, |
| 323 | | .nvcl => .NVCL, |
| 324 | | .amdhsa => .AMDHSA, |
| 325 | | .opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples |
| 326 | | .ps4 => .PS4, |
| 327 | | .ps5 => .PS5, |
| 328 | | .elfiamcu => .ELFIAMCU, |
| 329 | | .tvos => .TvOS, |
| 330 | | .watchos => .WatchOS, |
| 331 | | .visionos => .XROS, |
| 332 | | .mesa3d => .Mesa3D, |
| 333 | | .amdpal => .AMDPAL, |
| 334 | | .hermit => .HermitCore, |
| 335 | | .hurd => .Hurd, |
| 336 | | .wasi => .WASI, |
| 337 | | .emscripten => .Emscripten, |
| 338 | | .driverkit => .DriverKit, |
| 339 | | .vulkan => .Vulkan, |
| 340 | | .serenity => .Serenity, |
| 341 | | |
| 342 | | .opengl, |
| 343 | | .plan9, |
| 344 | | .contiki, |
| 345 | | .other, |
| 346 | | => .UnknownOS, |
| 347 | | }; |
| 348 | | } |
| 349 | | |
| 350 | | pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType { |
| 351 | | return switch (arch_tag) { |
| 352 | | .arm => .arm, |
| 353 | | .armeb => .armeb, |
| 354 | | .aarch64 => .aarch64, |
| 355 | | .aarch64_be => .aarch64_be, |
| 356 | | .arc => .arc, |
| 357 | | .avr => .avr, |
| 358 | | .bpfel => .bpfel, |
| 359 | | .bpfeb => .bpfeb, |
| 360 | | .csky => .csky, |
| 361 | | .hexagon => .hexagon, |
| 362 | | .loongarch32 => .loongarch32, |
| 363 | | .loongarch64 => .loongarch64, |
| 364 | | .m68k => .m68k, |
| 365 | | .mips => .mips, |
| 366 | | .mipsel => .mipsel, |
| 367 | | .mips64 => .mips64, |
| 368 | | .mips64el => .mips64el, |
| 369 | | .msp430 => .msp430, |
| 370 | | .powerpc => .ppc, |
| 371 | | .powerpcle => .ppcle, |
| 372 | | .powerpc64 => .ppc64, |
| 373 | | .powerpc64le => .ppc64le, |
| 374 | | .amdgcn => .amdgcn, |
| 375 | | .riscv32 => .riscv32, |
| 376 | | .riscv64 => .riscv64, |
| 377 | | .sparc => .sparc, |
| 378 | | .sparc64 => .sparcv9, // In LLVM, sparc64 == sparcv9. |
| 379 | | .s390x => .systemz, |
| 380 | | .thumb => .thumb, |
| 381 | | .thumbeb => .thumbeb, |
| 382 | | .x86 => .x86, |
| 383 | | .x86_64 => .x86_64, |
| 384 | | .xcore => .xcore, |
| 385 | | .xtensa => .xtensa, |
| 386 | | .nvptx => .nvptx, |
| 387 | | .nvptx64 => .nvptx64, |
| 388 | | .spirv => .spirv, |
| 389 | | .spirv32 => .spirv32, |
| 390 | | .spirv64 => .spirv64, |
| 391 | | .kalimba => .kalimba, |
| 392 | | .lanai => .lanai, |
| 393 | | .wasm32 => .wasm32, |
| 394 | | .wasm64 => .wasm64, |
| 395 | | .ve => .ve, |
| 396 | | .propeller1, .propeller2, .spu_2 => .UnknownArch, |
| 397 | | }; |
| 398 | | } |
| 399 | | |
| 400 | 304 | pub fn supportsTailCall(target: std.Target) bool { |
| 401 | 305 | switch (target.cpu.arch) { |
| 402 | 306 | .wasm32, .wasm64 => return std.Target.wasm.featureSetHas(target.cpu.features, .tail_call), |