authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-05 15:05:25+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-12-05 15:05:25+01:00
logd70be200d8a388c3fd23aa0e246322300443d58a
treee9e5491d3a161265d846adf3efd80f613d9ba8fa
parentc9d6f8b5058ba0df3bf281a3be3a3570c2219754
parent4e29c67eedb3960f6c8629ee23a9f8c7c310d699
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #22141 from alexrp/target-remove-bridgeos

`std.Target`: Remove `Os.Tag.bridgeos`

5 files changed, 6 insertions(+), 130 deletions(-)

lib/compiler/aro/aro/target.zig-1
......@@ -663,7 +663,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
663663 .driverkit => "driverkit",
664664 .visionos => "xros",
665665 .serenity => "serenity",
666 .bridgeos => "bridgeos",
667666 .opencl,
668667 .opengl,
669668 .vulkan,
lib/std/Target.zig+4-20
......@@ -38,7 +38,6 @@ pub const Os = struct {
3838 netbsd,
3939 openbsd,
4040
41 bridgeos,
4241 driverkit,
4342 ios,
4443 macos,
......@@ -69,6 +68,7 @@ pub const Os = struct {
6968 vulkan,
7069
7170 // LLVM tags deliberately omitted:
71 // - bridgeos
7272 // - darwin
7373 // - kfreebsd
7474 // - nacl
......@@ -76,7 +76,6 @@ pub const Os = struct {
7676
7777 pub inline fn isDarwin(tag: Tag) bool {
7878 return switch (tag) {
79 .bridgeos,
8079 .driverkit,
8180 .ios,
8281 .macos,
......@@ -124,7 +123,6 @@ pub const Os = struct {
124123 pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
125124 return switch (tag) {
126125 .windows, .uefi => ".dll",
127 .bridgeos,
128126 .driverkit,
129127 .ios,
130128 .macos,
......@@ -168,9 +166,6 @@ pub const Os = struct {
168166 .plan9,
169167 .serenity,
170168
171 // This should use semver once we determine the version history.
172 .bridgeos,
173
174169 .illumos,
175170
176171 .ps3,
......@@ -432,9 +427,6 @@ pub const Os = struct {
432427 .plan9,
433428 .serenity,
434429
435 // This should use semver once we determine the version history.
436 .bridgeos,
437
438430 .illumos,
439431
440432 .ps3,
......@@ -701,7 +693,6 @@ pub const Os = struct {
701693 .freebsd,
702694 .aix,
703695 .netbsd,
704 .bridgeos,
705696 .driverkit,
706697 .macos,
707698 .ios,
......@@ -927,7 +918,6 @@ pub const Abi = enum {
927918 .serenity,
928919 .zos,
929920 .dragonfly,
930 .bridgeos,
931921 .driverkit,
932922 .macos,
933923 .illumos,
......@@ -1049,7 +1039,7 @@ pub const ObjectFormat = enum {
10491039 pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {
10501040 return switch (os_tag) {
10511041 .aix => .xcoff,
1052 .bridgeos, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
1042 .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
10531043 .plan9 => .plan9,
10541044 .uefi, .windows => .coff,
10551045 .zos => .goff,
......@@ -1975,7 +1965,7 @@ pub const Cpu = struct {
19751965 .amdgcn => &amdgcn.cpu.gfx906,
19761966 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
19771967 .aarch64 => switch (os.tag) {
1978 .bridgeos, .driverkit, .macos => &aarch64.cpu.apple_m1,
1968 .driverkit, .macos => &aarch64.cpu.apple_m1,
19791969 .ios, .tvos => &aarch64.cpu.apple_a7,
19801970 .visionos => &aarch64.cpu.apple_m2,
19811971 .watchos => &aarch64.cpu.apple_s4,
......@@ -2159,7 +2149,6 @@ pub const DynamicLinker = struct {
21592149 .netbsd,
21602150 .openbsd,
21612151
2162 .bridgeos,
21632152 .driverkit,
21642153 .ios,
21652154 .macos,
......@@ -2546,7 +2535,6 @@ pub const DynamicLinker = struct {
25462535 else => none,
25472536 },
25482537
2549 .bridgeos => if (cpu.arch == .aarch64) init("/usr/lib/dyld") else none,
25502538 .driverkit,
25512539 .ios,
25522540 .macos,
......@@ -3045,7 +3033,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
30453033 },
30463034 },
30473035
3048 .bridgeos,
30493036 .driverkit,
30503037 .ios,
30513038 .macos,
......@@ -3069,10 +3056,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
30693056 },
30703057 .longlong, .ulonglong, .double => return 64,
30713058 .longdouble => switch (target.cpu.arch) {
3072 .aarch64 => switch (target.os.tag) {
3073 .bridgeos => return 128,
3074 else => return 64,
3075 },
3059 .aarch64 => return 64,
30763060 .x86 => switch (target.abi) {
30773061 .android => return 64,
30783062 else => return 80,
src/codegen/llvm.zig-99
......@@ -167,7 +167,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
167167 .aix,
168168 .zos,
169169 => "ibm",
170 .bridgeos,
171170 .driverkit,
172171 .ios,
173172 .macos,
......@@ -218,7 +217,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
218217 .hurd => "hurd",
219218 .wasi => "wasi",
220219 .emscripten => "emscripten",
221 .bridgeos => "bridgeos",
222220 .macos => "macosx",
223221 .ios => "ios",
224222 .tvos => "tvos",
......@@ -303,103 +301,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
303301 return llvm_triple.toOwnedSlice();
304302}
305303
306pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
307 return switch (os_tag) {
308 .freestanding => .UnknownOS,
309 .windows, .uefi => .Win32,
310 .dragonfly => .DragonFly,
311 .freebsd => .FreeBSD,
312 .fuchsia => .Fuchsia,
313 .ios => .IOS,
314 .linux => .Linux,
315 .ps3 => .Lv2,
316 .macos => .MacOSX,
317 .netbsd => .NetBSD,
318 .openbsd => .OpenBSD,
319 .solaris, .illumos => .Solaris,
320 .zos => .ZOS,
321 .haiku => .Haiku,
322 .rtems => .RTEMS,
323 .aix => .AIX,
324 .cuda => .CUDA,
325 .nvcl => .NVCL,
326 .amdhsa => .AMDHSA,
327 .opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples
328 .ps4 => .PS4,
329 .ps5 => .PS5,
330 .elfiamcu => .ELFIAMCU,
331 .tvos => .TvOS,
332 .watchos => .WatchOS,
333 .visionos => .XROS,
334 .mesa3d => .Mesa3D,
335 .amdpal => .AMDPAL,
336 .hermit => .HermitCore,
337 .hurd => .Hurd,
338 .wasi => .WASI,
339 .emscripten => .Emscripten,
340 .driverkit => .DriverKit,
341 .vulkan => .Vulkan,
342 .serenity => .Serenity,
343 .bridgeos => .BridgeOS,
344
345 .opengl,
346 .plan9,
347 .contiki,
348 .other,
349 => .UnknownOS,
350 };
351}
352
353pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
354 return switch (arch_tag) {
355 .arm => .arm,
356 .armeb => .armeb,
357 .aarch64 => .aarch64,
358 .aarch64_be => .aarch64_be,
359 .arc => .arc,
360 .avr => .avr,
361 .bpfel => .bpfel,
362 .bpfeb => .bpfeb,
363 .csky => .csky,
364 .hexagon => .hexagon,
365 .loongarch32 => .loongarch32,
366 .loongarch64 => .loongarch64,
367 .m68k => .m68k,
368 .mips => .mips,
369 .mipsel => .mipsel,
370 .mips64 => .mips64,
371 .mips64el => .mips64el,
372 .msp430 => .msp430,
373 .powerpc => .ppc,
374 .powerpcle => .ppcle,
375 .powerpc64 => .ppc64,
376 .powerpc64le => .ppc64le,
377 .amdgcn => .amdgcn,
378 .riscv32 => .riscv32,
379 .riscv64 => .riscv64,
380 .sparc => .sparc,
381 .sparc64 => .sparcv9, // In LLVM, sparc64 == sparcv9.
382 .s390x => .systemz,
383 .thumb => .thumb,
384 .thumbeb => .thumbeb,
385 .x86 => .x86,
386 .x86_64 => .x86_64,
387 .xcore => .xcore,
388 .xtensa => .xtensa,
389 .nvptx => .nvptx,
390 .nvptx64 => .nvptx64,
391 .spirv => .spirv,
392 .spirv32 => .spirv32,
393 .spirv64 => .spirv64,
394 .kalimba => .kalimba,
395 .lanai => .lanai,
396 .wasm32 => .wasm32,
397 .wasm64 => .wasm64,
398 .ve => .ve,
399 .propeller1, .propeller2, .spu_2 => .UnknownArch,
400 };
401}
402
403304pub fn supportsTailCall(target: std.Target) bool {
404305 switch (target.cpu.arch) {
405306 .wasm32, .wasm64 => return std.Target.wasm.featureSetHas(target.cpu.features, .tail_call),
src/link/MachO.zig+2-9
......@@ -3539,7 +3539,7 @@ pub fn requiresCodeSig(self: MachO) bool {
35393539 const target = self.getTarget();
35403540 return switch (target.cpu.arch) {
35413541 .aarch64 => switch (target.os.tag) {
3542 .bridgeos, .driverkit, .macos => true,
3542 .driverkit, .macos => true,
35433543 .ios, .tvos, .visionos, .watchos => target.abi == .simulator,
35443544 else => false,
35453545 },
......@@ -4143,7 +4143,6 @@ pub const Platform = struct {
41434143 const cmd = lc.cast(macho.build_version_command).?;
41444144 return .{
41454145 .os_tag = switch (cmd.platform) {
4146 .BRIDGEOS => .bridgeos,
41474146 .DRIVERKIT => .driverkit,
41484147 .IOS, .IOSSIMULATOR => .ios,
41494148 .MACCATALYST => .ios,
......@@ -4191,11 +4190,7 @@ pub const Platform = struct {
41914190 return .{
41924191 .os_tag = target.os.tag,
41934192 .abi = target.abi,
4194 // This should use semver once we determine the version history.
4195 .version = if (target.os.tag == .bridgeos)
4196 .{ .major = 0, .minor = 0, .patch = 0 }
4197 else
4198 target.os.version_range.semver.min,
4193 .version = target.os.version_range.semver.min,
41994194 };
42004195 }
42014196
......@@ -4205,7 +4200,6 @@ pub const Platform = struct {
42054200
42064201 pub fn toApplePlatform(plat: Platform) macho.PLATFORM {
42074202 return switch (plat.os_tag) {
4208 .bridgeos => .BRIDGEOS,
42094203 .driverkit => .DRIVERKIT,
42104204 .ios => switch (plat.abi) {
42114205 .macabi => .MACCATALYST,
......@@ -4284,7 +4278,6 @@ const SupportedPlatforms = struct {
42844278// Source: https://github.com/apple-oss-distributions/ld64/blob/59a99ab60399c5e6c49e6945a9e1049c42b71135/src/ld/PlatformSupport.cpp#L52
42854279// zig fmt: off
42864280const supported_platforms = [_]SupportedPlatforms{
4287 .{ .bridgeos, .none, 0x010000, 0x010000 },
42884281 .{ .driverkit, .none, 0x130000, 0x130000 },
42894282 .{ .ios, .none, 0x0C0000, 0x070000 },
42904283 .{ .ios, .macabi, 0x0D0000, 0x0D0000 },
test/llvm_targets.zig-1
......@@ -2,7 +2,6 @@ const std = @import("std");
22const Cases = @import("src/Cases.zig");
33
44const targets = [_]std.Target.Query{
5 .{ .cpu_arch = .aarch64, .os_tag = .bridgeos, .abi = .none },
65 .{ .cpu_arch = .aarch64, .os_tag = .driverkit, .abi = .none },
76 .{ .cpu_arch = .aarch64, .os_tag = .freebsd, .abi = .none },
87 .{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .none },