authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-13 20:39:40-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-06-13 20:39:40-04:00
log86ebd4b975d2f1e01f468e06daab6e28c06f9719
tree250bfe03e0768bdf7619fa8bb588b6815e1d3f0d
parentdf4f11f42f44b4ee2a06e43095bc160277ceed42
parente63ff4f1c110165c4b92025cb5b9d5531e861643
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #9106 from Vexu/fmt

Add formatting check to CI pipeline

33 files changed, 859 insertions(+), 576 deletions(-)

ci/azure/linux_script+3
...@@ -59,6 +59,9 @@ unset CXX...@@ -59,6 +59,9 @@ unset CXX
5959
60make $JOBS install60make $JOBS install
6161
62# look for formatting errors
63release/bin/zig fmt --check --ast-check .. || (echo "Please run 'zig fmt' to fix the non-conforming files listed above." && false)
64
62# Here we rebuild zig but this time using the Zig binary we just now produced to65# Here we rebuild zig but this time using the Zig binary we just now produced to
63# build zig1.o rather than relying on the one built with stage0. See66# build zig1.o rather than relying on the one built with stage0. See
64# https://github.com/ziglang/zig/issues/6830 for more details.67# https://github.com/ziglang/zig/issues/6830 for more details.
lib/std/Thread/Futex.zig+8-8
...@@ -84,7 +84,7 @@ else...@@ -84,7 +84,7 @@ else
8484
85const WindowsFutex = struct {85const WindowsFutex = struct {
86 const windows = std.os.windows;86 const windows = std.os.windows;
87 87
88 fn wait(ptr: *const Atomic(u32), expect: u32, timeout: ?u64) error{TimedOut}!void {88 fn wait(ptr: *const Atomic(u32), expect: u32, timeout: ?u64) error{TimedOut}!void {
89 var timeout_value: windows.LARGE_INTEGER = undefined;89 var timeout_value: windows.LARGE_INTEGER = undefined;
90 var timeout_ptr: ?*const windows.LARGE_INTEGER = null;90 var timeout_ptr: ?*const windows.LARGE_INTEGER = null;
...@@ -299,7 +299,7 @@ const PosixFutex = struct {...@@ -299,7 +299,7 @@ const PosixFutex = struct {
299 state: State = .empty,299 state: State = .empty,
300 cond: std.c.pthread_cond_t = .{},300 cond: std.c.pthread_cond_t = .{},
301 mutex: std.c.pthread_mutex_t = .{},301 mutex: std.c.pthread_mutex_t = .{},
302 302
303 const Self = @This();303 const Self = @This();
304 const State = enum {304 const State = enum {
305 empty,305 empty,
...@@ -381,7 +381,7 @@ test "Futex - wait/wake" {...@@ -381,7 +381,7 @@ test "Futex - wait/wake" {
381381
382 const wait_noop_result = Futex.wait(&value, 0, 0);382 const wait_noop_result = Futex.wait(&value, 0, 0);
383 try testing.expectError(error.TimedOut, wait_noop_result);383 try testing.expectError(error.TimedOut, wait_noop_result);
384 384
385 const wait_longer_result = Futex.wait(&value, 0, std.time.ns_per_ms);385 const wait_longer_result = Futex.wait(&value, 0, std.time.ns_per_ms);
386 try testing.expectError(error.TimedOut, wait_longer_result);386 try testing.expectError(error.TimedOut, wait_longer_result);
387387
...@@ -416,7 +416,7 @@ test "Futex - Signal" {...@@ -416,7 +416,7 @@ test "Futex - Signal" {
416 const Thread = struct {416 const Thread = struct {
417 tx: *Self,417 tx: *Self,
418 rx: *Self,418 rx: *Self,
419 419
420 const start_value = 1;420 const start_value = 1;
421421
422 fn run(self: Thread) void {422 fn run(self: Thread) void {
...@@ -472,7 +472,7 @@ test "Futex - Broadcast" {...@@ -472,7 +472,7 @@ test "Futex - Broadcast" {
472 self.broadcast.store(BROADCAST_RECEIVED, .Release);472 self.broadcast.store(BROADCAST_RECEIVED, .Release);
473 Futex.wake(&self.broadcast, 1);473 Futex.wake(&self.broadcast, 1);
474 }474 }
475 } 475 }
476476
477 fn run() !void {477 fn run() !void {
478 var self = Self{};478 var self = Self{};
...@@ -542,7 +542,7 @@ test "Futex - Chain" {...@@ -542,7 +542,7 @@ test "Futex - Chain" {
542 if (chain.index + 1 < chain.self.threads.len) {542 if (chain.index + 1 < chain.self.threads.len) {
543 next_signal = &chain.self.threads[chain.index + 1].signal;543 next_signal = &chain.self.threads[chain.index + 1].signal;
544 }544 }
545 545
546 this_signal.wait();546 this_signal.wait();
547 next_signal.notify();547 next_signal.notify();
548 }548 }
...@@ -554,7 +554,7 @@ test "Futex - Chain" {...@@ -554,7 +554,7 @@ test "Futex - Chain" {
554 for (self.threads) |*entry, index| {554 for (self.threads) |*entry, index| {
555 entry.signal = .{};555 entry.signal = .{};
556 entry.thread = try std.Thread.spawn(Chain.run, .{556 entry.thread = try std.Thread.spawn(Chain.run, .{
557 .self = &self, 557 .self = &self,
558 .index = index,558 .index = index,
559 });559 });
560 }560 }
...@@ -567,4 +567,4 @@ test "Futex - Chain" {...@@ -567,4 +567,4 @@ test "Futex - Chain" {
567 }567 }
568 }568 }
569 }).run();569 }).run();
570}
\ No newline at end of file
570}
lib/std/c/darwin.zig+2-2
...@@ -246,7 +246,7 @@ pub const ULF_WAIT_ADAPTIVE_SPIN = 0x40000;...@@ -246,7 +246,7 @@ pub const ULF_WAIT_ADAPTIVE_SPIN = 0x40000;
246246
247pub extern "c" fn __ulock_wait2(op: u32, addr: ?*const c_void, val: u64, timeout_us: u32, val2: u64) c_int;247pub extern "c" fn __ulock_wait2(op: u32, addr: ?*const c_void, val: u64, timeout_us: u32, val2: u64) c_int;
248pub extern "c" fn __ulock_wait(op: u32, addr: ?*const c_void, val: u64, timeout_us: u32) c_int;248pub extern "c" fn __ulock_wait(op: u32, addr: ?*const c_void, val: u64, timeout_us: u32) c_int;
249pub extern "c" fn __ulock_wake(op: u32, addr: ?*const c_void, val: u64) c_int; 249pub extern "c" fn __ulock_wake(op: u32, addr: ?*const c_void, val: u64) c_int;
250250
251pub const OS_UNFAIR_LOCK_INIT = os_unfair_lock{};251pub const OS_UNFAIR_LOCK_INIT = os_unfair_lock{};
252pub const os_unfair_lock_t = *os_unfair_lock;252pub const os_unfair_lock_t = *os_unfair_lock;
...@@ -258,4 +258,4 @@ pub extern "c" fn os_unfair_lock_lock(o: os_unfair_lock_t) void;...@@ -258,4 +258,4 @@ pub extern "c" fn os_unfair_lock_lock(o: os_unfair_lock_t) void;
258pub extern "c" fn os_unfair_lock_unlock(o: os_unfair_lock_t) void;258pub extern "c" fn os_unfair_lock_unlock(o: os_unfair_lock_t) void;
259pub extern "c" fn os_unfair_lock_trylock(o: os_unfair_lock_t) bool;259pub extern "c" fn os_unfair_lock_trylock(o: os_unfair_lock_t) bool;
260pub extern "c" fn os_unfair_lock_assert_owner(o: os_unfair_lock_t) void;260pub extern "c" fn os_unfair_lock_assert_owner(o: os_unfair_lock_t) void;
261pub extern "c" fn os_unfair_lock_assert_not_owner(o: os_unfair_lock_t) void;
\ No newline at end of file
261pub extern "c" fn os_unfair_lock_assert_not_owner(o: os_unfair_lock_t) void;
lib/std/fmt/parse_float.zig+14-1
...@@ -34,7 +34,7 @@...@@ -34,7 +34,7 @@
34// - Only supports round-to-zero34// - Only supports round-to-zero
35// - Does not handle denormals35// - Does not handle denormals
3636
37const std = @import("../std.zig");37const std = @import("std");
38const ascii = std.ascii;38const ascii = std.ascii;
3939
40// The mantissa field in FloatRepr is 64bit wide and holds only 19 digits40// The mantissa field in FloatRepr is 64bit wide and holds only 19 digits
...@@ -231,6 +231,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {...@@ -231,6 +231,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
231 } else if (c == '.') {231 } else if (c == '.') {
232 i += 1;232 i += 1;
233 state = .LeadingFractionalZeros;233 state = .LeadingFractionalZeros;
234 } else if (c == '_') {
235 i += 1;
234 } else {236 } else {
235 state = .MantissaIntegral;237 state = .MantissaIntegral;
236 }238 }
...@@ -259,6 +261,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {...@@ -259,6 +261,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
259 } else if (c == '.') {261 } else if (c == '.') {
260 i += 1;262 i += 1;
261 state = .MantissaFractional;263 state = .MantissaFractional;
264 } else if (c == '_') {
265 i += 1;
262 } else {266 } else {
263 state = .MantissaFractional;267 state = .MantissaFractional;
264 }268 }
...@@ -276,6 +280,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {...@@ -276,6 +280,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
276 } else if (c == 'e' or c == 'E') {280 } else if (c == 'e' or c == 'E') {
277 i += 1;281 i += 1;
278 state = .ExponentSign;282 state = .ExponentSign;
283 } else if (c == '_') {
284 i += 1;
279 } else {285 } else {
280 state = .ExponentSign;286 state = .ExponentSign;
281 }287 }
...@@ -283,6 +289,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {...@@ -283,6 +289,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
283 .ExponentSign => {289 .ExponentSign => {
284 if (c == '+') {290 if (c == '+') {
285 i += 1;291 i += 1;
292 } else if (c == '_') {
293 return error.InvalidCharacter;
286 } else if (c == '-') {294 } else if (c == '-') {
287 negative_exp = true;295 negative_exp = true;
288 i += 1;296 i += 1;
...@@ -293,6 +301,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {...@@ -293,6 +301,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
293 .LeadingExponentZeros => {301 .LeadingExponentZeros => {
294 if (c == '0') {302 if (c == '0') {
295 i += 1;303 i += 1;
304 } else if (c == '_') {
305 i += 1;
296 } else {306 } else {
297 state = .Exponent;307 state = .Exponent;
298 }308 }
...@@ -304,6 +314,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {...@@ -304,6 +314,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
304 exponent += @intCast(i32, c - '0');314 exponent += @intCast(i32, c - '0');
305 }315 }
306316
317 i += 1;
318 } else if (c == '_') {
307 i += 1;319 i += 1;
308 } else {320 } else {
309 return error.InvalidCharacter;321 return error.InvalidCharacter;
...@@ -405,6 +417,7 @@ test "fmt.parseFloat" {...@@ -405,6 +417,7 @@ test "fmt.parseFloat" {
405 try expectEqual(try parseFloat(T, "-INF"), -std.math.inf(T));417 try expectEqual(try parseFloat(T, "-INF"), -std.math.inf(T));
406418
407 try expectEqual(try parseFloat(T, "0.4e0066999999999999999999999999999999999999999999999999999"), std.math.inf(T));419 try expectEqual(try parseFloat(T, "0.4e0066999999999999999999999999999999999999999999999999999"), std.math.inf(T));
420 try expect(approxEqAbs(T, try parseFloat(T, "0_1_2_3_4_5_6.7_8_9_0_0_0e0_0_1_0"), @as(T, 123456.789000e10), epsilon));
408421
409 if (T != f16) {422 if (T != f16) {
410 try expect(approxEqAbs(T, try parseFloat(T, "1e-2"), 0.01, epsilon));423 try expect(approxEqAbs(T, try parseFloat(T, "1e-2"), 0.01, epsilon));
lib/std/special/compiler_rt.zig+523-308
...@@ -20,10 +20,13 @@ comptime {...@@ -20,10 +20,13 @@ comptime {
20 switch (arch) {20 switch (arch) {
21 .i386,21 .i386,
22 .x86_64,22 .x86_64,
23 => @export(@import("compiler_rt/stack_probe.zig").zig_probe_stack, .{23 => {
24 .name = "__zig_probe_stack",24 const zig_probe_stack = @import("compiler_rt/stack_probe.zig").zig_probe_stack;
25 .linkage = linkage,25 @export(zig_probe_stack, .{
26 }),26 .name = "__zig_probe_stack",
27 .linkage = linkage,
28 });
29 },
2730
28 else => {},31 else => {},
29 }32 }
...@@ -31,355 +34,567 @@ comptime {...@@ -31,355 +34,567 @@ comptime {
31 // __clear_cache manages its own logic about whether to be exported or not.34 // __clear_cache manages its own logic about whether to be exported or not.
32 _ = @import("compiler_rt/clear_cache.zig").clear_cache;35 _ = @import("compiler_rt/clear_cache.zig").clear_cache;
3336
34 @export(@import("compiler_rt/compareXf2.zig").__lesf2, .{ .name = "__lesf2", .linkage = linkage });37 const __lesf2 = @import("compiler_rt/compareXf2.zig").__lesf2;
35 @export(@import("compiler_rt/compareXf2.zig").__ledf2, .{ .name = "__ledf2", .linkage = linkage });38 @export(__lesf2, .{ .name = "__lesf2", .linkage = linkage });
36 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__letf2", .linkage = linkage });39 const __ledf2 = @import("compiler_rt/compareXf2.zig").__ledf2;
40 @export(__ledf2, .{ .name = "__ledf2", .linkage = linkage });
41 const __letf2 = @import("compiler_rt/compareXf2.zig").__letf2;
42 @export(__letf2, .{ .name = "__letf2", .linkage = linkage });
3743
38 @export(@import("compiler_rt/compareXf2.zig").__gesf2, .{ .name = "__gesf2", .linkage = linkage });44 const __gesf2 = @import("compiler_rt/compareXf2.zig").__gesf2;
39 @export(@import("compiler_rt/compareXf2.zig").__gedf2, .{ .name = "__gedf2", .linkage = linkage });45 @export(__gesf2, .{ .name = "__gesf2", .linkage = linkage });
40 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__getf2", .linkage = linkage });46 const __gedf2 = @import("compiler_rt/compareXf2.zig").__gedf2;
47 @export(__gedf2, .{ .name = "__gedf2", .linkage = linkage });
48 const __getf2 = @import("compiler_rt/compareXf2.zig").__getf2;
49 @export(__getf2, .{ .name = "__getf2", .linkage = linkage });
4150
42 if (!is_test) {51 if (!is_test) {
43 @export(@import("compiler_rt/compareXf2.zig").__lesf2, .{ .name = "__cmpsf2", .linkage = linkage });52 @export(__lesf2, .{ .name = "__cmpsf2", .linkage = linkage });
44 @export(@import("compiler_rt/compareXf2.zig").__ledf2, .{ .name = "__cmpdf2", .linkage = linkage });53 @export(__ledf2, .{ .name = "__cmpdf2", .linkage = linkage });
45 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__cmptf2", .linkage = linkage });54 @export(__letf2, .{ .name = "__cmptf2", .linkage = linkage });
4655
47 @export(@import("compiler_rt/compareXf2.zig").__eqsf2, .{ .name = "__eqsf2", .linkage = linkage });56 const __eqsf2 = @import("compiler_rt/compareXf2.zig").__eqsf2;
48 @export(@import("compiler_rt/compareXf2.zig").__eqdf2, .{ .name = "__eqdf2", .linkage = linkage });57 @export(__eqsf2, .{ .name = "__eqsf2", .linkage = linkage });
49 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__eqtf2", .linkage = linkage });58 const __eqdf2 = @import("compiler_rt/compareXf2.zig").__eqdf2;
5059 @export(__eqdf2, .{ .name = "__eqdf2", .linkage = linkage });
51 @export(@import("compiler_rt/compareXf2.zig").__ltsf2, .{ .name = "__ltsf2", .linkage = linkage });60 @export(__letf2, .{ .name = "__eqtf2", .linkage = linkage });
52 @export(@import("compiler_rt/compareXf2.zig").__ltdf2, .{ .name = "__ltdf2", .linkage = linkage });61
53 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__lttf2", .linkage = linkage });62 const __ltsf2 = @import("compiler_rt/compareXf2.zig").__ltsf2;
5463 @export(__ltsf2, .{ .name = "__ltsf2", .linkage = linkage });
55 @export(@import("compiler_rt/compareXf2.zig").__nesf2, .{ .name = "__nesf2", .linkage = linkage });64 const __ltdf2 = @import("compiler_rt/compareXf2.zig").__ltdf2;
56 @export(@import("compiler_rt/compareXf2.zig").__nedf2, .{ .name = "__nedf2", .linkage = linkage });65 @export(__ltdf2, .{ .name = "__ltdf2", .linkage = linkage });
57 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__netf2", .linkage = linkage });66 @export(__letf2, .{ .name = "__lttf2", .linkage = linkage });
5867
59 @export(@import("compiler_rt/compareXf2.zig").__gtsf2, .{ .name = "__gtsf2", .linkage = linkage });68 const __nesf2 = @import("compiler_rt/compareXf2.zig").__nesf2;
60 @export(@import("compiler_rt/compareXf2.zig").__gtdf2, .{ .name = "__gtdf2", .linkage = linkage });69 @export(__nesf2, .{ .name = "__nesf2", .linkage = linkage });
61 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__gttf2", .linkage = linkage });70 const __nedf2 = @import("compiler_rt/compareXf2.zig").__nedf2;
6271 @export(__nedf2, .{ .name = "__nedf2", .linkage = linkage });
63 @export(@import("compiler_rt/extendXfYf2.zig").__extendhfsf2, .{ .name = "__gnu_h2f_ieee", .linkage = linkage });72 @export(__letf2, .{ .name = "__netf2", .linkage = linkage });
64 @export(@import("compiler_rt/truncXfYf2.zig").__truncsfhf2, .{ .name = "__gnu_f2h_ieee", .linkage = linkage });73
74 const __gtsf2 = @import("compiler_rt/compareXf2.zig").__gtsf2;
75 @export(__gtsf2, .{ .name = "__gtsf2", .linkage = linkage });
76 const __gtdf2 = @import("compiler_rt/compareXf2.zig").__gtdf2;
77 @export(__gtdf2, .{ .name = "__gtdf2", .linkage = linkage });
78 @export(__getf2, .{ .name = "__gttf2", .linkage = linkage });
79
80 const __extendhfsf2 = @import("compiler_rt/extendXfYf2.zig").__extendhfsf2;
81 @export(__extendhfsf2, .{ .name = "__gnu_h2f_ieee", .linkage = linkage });
82 const __truncsfhf2 = @import("compiler_rt/truncXfYf2.zig").__truncsfhf2;
83 @export(__truncsfhf2, .{ .name = "__gnu_f2h_ieee", .linkage = linkage });
65 }84 }
6685
67 @export(@import("compiler_rt/compareXf2.zig").__unordsf2, .{ .name = "__unordsf2", .linkage = linkage });86 const __unordsf2 = @import("compiler_rt/compareXf2.zig").__unordsf2;
68 @export(@import("compiler_rt/compareXf2.zig").__unorddf2, .{ .name = "__unorddf2", .linkage = linkage });87 @export(__unordsf2, .{ .name = "__unordsf2", .linkage = linkage });
69 @export(@import("compiler_rt/compareXf2.zig").__unordtf2, .{ .name = "__unordtf2", .linkage = linkage });88 const __unorddf2 = @import("compiler_rt/compareXf2.zig").__unorddf2;
7089 @export(__unorddf2, .{ .name = "__unorddf2", .linkage = linkage });
71 @export(@import("compiler_rt/addXf3.zig").__addsf3, .{ .name = "__addsf3", .linkage = linkage });90 const __unordtf2 = @import("compiler_rt/compareXf2.zig").__unordtf2;
72 @export(@import("compiler_rt/addXf3.zig").__adddf3, .{ .name = "__adddf3", .linkage = linkage });91 @export(__unordtf2, .{ .name = "__unordtf2", .linkage = linkage });
73 @export(@import("compiler_rt/addXf3.zig").__addtf3, .{ .name = "__addtf3", .linkage = linkage });92
74 @export(@import("compiler_rt/addXf3.zig").__subsf3, .{ .name = "__subsf3", .linkage = linkage });93 const __addsf3 = @import("compiler_rt/addXf3.zig").__addsf3;
75 @export(@import("compiler_rt/addXf3.zig").__subdf3, .{ .name = "__subdf3", .linkage = linkage });94 @export(__addsf3, .{ .name = "__addsf3", .linkage = linkage });
76 @export(@import("compiler_rt/addXf3.zig").__subtf3, .{ .name = "__subtf3", .linkage = linkage });95 const __adddf3 = @import("compiler_rt/addXf3.zig").__adddf3;
7796 @export(__adddf3, .{ .name = "__adddf3", .linkage = linkage });
78 @export(@import("compiler_rt/mulXf3.zig").__mulsf3, .{ .name = "__mulsf3", .linkage = linkage });97 const __addtf3 = @import("compiler_rt/addXf3.zig").__addtf3;
79 @export(@import("compiler_rt/mulXf3.zig").__muldf3, .{ .name = "__muldf3", .linkage = linkage });98 @export(__addtf3, .{ .name = "__addtf3", .linkage = linkage });
80 @export(@import("compiler_rt/mulXf3.zig").__multf3, .{ .name = "__multf3", .linkage = linkage });99 const __subsf3 = @import("compiler_rt/addXf3.zig").__subsf3;
81100 @export(__subsf3, .{ .name = "__subsf3", .linkage = linkage });
82 @export(@import("compiler_rt/divsf3.zig").__divsf3, .{ .name = "__divsf3", .linkage = linkage });101 const __subdf3 = @import("compiler_rt/addXf3.zig").__subdf3;
83 @export(@import("compiler_rt/divdf3.zig").__divdf3, .{ .name = "__divdf3", .linkage = linkage });102 @export(__subdf3, .{ .name = "__subdf3", .linkage = linkage });
84 @export(@import("compiler_rt/divtf3.zig").__divtf3, .{ .name = "__divtf3", .linkage = linkage });103 const __subtf3 = @import("compiler_rt/addXf3.zig").__subtf3;
85104 @export(__subtf3, .{ .name = "__subtf3", .linkage = linkage });
86 @export(@import("compiler_rt/shift.zig").__ashldi3, .{ .name = "__ashldi3", .linkage = linkage });105
87 @export(@import("compiler_rt/shift.zig").__ashlti3, .{ .name = "__ashlti3", .linkage = linkage });106 const __mulsf3 = @import("compiler_rt/mulXf3.zig").__mulsf3;
88 @export(@import("compiler_rt/shift.zig").__ashrdi3, .{ .name = "__ashrdi3", .linkage = linkage });107 @export(__mulsf3, .{ .name = "__mulsf3", .linkage = linkage });
89 @export(@import("compiler_rt/shift.zig").__ashrti3, .{ .name = "__ashrti3", .linkage = linkage });108 const __muldf3 = @import("compiler_rt/mulXf3.zig").__muldf3;
90 @export(@import("compiler_rt/shift.zig").__lshrdi3, .{ .name = "__lshrdi3", .linkage = linkage });109 @export(__muldf3, .{ .name = "__muldf3", .linkage = linkage });
91 @export(@import("compiler_rt/shift.zig").__lshrti3, .{ .name = "__lshrti3", .linkage = linkage });110 const __multf3 = @import("compiler_rt/mulXf3.zig").__multf3;
92111 @export(__multf3, .{ .name = "__multf3", .linkage = linkage });
93 @export(@import("compiler_rt/floatsiXf.zig").__floatsidf, .{ .name = "__floatsidf", .linkage = linkage });112
94 @export(@import("compiler_rt/floatsiXf.zig").__floatsisf, .{ .name = "__floatsisf", .linkage = linkage });113 const __divsf3 = @import("compiler_rt/divsf3.zig").__divsf3;
95 @export(@import("compiler_rt/floatdidf.zig").__floatdidf, .{ .name = "__floatdidf", .linkage = linkage });114 @export(__divsf3, .{ .name = "__divsf3", .linkage = linkage });
96 @export(@import("compiler_rt/floatsiXf.zig").__floatsitf, .{ .name = "__floatsitf", .linkage = linkage });115 const __divdf3 = @import("compiler_rt/divdf3.zig").__divdf3;
97116 @export(__divdf3, .{ .name = "__divdf3", .linkage = linkage });
98 @export(@import("compiler_rt/floatunsisf.zig").__floatunsisf, .{ .name = "__floatunsisf", .linkage = linkage });117 const __divtf3 = @import("compiler_rt/divtf3.zig").__divtf3;
99 @export(@import("compiler_rt/floatundisf.zig").__floatundisf, .{ .name = "__floatundisf", .linkage = linkage });118 @export(__divtf3, .{ .name = "__divtf3", .linkage = linkage });
100 @export(@import("compiler_rt/floatunsidf.zig").__floatunsidf, .{ .name = "__floatunsidf", .linkage = linkage });119
101 @export(@import("compiler_rt/floatundidf.zig").__floatundidf, .{ .name = "__floatundidf", .linkage = linkage });120 const __ashldi3 = @import("compiler_rt/shift.zig").__ashldi3;
102121 @export(__ashldi3, .{ .name = "__ashldi3", .linkage = linkage });
103 @export(@import("compiler_rt/floatditf.zig").__floatditf, .{ .name = "__floatditf", .linkage = linkage });122 const __ashlti3 = @import("compiler_rt/shift.zig").__ashlti3;
104 @export(@import("compiler_rt/floattitf.zig").__floattitf, .{ .name = "__floattitf", .linkage = linkage });123 @export(__ashlti3, .{ .name = "__ashlti3", .linkage = linkage });
105 @export(@import("compiler_rt/floattidf.zig").__floattidf, .{ .name = "__floattidf", .linkage = linkage });124 const __ashrdi3 = @import("compiler_rt/shift.zig").__ashrdi3;
106 @export(@import("compiler_rt/floatXisf.zig").__floattisf, .{ .name = "__floattisf", .linkage = linkage });125 @export(__ashrdi3, .{ .name = "__ashrdi3", .linkage = linkage });
107 @export(@import("compiler_rt/floatXisf.zig").__floatdisf, .{ .name = "__floatdisf", .linkage = linkage });126 const __ashrti3 = @import("compiler_rt/shift.zig").__ashrti3;
108127 @export(__ashrti3, .{ .name = "__ashrti3", .linkage = linkage });
109 @export(@import("compiler_rt/floatunditf.zig").__floatunditf, .{ .name = "__floatunditf", .linkage = linkage });128 const __lshrdi3 = @import("compiler_rt/shift.zig").__lshrdi3;
110 @export(@import("compiler_rt/floatunsitf.zig").__floatunsitf, .{ .name = "__floatunsitf", .linkage = linkage });129 @export(__lshrdi3, .{ .name = "__lshrdi3", .linkage = linkage });
111130 const __lshrti3 = @import("compiler_rt/shift.zig").__lshrti3;
112 @export(@import("compiler_rt/floatuntitf.zig").__floatuntitf, .{ .name = "__floatuntitf", .linkage = linkage });131 @export(__lshrti3, .{ .name = "__lshrti3", .linkage = linkage });
113 @export(@import("compiler_rt/floatuntidf.zig").__floatuntidf, .{ .name = "__floatuntidf", .linkage = linkage });132
114 @export(@import("compiler_rt/floatuntisf.zig").__floatuntisf, .{ .name = "__floatuntisf", .linkage = linkage });133 const __floatsidf = @import("compiler_rt/floatsiXf.zig").__floatsidf;
115134 @export(__floatsidf, .{ .name = "__floatsidf", .linkage = linkage });
116 @export(@import("compiler_rt/extendXfYf2.zig").__extenddftf2, .{ .name = "__extenddftf2", .linkage = linkage });135 const __floatsisf = @import("compiler_rt/floatsiXf.zig").__floatsisf;
117 @export(@import("compiler_rt/extendXfYf2.zig").__extendsftf2, .{ .name = "__extendsftf2", .linkage = linkage });136 @export(__floatsisf, .{ .name = "__floatsisf", .linkage = linkage });
118 @export(@import("compiler_rt/extendXfYf2.zig").__extendhfsf2, .{ .name = "__extendhfsf2", .linkage = linkage });137 const __floatdidf = @import("compiler_rt/floatdidf.zig").__floatdidf;
119 @export(@import("compiler_rt/extendXfYf2.zig").__extendhftf2, .{ .name = "__extendhftf2", .linkage = linkage });138 @export(__floatdidf, .{ .name = "__floatdidf", .linkage = linkage });
120139 const __floatsitf = @import("compiler_rt/floatsiXf.zig").__floatsitf;
121 @export(@import("compiler_rt/truncXfYf2.zig").__truncsfhf2, .{ .name = "__truncsfhf2", .linkage = linkage });140 @export(__floatsitf, .{ .name = "__floatsitf", .linkage = linkage });
122 @export(@import("compiler_rt/truncXfYf2.zig").__truncdfhf2, .{ .name = "__truncdfhf2", .linkage = linkage });141
123 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfhf2, .{ .name = "__trunctfhf2", .linkage = linkage });142 const __floatunsisf = @import("compiler_rt/floatunsisf.zig").__floatunsisf;
124 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfdf2, .{ .name = "__trunctfdf2", .linkage = linkage });143 @export(__floatunsisf, .{ .name = "__floatunsisf", .linkage = linkage });
125 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfsf2, .{ .name = "__trunctfsf2", .linkage = linkage });144 const __floatundisf = @import("compiler_rt/floatundisf.zig").__floatundisf;
126145 @export(__floatundisf, .{ .name = "__floatundisf", .linkage = linkage });
127 @export(@import("compiler_rt/truncXfYf2.zig").__truncdfsf2, .{ .name = "__truncdfsf2", .linkage = linkage });146 const __floatunsidf = @import("compiler_rt/floatunsidf.zig").__floatunsidf;
128147 @export(__floatunsidf, .{ .name = "__floatunsidf", .linkage = linkage });
129 @export(@import("compiler_rt/extendXfYf2.zig").__extendsfdf2, .{ .name = "__extendsfdf2", .linkage = linkage });148 const __floatundidf = @import("compiler_rt/floatundidf.zig").__floatundidf;
130149 @export(__floatundidf, .{ .name = "__floatundidf", .linkage = linkage });
131 @export(@import("compiler_rt/fixunssfsi.zig").__fixunssfsi, .{ .name = "__fixunssfsi", .linkage = linkage });150
132 @export(@import("compiler_rt/fixunssfdi.zig").__fixunssfdi, .{ .name = "__fixunssfdi", .linkage = linkage });151 const __floatditf = @import("compiler_rt/floatditf.zig").__floatditf;
133 @export(@import("compiler_rt/fixunssfti.zig").__fixunssfti, .{ .name = "__fixunssfti", .linkage = linkage });152 @export(__floatditf, .{ .name = "__floatditf", .linkage = linkage });
134153 const __floattitf = @import("compiler_rt/floattitf.zig").__floattitf;
135 @export(@import("compiler_rt/fixunsdfsi.zig").__fixunsdfsi, .{ .name = "__fixunsdfsi", .linkage = linkage });154 @export(__floattitf, .{ .name = "__floattitf", .linkage = linkage });
136 @export(@import("compiler_rt/fixunsdfdi.zig").__fixunsdfdi, .{ .name = "__fixunsdfdi", .linkage = linkage });155 const __floattidf = @import("compiler_rt/floattidf.zig").__floattidf;
137 @export(@import("compiler_rt/fixunsdfti.zig").__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = linkage });156 @export(__floattidf, .{ .name = "__floattidf", .linkage = linkage });
138157 const __floattisf = @import("compiler_rt/floatXisf.zig").__floattisf;
139 @export(@import("compiler_rt/fixunstfsi.zig").__fixunstfsi, .{ .name = "__fixunstfsi", .linkage = linkage });158 @export(__floattisf, .{ .name = "__floattisf", .linkage = linkage });
140 @export(@import("compiler_rt/fixunstfdi.zig").__fixunstfdi, .{ .name = "__fixunstfdi", .linkage = linkage });159 const __floatdisf = @import("compiler_rt/floatXisf.zig").__floatdisf;
141 @export(@import("compiler_rt/fixunstfti.zig").__fixunstfti, .{ .name = "__fixunstfti", .linkage = linkage });160 @export(__floatdisf, .{ .name = "__floatdisf", .linkage = linkage });
142161
143 @export(@import("compiler_rt/fixdfdi.zig").__fixdfdi, .{ .name = "__fixdfdi", .linkage = linkage });162 const __floatunditf = @import("compiler_rt/floatunditf.zig").__floatunditf;
144 @export(@import("compiler_rt/fixdfsi.zig").__fixdfsi, .{ .name = "__fixdfsi", .linkage = linkage });163 @export(__floatunditf, .{ .name = "__floatunditf", .linkage = linkage });
145 @export(@import("compiler_rt/fixdfti.zig").__fixdfti, .{ .name = "__fixdfti", .linkage = linkage });164 const __floatunsitf = @import("compiler_rt/floatunsitf.zig").__floatunsitf;
146 @export(@import("compiler_rt/fixsfdi.zig").__fixsfdi, .{ .name = "__fixsfdi", .linkage = linkage });165 @export(__floatunsitf, .{ .name = "__floatunsitf", .linkage = linkage });
147 @export(@import("compiler_rt/fixsfsi.zig").__fixsfsi, .{ .name = "__fixsfsi", .linkage = linkage });166
148 @export(@import("compiler_rt/fixsfti.zig").__fixsfti, .{ .name = "__fixsfti", .linkage = linkage });167 const __floatuntitf = @import("compiler_rt/floatuntitf.zig").__floatuntitf;
149 @export(@import("compiler_rt/fixtfdi.zig").__fixtfdi, .{ .name = "__fixtfdi", .linkage = linkage });168 @export(__floatuntitf, .{ .name = "__floatuntitf", .linkage = linkage });
150 @export(@import("compiler_rt/fixtfsi.zig").__fixtfsi, .{ .name = "__fixtfsi", .linkage = linkage });169 const __floatuntidf = @import("compiler_rt/floatuntidf.zig").__floatuntidf;
151 @export(@import("compiler_rt/fixtfti.zig").__fixtfti, .{ .name = "__fixtfti", .linkage = linkage });170 @export(__floatuntidf, .{ .name = "__floatuntidf", .linkage = linkage });
152171 const __floatuntisf = @import("compiler_rt/floatuntisf.zig").__floatuntisf;
153 @export(@import("compiler_rt/int.zig").__udivmoddi4, .{ .name = "__udivmoddi4", .linkage = linkage });172 @export(__floatuntisf, .{ .name = "__floatuntisf", .linkage = linkage });
154 @export(@import("compiler_rt/popcountdi2.zig").__popcountdi2, .{ .name = "__popcountdi2", .linkage = linkage });173
155174 const __extenddftf2 = @import("compiler_rt/extendXfYf2.zig").__extenddftf2;
156 @export(@import("compiler_rt/int.zig").__mulsi3, .{ .name = "__mulsi3", .linkage = linkage });175 @export(__extenddftf2, .{ .name = "__extenddftf2", .linkage = linkage });
157 @export(@import("compiler_rt/muldi3.zig").__muldi3, .{ .name = "__muldi3", .linkage = linkage });176 const __extendsftf2 = @import("compiler_rt/extendXfYf2.zig").__extendsftf2;
158 @export(@import("compiler_rt/int.zig").__divmoddi4, .{ .name = "__divmoddi4", .linkage = linkage });177 @export(__extendsftf2, .{ .name = "__extendsftf2", .linkage = linkage });
159 @export(@import("compiler_rt/int.zig").__divsi3, .{ .name = "__divsi3", .linkage = linkage });178 const __extendhfsf2 = @import("compiler_rt/extendXfYf2.zig").__extendhfsf2;
160 @export(@import("compiler_rt/int.zig").__divdi3, .{ .name = "__divdi3", .linkage = linkage });179 @export(__extendhfsf2, .{ .name = "__extendhfsf2", .linkage = linkage });
161 @export(@import("compiler_rt/int.zig").__udivsi3, .{ .name = "__udivsi3", .linkage = linkage });180 const __extendhftf2 = @import("compiler_rt/extendXfYf2.zig").__extendhftf2;
162 @export(@import("compiler_rt/int.zig").__udivdi3, .{ .name = "__udivdi3", .linkage = linkage });181 @export(__extendhftf2, .{ .name = "__extendhftf2", .linkage = linkage });
163 @export(@import("compiler_rt/int.zig").__modsi3, .{ .name = "__modsi3", .linkage = linkage });182
164 @export(@import("compiler_rt/int.zig").__moddi3, .{ .name = "__moddi3", .linkage = linkage });183 const __truncsfhf2 = @import("compiler_rt/truncXfYf2.zig").__truncsfhf2;
165 @export(@import("compiler_rt/int.zig").__umodsi3, .{ .name = "__umodsi3", .linkage = linkage });184 @export(__truncsfhf2, .{ .name = "__truncsfhf2", .linkage = linkage });
166 @export(@import("compiler_rt/int.zig").__umoddi3, .{ .name = "__umoddi3", .linkage = linkage });185 const __truncdfhf2 = @import("compiler_rt/truncXfYf2.zig").__truncdfhf2;
167 @export(@import("compiler_rt/int.zig").__divmodsi4, .{ .name = "__divmodsi4", .linkage = linkage });186 @export(__truncdfhf2, .{ .name = "__truncdfhf2", .linkage = linkage });
168 @export(@import("compiler_rt/int.zig").__udivmodsi4, .{ .name = "__udivmodsi4", .linkage = linkage });187 const __trunctfhf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfhf2;
169188 @export(__trunctfhf2, .{ .name = "__trunctfhf2", .linkage = linkage });
170 @export(@import("compiler_rt/negXf2.zig").__negsf2, .{ .name = "__negsf2", .linkage = linkage });189 const __trunctfdf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfdf2;
171 @export(@import("compiler_rt/negXf2.zig").__negdf2, .{ .name = "__negdf2", .linkage = linkage });190 @export(__trunctfdf2, .{ .name = "__trunctfdf2", .linkage = linkage });
172191 const __trunctfsf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfsf2;
173 @export(@import("compiler_rt/clzsi2.zig").__clzsi2, .{ .name = "__clzsi2", .linkage = linkage });192 @export(__trunctfsf2, .{ .name = "__trunctfsf2", .linkage = linkage });
193
194 const __truncdfsf2 = @import("compiler_rt/truncXfYf2.zig").__truncdfsf2;
195 @export(__truncdfsf2, .{ .name = "__truncdfsf2", .linkage = linkage });
196
197 const __extendsfdf2 = @import("compiler_rt/extendXfYf2.zig").__extendsfdf2;
198 @export(__extendsfdf2, .{ .name = "__extendsfdf2", .linkage = linkage });
199
200 const __fixunssfsi = @import("compiler_rt/fixunssfsi.zig").__fixunssfsi;
201 @export(__fixunssfsi, .{ .name = "__fixunssfsi", .linkage = linkage });
202 const __fixunssfdi = @import("compiler_rt/fixunssfdi.zig").__fixunssfdi;
203 @export(__fixunssfdi, .{ .name = "__fixunssfdi", .linkage = linkage });
204 const __fixunssfti = @import("compiler_rt/fixunssfti.zig").__fixunssfti;
205 @export(__fixunssfti, .{ .name = "__fixunssfti", .linkage = linkage });
206
207 const __fixunsdfsi = @import("compiler_rt/fixunsdfsi.zig").__fixunsdfsi;
208 @export(__fixunsdfsi, .{ .name = "__fixunsdfsi", .linkage = linkage });
209 const __fixunsdfdi = @import("compiler_rt/fixunsdfdi.zig").__fixunsdfdi;
210 @export(__fixunsdfdi, .{ .name = "__fixunsdfdi", .linkage = linkage });
211 const __fixunsdfti = @import("compiler_rt/fixunsdfti.zig").__fixunsdfti;
212 @export(__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = linkage });
213
214 const __fixunstfsi = @import("compiler_rt/fixunstfsi.zig").__fixunstfsi;
215 @export(__fixunstfsi, .{ .name = "__fixunstfsi", .linkage = linkage });
216 const __fixunstfdi = @import("compiler_rt/fixunstfdi.zig").__fixunstfdi;
217 @export(__fixunstfdi, .{ .name = "__fixunstfdi", .linkage = linkage });
218 const __fixunstfti = @import("compiler_rt/fixunstfti.zig").__fixunstfti;
219 @export(__fixunstfti, .{ .name = "__fixunstfti", .linkage = linkage });
220
221 const __fixdfdi = @import("compiler_rt/fixdfdi.zig").__fixdfdi;
222 @export(__fixdfdi, .{ .name = "__fixdfdi", .linkage = linkage });
223 const __fixdfsi = @import("compiler_rt/fixdfsi.zig").__fixdfsi;
224 @export(__fixdfsi, .{ .name = "__fixdfsi", .linkage = linkage });
225 const __fixdfti = @import("compiler_rt/fixdfti.zig").__fixdfti;
226 @export(__fixdfti, .{ .name = "__fixdfti", .linkage = linkage });
227 const __fixsfdi = @import("compiler_rt/fixsfdi.zig").__fixsfdi;
228 @export(__fixsfdi, .{ .name = "__fixsfdi", .linkage = linkage });
229 const __fixsfsi = @import("compiler_rt/fixsfsi.zig").__fixsfsi;
230 @export(__fixsfsi, .{ .name = "__fixsfsi", .linkage = linkage });
231 const __fixsfti = @import("compiler_rt/fixsfti.zig").__fixsfti;
232 @export(__fixsfti, .{ .name = "__fixsfti", .linkage = linkage });
233 const __fixtfdi = @import("compiler_rt/fixtfdi.zig").__fixtfdi;
234 @export(__fixtfdi, .{ .name = "__fixtfdi", .linkage = linkage });
235 const __fixtfsi = @import("compiler_rt/fixtfsi.zig").__fixtfsi;
236 @export(__fixtfsi, .{ .name = "__fixtfsi", .linkage = linkage });
237 const __fixtfti = @import("compiler_rt/fixtfti.zig").__fixtfti;
238 @export(__fixtfti, .{ .name = "__fixtfti", .linkage = linkage });
239
240 const __udivmoddi4 = @import("compiler_rt/int.zig").__udivmoddi4;
241 @export(__udivmoddi4, .{ .name = "__udivmoddi4", .linkage = linkage });
242 const __popcountdi2 = @import("compiler_rt/popcountdi2.zig").__popcountdi2;
243 @export(__popcountdi2, .{ .name = "__popcountdi2", .linkage = linkage });
244
245 const __mulsi3 = @import("compiler_rt/int.zig").__mulsi3;
246 @export(__mulsi3, .{ .name = "__mulsi3", .linkage = linkage });
247 const __muldi3 = @import("compiler_rt/muldi3.zig").__muldi3;
248 @export(__muldi3, .{ .name = "__muldi3", .linkage = linkage });
249 const __divmoddi4 = @import("compiler_rt/int.zig").__divmoddi4;
250 @export(__divmoddi4, .{ .name = "__divmoddi4", .linkage = linkage });
251 const __divsi3 = @import("compiler_rt/int.zig").__divsi3;
252 @export(__divsi3, .{ .name = "__divsi3", .linkage = linkage });
253 const __divdi3 = @import("compiler_rt/int.zig").__divdi3;
254 @export(__divdi3, .{ .name = "__divdi3", .linkage = linkage });
255 const __udivsi3 = @import("compiler_rt/int.zig").__udivsi3;
256 @export(__udivsi3, .{ .name = "__udivsi3", .linkage = linkage });
257 const __udivdi3 = @import("compiler_rt/int.zig").__udivdi3;
258 @export(__udivdi3, .{ .name = "__udivdi3", .linkage = linkage });
259 const __modsi3 = @import("compiler_rt/int.zig").__modsi3;
260 @export(__modsi3, .{ .name = "__modsi3", .linkage = linkage });
261 const __moddi3 = @import("compiler_rt/int.zig").__moddi3;
262 @export(__moddi3, .{ .name = "__moddi3", .linkage = linkage });
263 const __umodsi3 = @import("compiler_rt/int.zig").__umodsi3;
264 @export(__umodsi3, .{ .name = "__umodsi3", .linkage = linkage });
265 const __umoddi3 = @import("compiler_rt/int.zig").__umoddi3;
266 @export(__umoddi3, .{ .name = "__umoddi3", .linkage = linkage });
267 const __divmodsi4 = @import("compiler_rt/int.zig").__divmodsi4;
268 @export(__divmodsi4, .{ .name = "__divmodsi4", .linkage = linkage });
269 const __udivmodsi4 = @import("compiler_rt/int.zig").__udivmodsi4;
270 @export(__udivmodsi4, .{ .name = "__udivmodsi4", .linkage = linkage });
271
272 const __negsf2 = @import("compiler_rt/negXf2.zig").__negsf2;
273 @export(__negsf2, .{ .name = "__negsf2", .linkage = linkage });
274 const __negdf2 = @import("compiler_rt/negXf2.zig").__negdf2;
275 @export(__negdf2, .{ .name = "__negdf2", .linkage = linkage });
276
277 const __clzsi2 = @import("compiler_rt/clzsi2.zig").__clzsi2;
278 @export(__clzsi2, .{ .name = "__clzsi2", .linkage = linkage });
174279
175 if (builtin.link_libc and os_tag == .openbsd) {280 if (builtin.link_libc and os_tag == .openbsd) {
176 @export(@import("compiler_rt/emutls.zig").__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = linkage });281 const __emutls_get_address = @import("compiler_rt/emutls.zig").__emutls_get_address;
282 @export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = linkage });
177 }283 }
178284
179 if ((arch.isARM() or arch.isThumb()) and !is_test) {285 if ((arch.isARM() or arch.isThumb()) and !is_test) {
180 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = linkage });286 const __aeabi_unwind_cpp_pr0 = @import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr0;
181 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });287 @export(__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = linkage });
182 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = linkage });288 const __aeabi_unwind_cpp_pr1 = @import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1;
183289 @export(__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });
184 @export(@import("compiler_rt/muldi3.zig").__muldi3, .{ .name = "__aeabi_lmul", .linkage = linkage });290 const __aeabi_unwind_cpp_pr2 = @import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr2;
185291 @export(__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = linkage });
186 @export(@import("compiler_rt/arm.zig").__aeabi_ldivmod, .{ .name = "__aeabi_ldivmod", .linkage = linkage });292
187 @export(@import("compiler_rt/arm.zig").__aeabi_uldivmod, .{ .name = "__aeabi_uldivmod", .linkage = linkage });293 @export(__muldi3, .{ .name = "__aeabi_lmul", .linkage = linkage });
188294
189 @export(@import("compiler_rt/int.zig").__divsi3, .{ .name = "__aeabi_idiv", .linkage = linkage });295 const __aeabi_ldivmod = @import("compiler_rt/arm.zig").__aeabi_ldivmod;
190 @export(@import("compiler_rt/arm.zig").__aeabi_idivmod, .{ .name = "__aeabi_idivmod", .linkage = linkage });296 @export(__aeabi_ldivmod, .{ .name = "__aeabi_ldivmod", .linkage = linkage });
191 @export(@import("compiler_rt/int.zig").__udivsi3, .{ .name = "__aeabi_uidiv", .linkage = linkage });297 const __aeabi_uldivmod = @import("compiler_rt/arm.zig").__aeabi_uldivmod;
192 @export(@import("compiler_rt/arm.zig").__aeabi_uidivmod, .{ .name = "__aeabi_uidivmod", .linkage = linkage });298 @export(__aeabi_uldivmod, .{ .name = "__aeabi_uldivmod", .linkage = linkage });
193299
194 @export(@import("compiler_rt/arm.zig").__aeabi_memcpy, .{ .name = "__aeabi_memcpy", .linkage = linkage });300 @export(__divsi3, .{ .name = "__aeabi_idiv", .linkage = linkage });
195 @export(@import("compiler_rt/arm.zig").__aeabi_memcpy, .{ .name = "__aeabi_memcpy4", .linkage = linkage });301 const __aeabi_idivmod = @import("compiler_rt/arm.zig").__aeabi_idivmod;
196 @export(@import("compiler_rt/arm.zig").__aeabi_memcpy, .{ .name = "__aeabi_memcpy8", .linkage = linkage });302 @export(__aeabi_idivmod, .{ .name = "__aeabi_idivmod", .linkage = linkage });
197303 @export(__udivsi3, .{ .name = "__aeabi_uidiv", .linkage = linkage });
198 @export(@import("compiler_rt/arm.zig").__aeabi_memmove, .{ .name = "__aeabi_memmove", .linkage = linkage });304 const __aeabi_uidivmod = @import("compiler_rt/arm.zig").__aeabi_uidivmod;
199 @export(@import("compiler_rt/arm.zig").__aeabi_memmove, .{ .name = "__aeabi_memmove4", .linkage = linkage });305 @export(__aeabi_uidivmod, .{ .name = "__aeabi_uidivmod", .linkage = linkage });
200 @export(@import("compiler_rt/arm.zig").__aeabi_memmove, .{ .name = "__aeabi_memmove8", .linkage = linkage });306
201307 const __aeabi_memcpy = @import("compiler_rt/arm.zig").__aeabi_memcpy;
202 @export(@import("compiler_rt/arm.zig").__aeabi_memset, .{ .name = "__aeabi_memset", .linkage = linkage });308 @export(__aeabi_memcpy, .{ .name = "__aeabi_memcpy", .linkage = linkage });
203 @export(@import("compiler_rt/arm.zig").__aeabi_memset, .{ .name = "__aeabi_memset4", .linkage = linkage });309 @export(__aeabi_memcpy, .{ .name = "__aeabi_memcpy4", .linkage = linkage });
204 @export(@import("compiler_rt/arm.zig").__aeabi_memset, .{ .name = "__aeabi_memset8", .linkage = linkage });310 @export(__aeabi_memcpy, .{ .name = "__aeabi_memcpy8", .linkage = linkage });
205311
206 @export(@import("compiler_rt/arm.zig").__aeabi_memclr, .{ .name = "__aeabi_memclr", .linkage = linkage });312 const __aeabi_memmove = @import("compiler_rt/arm.zig").__aeabi_memmove;
207 @export(@import("compiler_rt/arm.zig").__aeabi_memclr, .{ .name = "__aeabi_memclr4", .linkage = linkage });313 @export(__aeabi_memmove, .{ .name = "__aeabi_memmove", .linkage = linkage });
208 @export(@import("compiler_rt/arm.zig").__aeabi_memclr, .{ .name = "__aeabi_memclr8", .linkage = linkage });314 @export(__aeabi_memmove, .{ .name = "__aeabi_memmove4", .linkage = linkage });
315 @export(__aeabi_memmove, .{ .name = "__aeabi_memmove8", .linkage = linkage });
316
317 const __aeabi_memset = @import("compiler_rt/arm.zig").__aeabi_memset;
318 @export(__aeabi_memset, .{ .name = "__aeabi_memset", .linkage = linkage });
319 @export(__aeabi_memset, .{ .name = "__aeabi_memset4", .linkage = linkage });
320 @export(__aeabi_memset, .{ .name = "__aeabi_memset8", .linkage = linkage });
321
322 const __aeabi_memclr = @import("compiler_rt/arm.zig").__aeabi_memclr;
323 @export(__aeabi_memclr, .{ .name = "__aeabi_memclr", .linkage = linkage });
324 @export(__aeabi_memclr, .{ .name = "__aeabi_memclr4", .linkage = linkage });
325 @export(__aeabi_memclr, .{ .name = "__aeabi_memclr8", .linkage = linkage });
209326
210 if (os_tag == .linux) {327 if (os_tag == .linux) {
211 @export(@import("compiler_rt/arm.zig").__aeabi_read_tp, .{ .name = "__aeabi_read_tp", .linkage = linkage });328 const __aeabi_read_tp = @import("compiler_rt/arm.zig").__aeabi_read_tp;
329 @export(__aeabi_read_tp, .{ .name = "__aeabi_read_tp", .linkage = linkage });
212 }330 }
213331
214 @export(@import("compiler_rt/extendXfYf2.zig").__aeabi_f2d, .{ .name = "__aeabi_f2d", .linkage = linkage });332 const __aeabi_f2d = @import("compiler_rt/extendXfYf2.zig").__aeabi_f2d;
215 @export(@import("compiler_rt/floatsiXf.zig").__aeabi_i2d, .{ .name = "__aeabi_i2d", .linkage = linkage });333 @export(__aeabi_f2d, .{ .name = "__aeabi_f2d", .linkage = linkage });
216 @export(@import("compiler_rt/floatdidf.zig").__aeabi_l2d, .{ .name = "__aeabi_l2d", .linkage = linkage });334 const __aeabi_i2d = @import("compiler_rt/floatsiXf.zig").__aeabi_i2d;
217 @export(@import("compiler_rt/floatXisf.zig").__aeabi_l2f, .{ .name = "__aeabi_l2f", .linkage = linkage });335 @export(__aeabi_i2d, .{ .name = "__aeabi_i2d", .linkage = linkage });
218 @export(@import("compiler_rt/floatunsidf.zig").__aeabi_ui2d, .{ .name = "__aeabi_ui2d", .linkage = linkage });336 const __aeabi_l2d = @import("compiler_rt/floatdidf.zig").__aeabi_l2d;
219 @export(@import("compiler_rt/floatundidf.zig").__aeabi_ul2d, .{ .name = "__aeabi_ul2d", .linkage = linkage });337 @export(__aeabi_l2d, .{ .name = "__aeabi_l2d", .linkage = linkage });
220 @export(@import("compiler_rt/floatunsisf.zig").__aeabi_ui2f, .{ .name = "__aeabi_ui2f", .linkage = linkage });338 const __aeabi_l2f = @import("compiler_rt/floatXisf.zig").__aeabi_l2f;
221 @export(@import("compiler_rt/floatundisf.zig").__aeabi_ul2f, .{ .name = "__aeabi_ul2f", .linkage = linkage });339 @export(__aeabi_l2f, .{ .name = "__aeabi_l2f", .linkage = linkage });
222340 const __aeabi_ui2d = @import("compiler_rt/floatunsidf.zig").__aeabi_ui2d;
223 @export(@import("compiler_rt/negXf2.zig").__aeabi_fneg, .{ .name = "__aeabi_fneg", .linkage = linkage });341 @export(__aeabi_ui2d, .{ .name = "__aeabi_ui2d", .linkage = linkage });
224 @export(@import("compiler_rt/negXf2.zig").__aeabi_dneg, .{ .name = "__aeabi_dneg", .linkage = linkage });342 const __aeabi_ul2d = @import("compiler_rt/floatundidf.zig").__aeabi_ul2d;
225343 @export(__aeabi_ul2d, .{ .name = "__aeabi_ul2d", .linkage = linkage });
226 @export(@import("compiler_rt/mulXf3.zig").__aeabi_fmul, .{ .name = "__aeabi_fmul", .linkage = linkage });344 const __aeabi_ui2f = @import("compiler_rt/floatunsisf.zig").__aeabi_ui2f;
227 @export(@import("compiler_rt/mulXf3.zig").__aeabi_dmul, .{ .name = "__aeabi_dmul", .linkage = linkage });345 @export(__aeabi_ui2f, .{ .name = "__aeabi_ui2f", .linkage = linkage });
228346 const __aeabi_ul2f = @import("compiler_rt/floatundisf.zig").__aeabi_ul2f;
229 @export(@import("compiler_rt/truncXfYf2.zig").__aeabi_d2h, .{ .name = "__aeabi_d2h", .linkage = linkage });347 @export(__aeabi_ul2f, .{ .name = "__aeabi_ul2f", .linkage = linkage });
230348
231 @export(@import("compiler_rt/fixunssfdi.zig").__aeabi_f2ulz, .{ .name = "__aeabi_f2ulz", .linkage = linkage });349 const __aeabi_fneg = @import("compiler_rt/negXf2.zig").__aeabi_fneg;
232 @export(@import("compiler_rt/fixunsdfdi.zig").__aeabi_d2ulz, .{ .name = "__aeabi_d2ulz", .linkage = linkage });350 @export(__aeabi_fneg, .{ .name = "__aeabi_fneg", .linkage = linkage });
233351 const __aeabi_dneg = @import("compiler_rt/negXf2.zig").__aeabi_dneg;
234 @export(@import("compiler_rt/fixsfdi.zig").__aeabi_f2lz, .{ .name = "__aeabi_f2lz", .linkage = linkage });352 @export(__aeabi_dneg, .{ .name = "__aeabi_dneg", .linkage = linkage });
235 @export(@import("compiler_rt/fixdfdi.zig").__aeabi_d2lz, .{ .name = "__aeabi_d2lz", .linkage = linkage });353
236354 const __aeabi_fmul = @import("compiler_rt/mulXf3.zig").__aeabi_fmul;
237 @export(@import("compiler_rt/fixunsdfsi.zig").__aeabi_d2uiz, .{ .name = "__aeabi_d2uiz", .linkage = linkage });355 @export(__aeabi_fmul, .{ .name = "__aeabi_fmul", .linkage = linkage });
238356 const __aeabi_dmul = @import("compiler_rt/mulXf3.zig").__aeabi_dmul;
239 @export(@import("compiler_rt/extendXfYf2.zig").__aeabi_h2f, .{ .name = "__aeabi_h2f", .linkage = linkage });357 @export(__aeabi_dmul, .{ .name = "__aeabi_dmul", .linkage = linkage });
240 @export(@import("compiler_rt/truncXfYf2.zig").__aeabi_f2h, .{ .name = "__aeabi_f2h", .linkage = linkage });358
241359 const __aeabi_d2h = @import("compiler_rt/truncXfYf2.zig").__aeabi_d2h;
242 @export(@import("compiler_rt/floatsiXf.zig").__aeabi_i2f, .{ .name = "__aeabi_i2f", .linkage = linkage });360 @export(__aeabi_d2h, .{ .name = "__aeabi_d2h", .linkage = linkage });
243 @export(@import("compiler_rt/truncXfYf2.zig").__aeabi_d2f, .{ .name = "__aeabi_d2f", .linkage = linkage });361
244362 const __aeabi_f2ulz = @import("compiler_rt/fixunssfdi.zig").__aeabi_f2ulz;
245 @export(@import("compiler_rt/addXf3.zig").__aeabi_fadd, .{ .name = "__aeabi_fadd", .linkage = linkage });363 @export(__aeabi_f2ulz, .{ .name = "__aeabi_f2ulz", .linkage = linkage });
246 @export(@import("compiler_rt/addXf3.zig").__aeabi_dadd, .{ .name = "__aeabi_dadd", .linkage = linkage });364 const __aeabi_d2ulz = @import("compiler_rt/fixunsdfdi.zig").__aeabi_d2ulz;
247 @export(@import("compiler_rt/addXf3.zig").__aeabi_fsub, .{ .name = "__aeabi_fsub", .linkage = linkage });365 @export(__aeabi_d2ulz, .{ .name = "__aeabi_d2ulz", .linkage = linkage });
248 @export(@import("compiler_rt/addXf3.zig").__aeabi_dsub, .{ .name = "__aeabi_dsub", .linkage = linkage });366
249367 const __aeabi_f2lz = @import("compiler_rt/fixsfdi.zig").__aeabi_f2lz;
250 @export(@import("compiler_rt/fixunssfsi.zig").__aeabi_f2uiz, .{ .name = "__aeabi_f2uiz", .linkage = linkage });368 @export(__aeabi_f2lz, .{ .name = "__aeabi_f2lz", .linkage = linkage });
251369 const __aeabi_d2lz = @import("compiler_rt/fixdfdi.zig").__aeabi_d2lz;
252 @export(@import("compiler_rt/fixsfsi.zig").__aeabi_f2iz, .{ .name = "__aeabi_f2iz", .linkage = linkage });370 @export(__aeabi_d2lz, .{ .name = "__aeabi_d2lz", .linkage = linkage });
253 @export(@import("compiler_rt/fixdfsi.zig").__aeabi_d2iz, .{ .name = "__aeabi_d2iz", .linkage = linkage });371
254372 const __aeabi_d2uiz = @import("compiler_rt/fixunsdfsi.zig").__aeabi_d2uiz;
255 @export(@import("compiler_rt/divsf3.zig").__aeabi_fdiv, .{ .name = "__aeabi_fdiv", .linkage = linkage });373 @export(__aeabi_d2uiz, .{ .name = "__aeabi_d2uiz", .linkage = linkage });
256 @export(@import("compiler_rt/divdf3.zig").__aeabi_ddiv, .{ .name = "__aeabi_ddiv", .linkage = linkage });374
257375 const __aeabi_h2f = @import("compiler_rt/extendXfYf2.zig").__aeabi_h2f;
258 @export(@import("compiler_rt/shift.zig").__aeabi_llsl, .{ .name = "__aeabi_llsl", .linkage = linkage });376 @export(__aeabi_h2f, .{ .name = "__aeabi_h2f", .linkage = linkage });
259 @export(@import("compiler_rt/shift.zig").__aeabi_lasr, .{ .name = "__aeabi_lasr", .linkage = linkage });377 const __aeabi_f2h = @import("compiler_rt/truncXfYf2.zig").__aeabi_f2h;
260 @export(@import("compiler_rt/shift.zig").__aeabi_llsr, .{ .name = "__aeabi_llsr", .linkage = linkage });378 @export(__aeabi_f2h, .{ .name = "__aeabi_f2h", .linkage = linkage });
261379
262 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpeq, .{ .name = "__aeabi_fcmpeq", .linkage = linkage });380 const __aeabi_i2f = @import("compiler_rt/floatsiXf.zig").__aeabi_i2f;
263 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmplt, .{ .name = "__aeabi_fcmplt", .linkage = linkage });381 @export(__aeabi_i2f, .{ .name = "__aeabi_i2f", .linkage = linkage });
264 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmple, .{ .name = "__aeabi_fcmple", .linkage = linkage });382 const __aeabi_d2f = @import("compiler_rt/truncXfYf2.zig").__aeabi_d2f;
265 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpge, .{ .name = "__aeabi_fcmpge", .linkage = linkage });383 @export(__aeabi_d2f, .{ .name = "__aeabi_d2f", .linkage = linkage });
266 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpgt, .{ .name = "__aeabi_fcmpgt", .linkage = linkage });384
267 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpun, .{ .name = "__aeabi_fcmpun", .linkage = linkage });385 const __aeabi_fadd = @import("compiler_rt/addXf3.zig").__aeabi_fadd;
268386 @export(__aeabi_fadd, .{ .name = "__aeabi_fadd", .linkage = linkage });
269 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpeq, .{ .name = "__aeabi_dcmpeq", .linkage = linkage });387 const __aeabi_dadd = @import("compiler_rt/addXf3.zig").__aeabi_dadd;
270 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmplt, .{ .name = "__aeabi_dcmplt", .linkage = linkage });388 @export(__aeabi_dadd, .{ .name = "__aeabi_dadd", .linkage = linkage });
271 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmple, .{ .name = "__aeabi_dcmple", .linkage = linkage });389 const __aeabi_fsub = @import("compiler_rt/addXf3.zig").__aeabi_fsub;
272 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpge, .{ .name = "__aeabi_dcmpge", .linkage = linkage });390 @export(__aeabi_fsub, .{ .name = "__aeabi_fsub", .linkage = linkage });
273 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });391 const __aeabi_dsub = @import("compiler_rt/addXf3.zig").__aeabi_dsub;
274 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });392 @export(__aeabi_dsub, .{ .name = "__aeabi_dsub", .linkage = linkage });
393
394 const __aeabi_f2uiz = @import("compiler_rt/fixunssfsi.zig").__aeabi_f2uiz;
395 @export(__aeabi_f2uiz, .{ .name = "__aeabi_f2uiz", .linkage = linkage });
396
397 const __aeabi_f2iz = @import("compiler_rt/fixsfsi.zig").__aeabi_f2iz;
398 @export(__aeabi_f2iz, .{ .name = "__aeabi_f2iz", .linkage = linkage });
399 const __aeabi_d2iz = @import("compiler_rt/fixdfsi.zig").__aeabi_d2iz;
400 @export(__aeabi_d2iz, .{ .name = "__aeabi_d2iz", .linkage = linkage });
401
402 const __aeabi_fdiv = @import("compiler_rt/divsf3.zig").__aeabi_fdiv;
403 @export(__aeabi_fdiv, .{ .name = "__aeabi_fdiv", .linkage = linkage });
404 const __aeabi_ddiv = @import("compiler_rt/divdf3.zig").__aeabi_ddiv;
405 @export(__aeabi_ddiv, .{ .name = "__aeabi_ddiv", .linkage = linkage });
406
407 const __aeabi_llsl = @import("compiler_rt/shift.zig").__aeabi_llsl;
408 @export(__aeabi_llsl, .{ .name = "__aeabi_llsl", .linkage = linkage });
409 const __aeabi_lasr = @import("compiler_rt/shift.zig").__aeabi_lasr;
410 @export(__aeabi_lasr, .{ .name = "__aeabi_lasr", .linkage = linkage });
411 const __aeabi_llsr = @import("compiler_rt/shift.zig").__aeabi_llsr;
412 @export(__aeabi_llsr, .{ .name = "__aeabi_llsr", .linkage = linkage });
413
414 const __aeabi_fcmpeq = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpeq;
415 @export(__aeabi_fcmpeq, .{ .name = "__aeabi_fcmpeq", .linkage = linkage });
416 const __aeabi_fcmplt = @import("compiler_rt/compareXf2.zig").__aeabi_fcmplt;
417 @export(__aeabi_fcmplt, .{ .name = "__aeabi_fcmplt", .linkage = linkage });
418 const __aeabi_fcmple = @import("compiler_rt/compareXf2.zig").__aeabi_fcmple;
419 @export(__aeabi_fcmple, .{ .name = "__aeabi_fcmple", .linkage = linkage });
420 const __aeabi_fcmpge = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpge;
421 @export(__aeabi_fcmpge, .{ .name = "__aeabi_fcmpge", .linkage = linkage });
422 const __aeabi_fcmpgt = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpgt;
423 @export(__aeabi_fcmpgt, .{ .name = "__aeabi_fcmpgt", .linkage = linkage });
424 const __aeabi_fcmpun = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpun;
425 @export(__aeabi_fcmpun, .{ .name = "__aeabi_fcmpun", .linkage = linkage });
426
427 const __aeabi_dcmpeq = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpeq;
428 @export(__aeabi_dcmpeq, .{ .name = "__aeabi_dcmpeq", .linkage = linkage });
429 const __aeabi_dcmplt = @import("compiler_rt/compareXf2.zig").__aeabi_dcmplt;
430 @export(__aeabi_dcmplt, .{ .name = "__aeabi_dcmplt", .linkage = linkage });
431 const __aeabi_dcmple = @import("compiler_rt/compareXf2.zig").__aeabi_dcmple;
432 @export(__aeabi_dcmple, .{ .name = "__aeabi_dcmple", .linkage = linkage });
433 const __aeabi_dcmpge = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpge;
434 @export(__aeabi_dcmpge, .{ .name = "__aeabi_dcmpge", .linkage = linkage });
435 const __aeabi_dcmpgt = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpgt;
436 @export(__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });
437 const __aeabi_dcmpun = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpun;
438 @export(__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });
275 }439 }
276440
277 if (arch == .i386 and abi == .msvc) {441 if (arch == .i386 and abi == .msvc) {
278 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins442 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
279 @export(@import("compiler_rt/aulldiv.zig")._alldiv, .{ .name = "\x01__alldiv", .linkage = strong_linkage });443 const _alldiv = @import("compiler_rt/aulldiv.zig")._alldiv;
280 @export(@import("compiler_rt/aulldiv.zig")._aulldiv, .{ .name = "\x01__aulldiv", .linkage = strong_linkage });444 @export(_alldiv, .{ .name = "\x01__alldiv", .linkage = strong_linkage });
281 @export(@import("compiler_rt/aullrem.zig")._allrem, .{ .name = "\x01__allrem", .linkage = strong_linkage });445 const _aulldiv = @import("compiler_rt/aulldiv.zig")._aulldiv;
282 @export(@import("compiler_rt/aullrem.zig")._aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });446 @export(_aulldiv, .{ .name = "\x01__aulldiv", .linkage = strong_linkage });
447 const _allrem = @import("compiler_rt/aullrem.zig")._allrem;
448 @export(_allrem, .{ .name = "\x01__allrem", .linkage = strong_linkage });
449 const _aullrem = @import("compiler_rt/aullrem.zig")._aullrem;
450 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });
283 }451 }
284452
285 if (arch.isSPARC()) {453 if (arch.isSPARC()) {
286 // SPARC systems use a different naming scheme454 // SPARC systems use a different naming scheme
287 @export(@import("compiler_rt/sparc.zig")._Qp_add, .{ .name = "_Qp_add", .linkage = linkage });455 const _Qp_add = @import("compiler_rt/sparc.zig")._Qp_add;
288 @export(@import("compiler_rt/sparc.zig")._Qp_div, .{ .name = "_Qp_div", .linkage = linkage });456 @export(_Qp_add, .{ .name = "_Qp_add", .linkage = linkage });
289 @export(@import("compiler_rt/sparc.zig")._Qp_mul, .{ .name = "_Qp_mul", .linkage = linkage });457 const _Qp_div = @import("compiler_rt/sparc.zig")._Qp_div;
290 @export(@import("compiler_rt/sparc.zig")._Qp_sub, .{ .name = "_Qp_sub", .linkage = linkage });458 @export(_Qp_div, .{ .name = "_Qp_div", .linkage = linkage });
291459 const _Qp_mul = @import("compiler_rt/sparc.zig")._Qp_mul;
292 @export(@import("compiler_rt/sparc.zig")._Qp_cmp, .{ .name = "_Qp_cmp", .linkage = linkage });460 @export(_Qp_mul, .{ .name = "_Qp_mul", .linkage = linkage });
293 @export(@import("compiler_rt/sparc.zig")._Qp_feq, .{ .name = "_Qp_feq", .linkage = linkage });461 const _Qp_sub = @import("compiler_rt/sparc.zig")._Qp_sub;
294 @export(@import("compiler_rt/sparc.zig")._Qp_fne, .{ .name = "_Qp_fne", .linkage = linkage });462 @export(_Qp_sub, .{ .name = "_Qp_sub", .linkage = linkage });
295 @export(@import("compiler_rt/sparc.zig")._Qp_flt, .{ .name = "_Qp_flt", .linkage = linkage });463
296 @export(@import("compiler_rt/sparc.zig")._Qp_fle, .{ .name = "_Qp_fle", .linkage = linkage });464 const _Qp_cmp = @import("compiler_rt/sparc.zig")._Qp_cmp;
297 @export(@import("compiler_rt/sparc.zig")._Qp_fgt, .{ .name = "_Qp_fgt", .linkage = linkage });465 @export(_Qp_cmp, .{ .name = "_Qp_cmp", .linkage = linkage });
298 @export(@import("compiler_rt/sparc.zig")._Qp_fge, .{ .name = "_Qp_fge", .linkage = linkage });466 const _Qp_feq = @import("compiler_rt/sparc.zig")._Qp_feq;
299467 @export(_Qp_feq, .{ .name = "_Qp_feq", .linkage = linkage });
300 @export(@import("compiler_rt/sparc.zig")._Qp_itoq, .{ .name = "_Qp_itoq", .linkage = linkage });468 const _Qp_fne = @import("compiler_rt/sparc.zig")._Qp_fne;
301 @export(@import("compiler_rt/sparc.zig")._Qp_uitoq, .{ .name = "_Qp_uitoq", .linkage = linkage });469 @export(_Qp_fne, .{ .name = "_Qp_fne", .linkage = linkage });
302 @export(@import("compiler_rt/sparc.zig")._Qp_xtoq, .{ .name = "_Qp_xtoq", .linkage = linkage });470 const _Qp_flt = @import("compiler_rt/sparc.zig")._Qp_flt;
303 @export(@import("compiler_rt/sparc.zig")._Qp_uxtoq, .{ .name = "_Qp_uxtoq", .linkage = linkage });471 @export(_Qp_flt, .{ .name = "_Qp_flt", .linkage = linkage });
304 @export(@import("compiler_rt/sparc.zig")._Qp_stoq, .{ .name = "_Qp_stoq", .linkage = linkage });472 const _Qp_fle = @import("compiler_rt/sparc.zig")._Qp_fle;
305 @export(@import("compiler_rt/sparc.zig")._Qp_dtoq, .{ .name = "_Qp_dtoq", .linkage = linkage });473 @export(_Qp_fle, .{ .name = "_Qp_fle", .linkage = linkage });
306 @export(@import("compiler_rt/sparc.zig")._Qp_qtoi, .{ .name = "_Qp_qtoi", .linkage = linkage });474 const _Qp_fgt = @import("compiler_rt/sparc.zig")._Qp_fgt;
307 @export(@import("compiler_rt/sparc.zig")._Qp_qtoui, .{ .name = "_Qp_qtoui", .linkage = linkage });475 @export(_Qp_fgt, .{ .name = "_Qp_fgt", .linkage = linkage });
308 @export(@import("compiler_rt/sparc.zig")._Qp_qtox, .{ .name = "_Qp_qtox", .linkage = linkage });476 const _Qp_fge = @import("compiler_rt/sparc.zig")._Qp_fge;
309 @export(@import("compiler_rt/sparc.zig")._Qp_qtoux, .{ .name = "_Qp_qtoux", .linkage = linkage });477 @export(_Qp_fge, .{ .name = "_Qp_fge", .linkage = linkage });
310 @export(@import("compiler_rt/sparc.zig")._Qp_qtos, .{ .name = "_Qp_qtos", .linkage = linkage });478
311 @export(@import("compiler_rt/sparc.zig")._Qp_qtod, .{ .name = "_Qp_qtod", .linkage = linkage });479 const _Qp_itoq = @import("compiler_rt/sparc.zig")._Qp_itoq;
480 @export(_Qp_itoq, .{ .name = "_Qp_itoq", .linkage = linkage });
481 const _Qp_uitoq = @import("compiler_rt/sparc.zig")._Qp_uitoq;
482 @export(_Qp_uitoq, .{ .name = "_Qp_uitoq", .linkage = linkage });
483 const _Qp_xtoq = @import("compiler_rt/sparc.zig")._Qp_xtoq;
484 @export(_Qp_xtoq, .{ .name = "_Qp_xtoq", .linkage = linkage });
485 const _Qp_uxtoq = @import("compiler_rt/sparc.zig")._Qp_uxtoq;
486 @export(_Qp_uxtoq, .{ .name = "_Qp_uxtoq", .linkage = linkage });
487 const _Qp_stoq = @import("compiler_rt/sparc.zig")._Qp_stoq;
488 @export(_Qp_stoq, .{ .name = "_Qp_stoq", .linkage = linkage });
489 const _Qp_dtoq = @import("compiler_rt/sparc.zig")._Qp_dtoq;
490 @export(_Qp_dtoq, .{ .name = "_Qp_dtoq", .linkage = linkage });
491 const _Qp_qtoi = @import("compiler_rt/sparc.zig")._Qp_qtoi;
492 @export(_Qp_qtoi, .{ .name = "_Qp_qtoi", .linkage = linkage });
493 const _Qp_qtoui = @import("compiler_rt/sparc.zig")._Qp_qtoui;
494 @export(_Qp_qtoui, .{ .name = "_Qp_qtoui", .linkage = linkage });
495 const _Qp_qtox = @import("compiler_rt/sparc.zig")._Qp_qtox;
496 @export(_Qp_qtox, .{ .name = "_Qp_qtox", .linkage = linkage });
497 const _Qp_qtoux = @import("compiler_rt/sparc.zig")._Qp_qtoux;
498 @export(_Qp_qtoux, .{ .name = "_Qp_qtoux", .linkage = linkage });
499 const _Qp_qtos = @import("compiler_rt/sparc.zig")._Qp_qtos;
500 @export(_Qp_qtos, .{ .name = "_Qp_qtos", .linkage = linkage });
501 const _Qp_qtod = @import("compiler_rt/sparc.zig")._Qp_qtod;
502 @export(_Qp_qtod, .{ .name = "_Qp_qtod", .linkage = linkage });
312 }503 }
313504
314 if ((arch == .powerpc or arch.isPPC64()) and !is_test) {505 if ((arch == .powerpc or arch.isPPC64()) and !is_test) {
315 @export(@import("compiler_rt/addXf3.zig").__addtf3, .{ .name = "__addkf3", .linkage = linkage });506 @export(__addtf3, .{ .name = "__addkf3", .linkage = linkage });
316 @export(@import("compiler_rt/addXf3.zig").__subtf3, .{ .name = "__subkf3", .linkage = linkage });507 @export(__subtf3, .{ .name = "__subkf3", .linkage = linkage });
317 @export(@import("compiler_rt/mulXf3.zig").__multf3, .{ .name = "__mulkf3", .linkage = linkage });508 @export(__multf3, .{ .name = "__mulkf3", .linkage = linkage });
318 @export(@import("compiler_rt/divtf3.zig").__divtf3, .{ .name = "__divkf3", .linkage = linkage });509 @export(__divtf3, .{ .name = "__divkf3", .linkage = linkage });
319 @export(@import("compiler_rt/extendXfYf2.zig").__extendsftf2, .{ .name = "__extendsfkf2", .linkage = linkage });510 @export(__extendsftf2, .{ .name = "__extendsfkf2", .linkage = linkage });
320 @export(@import("compiler_rt/extendXfYf2.zig").__extenddftf2, .{ .name = "__extenddfkf2", .linkage = linkage });511 @export(__extenddftf2, .{ .name = "__extenddfkf2", .linkage = linkage });
321 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfsf2, .{ .name = "__trunckfsf2", .linkage = linkage });512 @export(__trunctfsf2, .{ .name = "__trunckfsf2", .linkage = linkage });
322 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfdf2, .{ .name = "__trunckfdf2", .linkage = linkage });513 @export(__trunctfdf2, .{ .name = "__trunckfdf2", .linkage = linkage });
323 @export(@import("compiler_rt/fixtfdi.zig").__fixtfdi, .{ .name = "__fixkfdi", .linkage = linkage });514 @export(__fixtfdi, .{ .name = "__fixkfdi", .linkage = linkage });
324 @export(@import("compiler_rt/fixtfsi.zig").__fixtfsi, .{ .name = "__fixkfsi", .linkage = linkage });515 @export(__fixtfsi, .{ .name = "__fixkfsi", .linkage = linkage });
325 @export(@import("compiler_rt/fixunstfsi.zig").__fixunstfsi, .{ .name = "__fixunskfsi", .linkage = linkage });516 @export(__fixunstfsi, .{ .name = "__fixunskfsi", .linkage = linkage });
326 @export(@import("compiler_rt/fixunstfdi.zig").__fixunstfdi, .{ .name = "__fixunskfdi", .linkage = linkage });517 @export(__fixunstfdi, .{ .name = "__fixunskfdi", .linkage = linkage });
327 @export(@import("compiler_rt/floatsiXf.zig").__floatsitf, .{ .name = "__floatsikf", .linkage = linkage });518 @export(__floatsitf, .{ .name = "__floatsikf", .linkage = linkage });
328 @export(@import("compiler_rt/floatditf.zig").__floatditf, .{ .name = "__floatdikf", .linkage = linkage });519 @export(__floatditf, .{ .name = "__floatdikf", .linkage = linkage });
329 @export(@import("compiler_rt/floatunditf.zig").__floatunditf, .{ .name = "__floatundikf", .linkage = linkage });520 @export(__floatunditf, .{ .name = "__floatundikf", .linkage = linkage });
330 @export(@import("compiler_rt/floatunsitf.zig").__floatunsitf, .{ .name = "__floatunsikf", .linkage = linkage });521 @export(__floatunsitf, .{ .name = "__floatunsikf", .linkage = linkage });
331522
332 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__eqkf2", .linkage = linkage });523 @export(__letf2, .{ .name = "__eqkf2", .linkage = linkage });
333 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__nekf2", .linkage = linkage });524 @export(__letf2, .{ .name = "__nekf2", .linkage = linkage });
334 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__gekf2", .linkage = linkage });525 @export(__getf2, .{ .name = "__gekf2", .linkage = linkage });
335 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__ltkf2", .linkage = linkage });526 @export(__letf2, .{ .name = "__ltkf2", .linkage = linkage });
336 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__lekf2", .linkage = linkage });527 @export(__letf2, .{ .name = "__lekf2", .linkage = linkage });
337 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__gtkf2", .linkage = linkage });528 @export(__getf2, .{ .name = "__gtkf2", .linkage = linkage });
338 @export(@import("compiler_rt/compareXf2.zig").__unordtf2, .{ .name = "__unordkf2", .linkage = linkage });529 @export(__unordtf2, .{ .name = "__unordkf2", .linkage = linkage });
339 }530 }
340531
341 if (builtin.os.tag == .windows) {532 if (builtin.os.tag == .windows) {
342 // Default stack-probe functions emitted by LLVM533 // Default stack-probe functions emitted by LLVM
343 if (is_mingw) {534 if (is_mingw) {
344 @export(@import("compiler_rt/stack_probe.zig")._chkstk, .{ .name = "_alloca", .linkage = strong_linkage });535 const _chkstk = @import("compiler_rt/stack_probe.zig")._chkstk;
345 @export(@import("compiler_rt/stack_probe.zig").___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = strong_linkage });536 @export(_chkstk, .{ .name = "_alloca", .linkage = strong_linkage });
537 const ___chkstk_ms = @import("compiler_rt/stack_probe.zig").___chkstk_ms;
538 @export(___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = strong_linkage });
346 } else if (!builtin.link_libc) {539 } else if (!builtin.link_libc) {
347 // This symbols are otherwise exported by MSVCRT.lib540 // This symbols are otherwise exported by MSVCRT.lib
348 @export(@import("compiler_rt/stack_probe.zig")._chkstk, .{ .name = "_chkstk", .linkage = strong_linkage });541 const _chkstk = @import("compiler_rt/stack_probe.zig")._chkstk;
349 @export(@import("compiler_rt/stack_probe.zig").__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage });542 @export(_chkstk, .{ .name = "_chkstk", .linkage = strong_linkage });
543 const __chkstk = @import("compiler_rt/stack_probe.zig").__chkstk;
544 @export(__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage });
350 }545 }
351546
352 switch (arch) {547 switch (arch) {
353 .i386 => {548 .i386 => {
354 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });549 const __divti3 = @import("compiler_rt/divti3.zig").__divti3;
355 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });550 @export(__divti3, .{ .name = "__divti3", .linkage = linkage });
356 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });551 const __modti3 = @import("compiler_rt/modti3.zig").__modti3;
357 @export(@import("compiler_rt/udivti3.zig").__udivti3, .{ .name = "__udivti3", .linkage = linkage });552 @export(__modti3, .{ .name = "__modti3", .linkage = linkage });
358 @export(@import("compiler_rt/udivmodti4.zig").__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });553 const __multi3 = @import("compiler_rt/multi3.zig").__multi3;
359 @export(@import("compiler_rt/umodti3.zig").__umodti3, .{ .name = "__umodti3", .linkage = linkage });554 @export(__multi3, .{ .name = "__multi3", .linkage = linkage });
555 const __udivti3 = @import("compiler_rt/udivti3.zig").__udivti3;
556 @export(__udivti3, .{ .name = "__udivti3", .linkage = linkage });
557 const __udivmodti4 = @import("compiler_rt/udivmodti4.zig").__udivmodti4;
558 @export(__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });
559 const __umodti3 = @import("compiler_rt/umodti3.zig").__umodti3;
560 @export(__umodti3, .{ .name = "__umodti3", .linkage = linkage });
360 },561 },
361 .x86_64 => {562 .x86_64 => {
362 // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI563 // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI
363 // that LLVM expects compiler-rt to have.564 // that LLVM expects compiler-rt to have.
364 @export(@import("compiler_rt/divti3.zig").__divti3_windows_x86_64, .{ .name = "__divti3", .linkage = linkage });565 const __divti3_windows_x86_64 = @import("compiler_rt/divti3.zig").__divti3_windows_x86_64;
365 @export(@import("compiler_rt/modti3.zig").__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = linkage });566 @export(__divti3_windows_x86_64, .{ .name = "__divti3", .linkage = linkage });
366 @export(@import("compiler_rt/multi3.zig").__multi3_windows_x86_64, .{ .name = "__multi3", .linkage = linkage });567 const __modti3_windows_x86_64 = @import("compiler_rt/modti3.zig").__modti3_windows_x86_64;
367 @export(@import("compiler_rt/udivti3.zig").__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = linkage });568 @export(__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = linkage });
368 @export(@import("compiler_rt/udivmodti4.zig").__udivmodti4_windows_x86_64, .{ .name = "__udivmodti4", .linkage = linkage });569 const __multi3_windows_x86_64 = @import("compiler_rt/multi3.zig").__multi3_windows_x86_64;
369 @export(@import("compiler_rt/umodti3.zig").__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = linkage });570 @export(__multi3_windows_x86_64, .{ .name = "__multi3", .linkage = linkage });
571 const __udivti3_windows_x86_64 = @import("compiler_rt/udivti3.zig").__udivti3_windows_x86_64;
572 @export(__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = linkage });
573 const __udivmodti4_windows_x86_64 = @import("compiler_rt/udivmodti4.zig").__udivmodti4_windows_x86_64;
574 @export(__udivmodti4_windows_x86_64, .{ .name = "__udivmodti4", .linkage = linkage });
575 const __umodti3_windows_x86_64 = @import("compiler_rt/umodti3.zig").__umodti3_windows_x86_64;
576 @export(__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = linkage });
370 },577 },
371 else => {},578 else => {},
372 }579 }
373 } else {580 } else {
374 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });581 const __divti3 = @import("compiler_rt/divti3.zig").__divti3;
375 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });582 @export(__divti3, .{ .name = "__divti3", .linkage = linkage });
376 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });583 const __modti3 = @import("compiler_rt/modti3.zig").__modti3;
377 @export(@import("compiler_rt/udivti3.zig").__udivti3, .{ .name = "__udivti3", .linkage = linkage });584 @export(__modti3, .{ .name = "__modti3", .linkage = linkage });
378 @export(@import("compiler_rt/udivmodti4.zig").__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });585 const __multi3 = @import("compiler_rt/multi3.zig").__multi3;
379 @export(@import("compiler_rt/umodti3.zig").__umodti3, .{ .name = "__umodti3", .linkage = linkage });586 @export(__multi3, .{ .name = "__multi3", .linkage = linkage });
587 const __udivti3 = @import("compiler_rt/udivti3.zig").__udivti3;
588 @export(__udivti3, .{ .name = "__udivti3", .linkage = linkage });
589 const __udivmodti4 = @import("compiler_rt/udivmodti4.zig").__udivmodti4;
590 @export(__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });
591 const __umodti3 = @import("compiler_rt/umodti3.zig").__umodti3;
592 @export(__umodti3, .{ .name = "__umodti3", .linkage = linkage });
380 }593 }
381 @export(@import("compiler_rt/muloti4.zig").__muloti4, .{ .name = "__muloti4", .linkage = linkage });594 const __muloti4 = @import("compiler_rt/muloti4.zig").__muloti4;
382 @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });595 @export(__muloti4, .{ .name = "__muloti4", .linkage = linkage });
596 const __mulodi4 = @import("compiler_rt/mulodi4.zig").__mulodi4;
597 @export(__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
383}598}
384599
385pub usingnamespace @import("compiler_rt/atomics.zig");600pub usingnamespace @import("compiler_rt/atomics.zig");
lib/std/special/compiler_rt/atomics.zig+85-45
...@@ -148,10 +148,14 @@ fn atomicLoadFn(comptime T: type) fn (*T, i32) callconv(.C) T {...@@ -148,10 +148,14 @@ fn atomicLoadFn(comptime T: type) fn (*T, i32) callconv(.C) T {
148148
149comptime {149comptime {
150 if (supports_atomic_ops) {150 if (supports_atomic_ops) {
151 @export(atomicLoadFn(u8), .{ .name = "__atomic_load_1", .linkage = linkage });151 const atomicLoad_u8 = atomicLoadFn(u8);
152 @export(atomicLoadFn(u16), .{ .name = "__atomic_load_2", .linkage = linkage });152 const atomicLoad_u16 = atomicLoadFn(u16);
153 @export(atomicLoadFn(u32), .{ .name = "__atomic_load_4", .linkage = linkage });153 const atomicLoad_u32 = atomicLoadFn(u32);
154 @export(atomicLoadFn(u64), .{ .name = "__atomic_load_8", .linkage = linkage });154 const atomicLoad_u64 = atomicLoadFn(u64);
155 @export(atomicLoad_u8, .{ .name = "__atomic_load_1", .linkage = linkage });
156 @export(atomicLoad_u16, .{ .name = "__atomic_load_2", .linkage = linkage });
157 @export(atomicLoad_u32, .{ .name = "__atomic_load_4", .linkage = linkage });
158 @export(atomicLoad_u64, .{ .name = "__atomic_load_8", .linkage = linkage });
155 }159 }
156}160}
157161
...@@ -171,10 +175,14 @@ fn atomicStoreFn(comptime T: type) fn (*T, T, i32) callconv(.C) void {...@@ -171,10 +175,14 @@ fn atomicStoreFn(comptime T: type) fn (*T, T, i32) callconv(.C) void {
171175
172comptime {176comptime {
173 if (supports_atomic_ops) {177 if (supports_atomic_ops) {
174 @export(atomicStoreFn(u8), .{ .name = "__atomic_store_1", .linkage = linkage });178 const atomicStore_u8 = atomicStoreFn(u8);
175 @export(atomicStoreFn(u16), .{ .name = "__atomic_store_2", .linkage = linkage });179 const atomicStore_u16 = atomicStoreFn(u16);
176 @export(atomicStoreFn(u32), .{ .name = "__atomic_store_4", .linkage = linkage });180 const atomicStore_u32 = atomicStoreFn(u32);
177 @export(atomicStoreFn(u64), .{ .name = "__atomic_store_8", .linkage = linkage });181 const atomicStore_u64 = atomicStoreFn(u64);
182 @export(atomicStore_u8, .{ .name = "__atomic_store_1", .linkage = linkage });
183 @export(atomicStore_u16, .{ .name = "__atomic_store_2", .linkage = linkage });
184 @export(atomicStore_u32, .{ .name = "__atomic_store_4", .linkage = linkage });
185 @export(atomicStore_u64, .{ .name = "__atomic_store_8", .linkage = linkage });
178 }186 }
179}187}
180188
...@@ -196,10 +204,14 @@ fn atomicExchangeFn(comptime T: type) fn (*T, T, i32) callconv(.C) T {...@@ -196,10 +204,14 @@ fn atomicExchangeFn(comptime T: type) fn (*T, T, i32) callconv(.C) T {
196204
197comptime {205comptime {
198 if (supports_atomic_ops) {206 if (supports_atomic_ops) {
199 @export(atomicExchangeFn(u8), .{ .name = "__atomic_exchange_1", .linkage = linkage });207 const atomicExchange_u8 = atomicExchangeFn(u8);
200 @export(atomicExchangeFn(u16), .{ .name = "__atomic_exchange_2", .linkage = linkage });208 const atomicExchange_u16 = atomicExchangeFn(u16);
201 @export(atomicExchangeFn(u32), .{ .name = "__atomic_exchange_4", .linkage = linkage });209 const atomicExchange_u32 = atomicExchangeFn(u32);
202 @export(atomicExchangeFn(u64), .{ .name = "__atomic_exchange_8", .linkage = linkage });210 const atomicExchange_u64 = atomicExchangeFn(u64);
211 @export(atomicExchange_u8, .{ .name = "__atomic_exchange_1", .linkage = linkage });
212 @export(atomicExchange_u16, .{ .name = "__atomic_exchange_2", .linkage = linkage });
213 @export(atomicExchange_u32, .{ .name = "__atomic_exchange_4", .linkage = linkage });
214 @export(atomicExchange_u64, .{ .name = "__atomic_exchange_8", .linkage = linkage });
203 }215 }
204}216}
205217
...@@ -229,10 +241,14 @@ fn atomicCompareExchangeFn(comptime T: type) fn (*T, *T, T, i32, i32) callconv(....@@ -229,10 +241,14 @@ fn atomicCompareExchangeFn(comptime T: type) fn (*T, *T, T, i32, i32) callconv(.
229241
230comptime {242comptime {
231 if (supports_atomic_ops) {243 if (supports_atomic_ops) {
232 @export(atomicCompareExchangeFn(u8), .{ .name = "__atomic_compare_exchange_1", .linkage = linkage });244 const atomicCompareExchange_u8 = atomicCompareExchangeFn(u8);
233 @export(atomicCompareExchangeFn(u16), .{ .name = "__atomic_compare_exchange_2", .linkage = linkage });245 const atomicCompareExchange_u16 = atomicCompareExchangeFn(u16);
234 @export(atomicCompareExchangeFn(u32), .{ .name = "__atomic_compare_exchange_4", .linkage = linkage });246 const atomicCompareExchange_u32 = atomicCompareExchangeFn(u32);
235 @export(atomicCompareExchangeFn(u64), .{ .name = "__atomic_compare_exchange_8", .linkage = linkage });247 const atomicCompareExchange_u64 = atomicCompareExchangeFn(u64);
248 @export(atomicCompareExchange_u8, .{ .name = "__atomic_compare_exchange_1", .linkage = linkage });
249 @export(atomicCompareExchange_u16, .{ .name = "__atomic_compare_exchange_2", .linkage = linkage });
250 @export(atomicCompareExchange_u32, .{ .name = "__atomic_compare_exchange_4", .linkage = linkage });
251 @export(atomicCompareExchange_u64, .{ .name = "__atomic_compare_exchange_8", .linkage = linkage });
236 }252 }
237}253}
238254
...@@ -264,34 +280,58 @@ fn fetchFn(comptime T: type, comptime op: builtin.AtomicRmwOp) fn (*T, T, i32) c...@@ -264,34 +280,58 @@ fn fetchFn(comptime T: type, comptime op: builtin.AtomicRmwOp) fn (*T, T, i32) c
264280
265comptime {281comptime {
266 if (supports_atomic_ops) {282 if (supports_atomic_ops) {
267 @export(fetchFn(u8, .Add), .{ .name = "__atomic_fetch_add_1", .linkage = linkage });283 const fetch_add_u8 = fetchFn(u8, .Add);
268 @export(fetchFn(u16, .Add), .{ .name = "__atomic_fetch_add_2", .linkage = linkage });284 const fetch_add_u16 = fetchFn(u16, .Add);
269 @export(fetchFn(u32, .Add), .{ .name = "__atomic_fetch_add_4", .linkage = linkage });285 const fetch_add_u32 = fetchFn(u32, .Add);
270 @export(fetchFn(u64, .Add), .{ .name = "__atomic_fetch_add_8", .linkage = linkage });286 const fetch_add_u64 = fetchFn(u64, .Add);
271287 @export(fetch_add_u8, .{ .name = "__atomic_fetch_add_1", .linkage = linkage });
272 @export(fetchFn(u8, .Sub), .{ .name = "__atomic_fetch_sub_1", .linkage = linkage });288 @export(fetch_add_u16, .{ .name = "__atomic_fetch_add_2", .linkage = linkage });
273 @export(fetchFn(u16, .Sub), .{ .name = "__atomic_fetch_sub_2", .linkage = linkage });289 @export(fetch_add_u32, .{ .name = "__atomic_fetch_add_4", .linkage = linkage });
274 @export(fetchFn(u32, .Sub), .{ .name = "__atomic_fetch_sub_4", .linkage = linkage });290 @export(fetch_add_u64, .{ .name = "__atomic_fetch_add_8", .linkage = linkage });
275 @export(fetchFn(u64, .Sub), .{ .name = "__atomic_fetch_sub_8", .linkage = linkage });291
276292 const fetch_sub_u8 = fetchFn(u8, .Sub);
277 @export(fetchFn(u8, .And), .{ .name = "__atomic_fetch_and_1", .linkage = linkage });293 const fetch_sub_u16 = fetchFn(u16, .Sub);
278 @export(fetchFn(u16, .And), .{ .name = "__atomic_fetch_and_2", .linkage = linkage });294 const fetch_sub_u32 = fetchFn(u32, .Sub);
279 @export(fetchFn(u32, .And), .{ .name = "__atomic_fetch_and_4", .linkage = linkage });295 const fetch_sub_u64 = fetchFn(u64, .Sub);
280 @export(fetchFn(u64, .And), .{ .name = "__atomic_fetch_and_8", .linkage = linkage });296 @export(fetch_sub_u8, .{ .name = "__atomic_fetch_sub_1", .linkage = linkage });
281297 @export(fetch_sub_u16, .{ .name = "__atomic_fetch_sub_2", .linkage = linkage });
282 @export(fetchFn(u8, .Or), .{ .name = "__atomic_fetch_or_1", .linkage = linkage });298 @export(fetch_sub_u32, .{ .name = "__atomic_fetch_sub_4", .linkage = linkage });
283 @export(fetchFn(u16, .Or), .{ .name = "__atomic_fetch_or_2", .linkage = linkage });299 @export(fetch_sub_u64, .{ .name = "__atomic_fetch_sub_8", .linkage = linkage });
284 @export(fetchFn(u32, .Or), .{ .name = "__atomic_fetch_or_4", .linkage = linkage });300
285 @export(fetchFn(u64, .Or), .{ .name = "__atomic_fetch_or_8", .linkage = linkage });301 const fetch_and_u8 = fetchFn(u8, .And);
286302 const fetch_and_u16 = fetchFn(u16, .And);
287 @export(fetchFn(u8, .Xor), .{ .name = "__atomic_fetch_xor_1", .linkage = linkage });303 const fetch_and_u32 = fetchFn(u32, .And);
288 @export(fetchFn(u16, .Xor), .{ .name = "__atomic_fetch_xor_2", .linkage = linkage });304 const fetch_and_u64 = fetchFn(u64, .And);
289 @export(fetchFn(u32, .Xor), .{ .name = "__atomic_fetch_xor_4", .linkage = linkage });305 @export(fetch_and_u8, .{ .name = "__atomic_fetch_and_1", .linkage = linkage });
290 @export(fetchFn(u64, .Xor), .{ .name = "__atomic_fetch_xor_8", .linkage = linkage });306 @export(fetch_and_u16, .{ .name = "__atomic_fetch_and_2", .linkage = linkage });
291307 @export(fetch_and_u32, .{ .name = "__atomic_fetch_and_4", .linkage = linkage });
292 @export(fetchFn(u8, .Nand), .{ .name = "__atomic_fetch_nand_1", .linkage = linkage });308 @export(fetch_and_u64, .{ .name = "__atomic_fetch_and_8", .linkage = linkage });
293 @export(fetchFn(u16, .Nand), .{ .name = "__atomic_fetch_nand_2", .linkage = linkage });309
294 @export(fetchFn(u32, .Nand), .{ .name = "__atomic_fetch_nand_4", .linkage = linkage });310 const fetch_or_u8 = fetchFn(u8, .Or);
295 @export(fetchFn(u64, .Nand), .{ .name = "__atomic_fetch_nand_8", .linkage = linkage });311 const fetch_or_u16 = fetchFn(u16, .Or);
312 const fetch_or_u32 = fetchFn(u32, .Or);
313 const fetch_or_u64 = fetchFn(u64, .Or);
314 @export(fetch_or_u8, .{ .name = "__atomic_fetch_or_1", .linkage = linkage });
315 @export(fetch_or_u16, .{ .name = "__atomic_fetch_or_2", .linkage = linkage });
316 @export(fetch_or_u32, .{ .name = "__atomic_fetch_or_4", .linkage = linkage });
317 @export(fetch_or_u64, .{ .name = "__atomic_fetch_or_8", .linkage = linkage });
318
319 const fetch_xor_u8 = fetchFn(u8, .Xor);
320 const fetch_xor_u16 = fetchFn(u16, .Xor);
321 const fetch_xor_u32 = fetchFn(u32, .Xor);
322 const fetch_xor_u64 = fetchFn(u64, .Xor);
323 @export(fetch_xor_u8, .{ .name = "__atomic_fetch_xor_1", .linkage = linkage });
324 @export(fetch_xor_u16, .{ .name = "__atomic_fetch_xor_2", .linkage = linkage });
325 @export(fetch_xor_u32, .{ .name = "__atomic_fetch_xor_4", .linkage = linkage });
326 @export(fetch_xor_u64, .{ .name = "__atomic_fetch_xor_8", .linkage = linkage });
327
328 const fetch_nand_u8 = fetchFn(u8, .Nand);
329 const fetch_nand_u16 = fetchFn(u16, .Nand);
330 const fetch_nand_u32 = fetchFn(u32, .Nand);
331 const fetch_nand_u64 = fetchFn(u64, .Nand);
332 @export(fetch_nand_u8, .{ .name = "__atomic_fetch_nand_1", .linkage = linkage });
333 @export(fetch_nand_u16, .{ .name = "__atomic_fetch_nand_2", .linkage = linkage });
334 @export(fetch_nand_u32, .{ .name = "__atomic_fetch_nand_4", .linkage = linkage });
335 @export(fetch_nand_u64, .{ .name = "__atomic_fetch_nand_8", .linkage = linkage });
296 }336 }
297}337}
lib/std/zig/parse.zig+42-15
...@@ -2005,9 +2005,12 @@ const Parser = struct {...@@ -2005,9 +2005,12 @@ const Parser = struct {
2005 if (field_init != 0) {2005 if (field_init != 0) {
2006 try p.scratch.append(p.gpa, field_init);2006 try p.scratch.append(p.gpa, field_init);
2007 while (true) {2007 while (true) {
2008 switch (p.token_tags[p.tok_i]) {2008 switch (p.token_tags[p.tok_i]) {
2009 .comma => p.tok_i += 1,2009 .comma => p.tok_i += 1,
2010 .r_brace => { p.tok_i += 1; break; },2010 .r_brace => {
2011 p.tok_i += 1;
2012 break;
2013 },
2011 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),2014 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),
2012 // Likely just a missing comma; give error but continue parsing.2015 // Likely just a missing comma; give error but continue parsing.
2013 else => try p.warnExpected(.comma),2016 else => try p.warnExpected(.comma),
...@@ -2045,7 +2048,10 @@ const Parser = struct {...@@ -2045,7 +2048,10 @@ const Parser = struct {
2045 try p.scratch.append(p.gpa, elem_init);2048 try p.scratch.append(p.gpa, elem_init);
2046 switch (p.token_tags[p.tok_i]) {2049 switch (p.token_tags[p.tok_i]) {
2047 .comma => p.tok_i += 1,2050 .comma => p.tok_i += 1,
2048 .r_brace => { p.tok_i += 1; break; },2051 .r_brace => {
2052 p.tok_i += 1;
2053 break;
2054 },
2049 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),2055 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),
2050 // Likely just a missing comma; give error but continue parsing.2056 // Likely just a missing comma; give error but continue parsing.
2051 else => try p.warnExpected(.comma),2057 else => try p.warnExpected(.comma),
...@@ -2121,7 +2127,10 @@ const Parser = struct {...@@ -2121,7 +2127,10 @@ const Parser = struct {
2121 try p.scratch.append(p.gpa, param);2127 try p.scratch.append(p.gpa, param);
2122 switch (p.token_tags[p.tok_i]) {2128 switch (p.token_tags[p.tok_i]) {
2123 .comma => p.tok_i += 1,2129 .comma => p.tok_i += 1,
2124 .r_paren => { p.tok_i += 1; break; },2130 .r_paren => {
2131 p.tok_i += 1;
2132 break;
2133 },
2125 .colon, .r_brace, .r_bracket => return p.failExpected(.r_paren),2134 .colon, .r_brace, .r_bracket => return p.failExpected(.r_paren),
2126 // Likely just a missing comma; give error but continue parsing.2135 // Likely just a missing comma; give error but continue parsing.
2127 else => try p.warnExpected(.comma),2136 else => try p.warnExpected(.comma),
...@@ -2129,7 +2138,7 @@ const Parser = struct {...@@ -2129,7 +2138,7 @@ const Parser = struct {
2129 }2138 }
2130 const comma = (p.token_tags[p.tok_i - 2] == .comma);2139 const comma = (p.token_tags[p.tok_i - 2] == .comma);
2131 const params = p.scratch.items[scratch_top..];2140 const params = p.scratch.items[scratch_top..];
2132 switch(params.len) {2141 switch (params.len) {
2133 0 => return p.addNode(.{2142 0 => return p.addNode(.{
2134 .tag = if (comma) .async_call_one_comma else .async_call_one,2143 .tag = if (comma) .async_call_one_comma else .async_call_one,
2135 .main_token = lparen,2144 .main_token = lparen,
...@@ -2174,7 +2183,10 @@ const Parser = struct {...@@ -2174,7 +2183,10 @@ const Parser = struct {
2174 try p.scratch.append(p.gpa, param);2183 try p.scratch.append(p.gpa, param);
2175 switch (p.token_tags[p.tok_i]) {2184 switch (p.token_tags[p.tok_i]) {
2176 .comma => p.tok_i += 1,2185 .comma => p.tok_i += 1,
2177 .r_paren => { p.tok_i += 1; break; },2186 .r_paren => {
2187 p.tok_i += 1;
2188 break;
2189 },
2178 .colon, .r_brace, .r_bracket => return p.failExpected(.r_paren),2190 .colon, .r_brace, .r_bracket => return p.failExpected(.r_paren),
2179 // Likely just a missing comma; give error but continue parsing.2191 // Likely just a missing comma; give error but continue parsing.
2180 else => try p.warnExpected(.comma),2192 else => try p.warnExpected(.comma),
...@@ -2182,7 +2194,7 @@ const Parser = struct {...@@ -2182,7 +2194,7 @@ const Parser = struct {
2182 }2194 }
2183 const comma = (p.token_tags[p.tok_i - 2] == .comma);2195 const comma = (p.token_tags[p.tok_i - 2] == .comma);
2184 const params = p.scratch.items[scratch_top..];2196 const params = p.scratch.items[scratch_top..];
2185 res = switch(params.len) {2197 res = switch (params.len) {
2186 0 => try p.addNode(.{2198 0 => try p.addNode(.{
2187 .tag = if (comma) .call_one_comma else .call_one,2199 .tag = if (comma) .call_one_comma else .call_one,
2188 .main_token = lparen,2200 .main_token = lparen,
...@@ -2448,7 +2460,10 @@ const Parser = struct {...@@ -2448,7 +2460,10 @@ const Parser = struct {
2448 while (true) {2460 while (true) {
2449 switch (p.token_tags[p.tok_i]) {2461 switch (p.token_tags[p.tok_i]) {
2450 .comma => p.tok_i += 1,2462 .comma => p.tok_i += 1,
2451 .r_brace => { p.tok_i += 1; break; },2463 .r_brace => {
2464 p.tok_i += 1;
2465 break;
2466 },
2452 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),2467 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),
2453 // Likely just a missing comma; give error but continue parsing.2468 // Likely just a missing comma; give error but continue parsing.
2454 else => try p.warnExpected(.comma),2469 else => try p.warnExpected(.comma),
...@@ -2497,7 +2512,10 @@ const Parser = struct {...@@ -2497,7 +2512,10 @@ const Parser = struct {
2497 try p.scratch.append(p.gpa, elem_init);2512 try p.scratch.append(p.gpa, elem_init);
2498 switch (p.token_tags[p.tok_i]) {2513 switch (p.token_tags[p.tok_i]) {
2499 .comma => p.tok_i += 1,2514 .comma => p.tok_i += 1,
2500 .r_brace => { p.tok_i += 1; break; },2515 .r_brace => {
2516 p.tok_i += 1;
2517 break;
2518 },
2501 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),2519 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),
2502 // Likely just a missing comma; give error but continue parsing.2520 // Likely just a missing comma; give error but continue parsing.
2503 else => try p.warnExpected(.comma),2521 else => try p.warnExpected(.comma),
...@@ -2555,7 +2573,10 @@ const Parser = struct {...@@ -2555,7 +2573,10 @@ const Parser = struct {
2555 const identifier = try p.expectToken(.identifier);2573 const identifier = try p.expectToken(.identifier);
2556 switch (p.token_tags[p.tok_i]) {2574 switch (p.token_tags[p.tok_i]) {
2557 .comma => p.tok_i += 1,2575 .comma => p.tok_i += 1,
2558 .r_brace => { p.tok_i += 1; break; },2576 .r_brace => {
2577 p.tok_i += 1;
2578 break;
2579 },
2559 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),2580 .colon, .r_paren, .r_bracket => return p.failExpected(.r_brace),
2560 // Likely just a missing comma; give error but continue parsing.2581 // Likely just a missing comma; give error but continue parsing.
2561 else => try p.warnExpected(.comma),2582 else => try p.warnExpected(.comma),
...@@ -2992,14 +3013,14 @@ const Parser = struct {...@@ -2992,14 +3013,14 @@ const Parser = struct {
2992 _ = try p.parsePtrPayload();3013 _ = try p.parsePtrPayload();
29933014
2994 const items = p.scratch.items[scratch_top..];3015 const items = p.scratch.items[scratch_top..];
2995 switch(items.len) {3016 switch (items.len) {
2996 0 => return p.addNode(.{3017 0 => return p.addNode(.{
2997 .tag = .switch_case_one,3018 .tag = .switch_case_one,
2998 .main_token = arrow_token,3019 .main_token = arrow_token,
2999 .data = .{3020 .data = .{
3000 .lhs = 0,3021 .lhs = 0,
3001 .rhs = try p.expectAssignExpr(),3022 .rhs = try p.expectAssignExpr(),
3002 }3023 },
3003 }),3024 }),
3004 1 => return p.addNode(.{3025 1 => return p.addNode(.{
3005 .tag = .switch_case_one,3026 .tag = .switch_case_one,
...@@ -3007,7 +3028,7 @@ const Parser = struct {...@@ -3007,7 +3028,7 @@ const Parser = struct {
3007 .data = .{3028 .data = .{
3008 .lhs = items[0],3029 .lhs = items[0],
3009 .rhs = try p.expectAssignExpr(),3030 .rhs = try p.expectAssignExpr(),
3010 }3031 },
3011 }),3032 }),
3012 else => return p.addNode(.{3033 else => return p.addNode(.{
3013 .tag = .switch_case,3034 .tag = .switch_case,
...@@ -3375,7 +3396,10 @@ const Parser = struct {...@@ -3375,7 +3396,10 @@ const Parser = struct {
3375 }3396 }
3376 switch (p.token_tags[p.tok_i]) {3397 switch (p.token_tags[p.tok_i]) {
3377 .comma => p.tok_i += 1,3398 .comma => p.tok_i += 1,
3378 .r_paren => { p.tok_i += 1; break; },3399 .r_paren => {
3400 p.tok_i += 1;
3401 break;
3402 },
3379 .colon, .r_brace, .r_bracket => return p.failExpected(.r_paren),3403 .colon, .r_brace, .r_bracket => return p.failExpected(.r_paren),
3380 // Likely just a missing comma; give error but continue parsing.3404 // Likely just a missing comma; give error but continue parsing.
3381 else => try p.warnExpected(.comma),3405 else => try p.warnExpected(.comma),
...@@ -3444,7 +3468,10 @@ const Parser = struct {...@@ -3444,7 +3468,10 @@ const Parser = struct {
3444 try p.scratch.append(p.gpa, param);3468 try p.scratch.append(p.gpa, param);
3445 switch (p.token_tags[p.tok_i]) {3469 switch (p.token_tags[p.tok_i]) {
3446 .comma => p.tok_i += 1,3470 .comma => p.tok_i += 1,
3447 .r_paren => { p.tok_i += 1; break; },3471 .r_paren => {
3472 p.tok_i += 1;
3473 break;
3474 },
3448 // Likely just a missing comma; give error but continue parsing.3475 // Likely just a missing comma; give error but continue parsing.
3449 else => try p.warnExpected(.comma),3476 else => try p.warnExpected(.comma),
3450 }3477 }
src/AstGen.zig+7-3
...@@ -59,7 +59,7 @@ fn appendRefsAssumeCapacity(astgen: *AstGen, refs: []const Zir.Inst.Ref) void {...@@ -59,7 +59,7 @@ fn appendRefsAssumeCapacity(astgen: *AstGen, refs: []const Zir.Inst.Ref) void {
59 astgen.extra.appendSliceAssumeCapacity(coerced);59 astgen.extra.appendSliceAssumeCapacity(coerced);
60}60}
6161
62pub fn generate(gpa: *Allocator, tree: ast.Tree) InnerError!Zir {62pub fn generate(gpa: *Allocator, tree: ast.Tree) Allocator.Error!Zir {
63 var arena = std.heap.ArenaAllocator.init(gpa);63 var arena = std.heap.ArenaAllocator.init(gpa);
64 defer arena.deinit();64 defer arena.deinit();
6565
...@@ -662,7 +662,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr...@@ -662,7 +662,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
662 const lhs = try expr(gz, scope, .ref, node_datas[node].lhs);662 const lhs = try expr(gz, scope, .ref, node_datas[node].lhs);
663 const extra = tree.extraData(node_datas[node].rhs, ast.Node.SliceSentinel);663 const extra = tree.extraData(node_datas[node].rhs, ast.Node.SliceSentinel);
664 const start = try expr(gz, scope, .{ .ty = .usize_type }, extra.start);664 const start = try expr(gz, scope, .{ .ty = .usize_type }, extra.start);
665 const end = try expr(gz, scope, .{ .ty = .usize_type }, extra.end);665 const end = if (extra.end != 0) try expr(gz, scope, .{ .ty = .usize_type }, extra.end) else .none;
666 const sentinel = try expr(gz, scope, .{ .ty = .usize_type }, extra.sentinel);666 const sentinel = try expr(gz, scope, .{ .ty = .usize_type }, extra.sentinel);
667 const result = try gz.addPlNode(.slice_sentinel, node, Zir.Inst.SliceSentinel{667 const result = try gz.addPlNode(.slice_sentinel, node, Zir.Inst.SliceSentinel{
668 .lhs = lhs,668 .lhs = lhs,
...@@ -3877,6 +3877,10 @@ fn containerDecl(...@@ -3877,6 +3877,10 @@ fn containerDecl(
3877 const node_tags = tree.nodes.items(.tag);3877 const node_tags = tree.nodes.items(.tag);
3878 const node_datas = tree.nodes.items(.data);3878 const node_datas = tree.nodes.items(.data);
38793879
3880 const prev_fn_block = astgen.fn_block;
3881 astgen.fn_block = null;
3882 defer astgen.fn_block = prev_fn_block;
3883
3880 // We must not create any types until Sema. Here the goal is only to generate3884 // We must not create any types until Sema. Here the goal is only to generate
3881 // ZIR for all the field types, alignments, and default value expressions.3885 // ZIR for all the field types, alignments, and default value expressions.
38823886
...@@ -3976,7 +3980,7 @@ fn containerDecl(...@@ -3976,7 +3980,7 @@ fn containerDecl(
3976 .nonexhaustive_node = nonexhaustive_node,3980 .nonexhaustive_node = nonexhaustive_node,
3977 };3981 };
3978 };3982 };
3979 if (counts.total_fields == 0) {3983 if (counts.total_fields == 0 and counts.nonexhaustive_node == 0) {
3980 // One can construct an enum with no tags, and it functions the same as `noreturn`. But3984 // One can construct an enum with no tags, and it functions the same as `noreturn`. But
3981 // this is only useful for generic code; when explicitly using `enum {}` syntax, there3985 // this is only useful for generic code; when explicitly using `enum {}` syntax, there
3982 // must be at least one tag.3986 // must be at least one tag.
src/clang.zig+20-20
...@@ -45,7 +45,7 @@ pub const APValueLValueBase = extern struct {...@@ -45,7 +45,7 @@ pub const APValueLValueBase = extern struct {
45 extern fn ZigClangAPValueLValueBase_dyn_cast_Expr(APValueLValueBase) ?*const Expr;45 extern fn ZigClangAPValueLValueBase_dyn_cast_Expr(APValueLValueBase) ?*const Expr;
46};46};
4747
48pub const APValueKind = extern enum {48pub const APValueKind = enum(c_int) {
49 None,49 None,
50 Indeterminate,50 Indeterminate,
51 Int,51 Int,
...@@ -105,7 +105,7 @@ pub const APFloat = opaque {...@@ -105,7 +105,7 @@ pub const APFloat = opaque {
105 extern fn ZigClangAPFloat_toString(*const APFloat, precision: c_uint, maxPadding: c_uint, truncateZero: bool) [*:0]const u8;105 extern fn ZigClangAPFloat_toString(*const APFloat, precision: c_uint, maxPadding: c_uint, truncateZero: bool) [*:0]const u8;
106};106};
107107
108pub const APFloatBaseSemantics = extern enum {108pub const APFloatBaseSemantics = enum(c_int) {
109 IEEEhalf,109 IEEEhalf,
110 BFloat,110 BFloat,
111 IEEEsingle,111 IEEEsingle,
...@@ -1037,7 +1037,7 @@ pub const InitListExpr = opaque {...@@ -1037,7 +1037,7 @@ pub const InitListExpr = opaque {
1037 extern fn ZigClangInitListExpr_getInitializedFieldInUnion(*const InitListExpr) ?*FieldDecl;1037 extern fn ZigClangInitListExpr_getInitializedFieldInUnion(*const InitListExpr) ?*FieldDecl;
1038};1038};
10391039
1040pub const BO = extern enum {1040pub const BO = enum(c_int) {
1041 PtrMemD,1041 PtrMemD,
1042 PtrMemI,1042 PtrMemI,
1043 Mul,1043 Mul,
...@@ -1073,7 +1073,7 @@ pub const BO = extern enum {...@@ -1073,7 +1073,7 @@ pub const BO = extern enum {
1073 Comma,1073 Comma,
1074};1074};
10751075
1076pub const UO = extern enum {1076pub const UO = enum(c_int) {
1077 PostInc,1077 PostInc,
1078 PostDec,1078 PostDec,
1079 PreInc,1079 PreInc,
...@@ -1090,7 +1090,7 @@ pub const UO = extern enum {...@@ -1090,7 +1090,7 @@ pub const UO = extern enum {
1090 Coawait,1090 Coawait,
1091};1091};
10921092
1093pub const TypeClass = extern enum {1093pub const TypeClass = enum(c_int) {
1094 Adjusted,1094 Adjusted,
1095 Decayed,1095 Decayed,
1096 ConstantArray,1096 ConstantArray,
...@@ -1145,7 +1145,7 @@ pub const TypeClass = extern enum {...@@ -1145,7 +1145,7 @@ pub const TypeClass = extern enum {
1145 ExtVector,1145 ExtVector,
1146};1146};
11471147
1148const StmtClass = extern enum {1148const StmtClass = enum(c_int) {
1149 NoStmtClass,1149 NoStmtClass,
1150 GCCAsmStmtClass,1150 GCCAsmStmtClass,
1151 MSAsmStmtClass,1151 MSAsmStmtClass,
...@@ -1362,7 +1362,7 @@ const StmtClass = extern enum {...@@ -1362,7 +1362,7 @@ const StmtClass = extern enum {
1362 WhileStmtClass,1362 WhileStmtClass,
1363};1363};
13641364
1365pub const CK = extern enum {1365pub const CK = enum(c_int) {
1366 Dependent,1366 Dependent,
1367 BitCast,1367 BitCast,
1368 LValueBitCast,1368 LValueBitCast,
...@@ -1429,7 +1429,7 @@ pub const CK = extern enum {...@@ -1429,7 +1429,7 @@ pub const CK = extern enum {
1429 IntToOCLSampler,1429 IntToOCLSampler,
1430};1430};
14311431
1432pub const DeclKind = extern enum {1432pub const DeclKind = enum(c_int) {
1433 AccessSpec,1433 AccessSpec,
1434 Block,1434 Block,
1435 Captured,1435 Captured,
...@@ -1513,7 +1513,7 @@ pub const DeclKind = extern enum {...@@ -1513,7 +1513,7 @@ pub const DeclKind = extern enum {
1513 TranslationUnit,1513 TranslationUnit,
1514};1514};
15151515
1516pub const BuiltinTypeKind = extern enum {1516pub const BuiltinTypeKind = enum(c_int) {
1517 OCLImage1dRO,1517 OCLImage1dRO,
1518 OCLImage1dArrayRO,1518 OCLImage1dArrayRO,
1519 OCLImage1dBufferRO,1519 OCLImage1dBufferRO,
...@@ -1687,7 +1687,7 @@ pub const BuiltinTypeKind = extern enum {...@@ -1687,7 +1687,7 @@ pub const BuiltinTypeKind = extern enum {
1687 OMPIterator,1687 OMPIterator,
1688};1688};
16891689
1690pub const CallingConv = extern enum {1690pub const CallingConv = enum(c_int) {
1691 C,1691 C,
1692 X86StdCall,1692 X86StdCall,
1693 X86FastCall,1693 X86FastCall,
...@@ -1708,7 +1708,7 @@ pub const CallingConv = extern enum {...@@ -1708,7 +1708,7 @@ pub const CallingConv = extern enum {
1708 AArch64VectorCall,1708 AArch64VectorCall,
1709};1709};
17101710
1711pub const StorageClass = extern enum {1711pub const StorageClass = enum(c_int) {
1712 None,1712 None,
1713 Extern,1713 Extern,
1714 Static,1714 Static,
...@@ -1717,7 +1717,7 @@ pub const StorageClass = extern enum {...@@ -1717,7 +1717,7 @@ pub const StorageClass = extern enum {
1717 Register,1717 Register,
1718};1718};
17191719
1720pub const APFloat_roundingMode = extern enum(i8) {1720pub const APFloat_roundingMode = enum(i8) {
1721 TowardZero = 0,1721 TowardZero = 0,
1722 NearestTiesToEven = 1,1722 NearestTiesToEven = 1,
1723 TowardPositive = 2,1723 TowardPositive = 2,
...@@ -1727,7 +1727,7 @@ pub const APFloat_roundingMode = extern enum(i8) {...@@ -1727,7 +1727,7 @@ pub const APFloat_roundingMode = extern enum(i8) {
1727 Invalid = -1,1727 Invalid = -1,
1728};1728};
17291729
1730pub const StringLiteral_StringKind = extern enum {1730pub const StringLiteral_StringKind = enum(c_int) {
1731 Ascii,1731 Ascii,
1732 Wide,1732 Wide,
1733 UTF8,1733 UTF8,
...@@ -1735,7 +1735,7 @@ pub const StringLiteral_StringKind = extern enum {...@@ -1735,7 +1735,7 @@ pub const StringLiteral_StringKind = extern enum {
1735 UTF32,1735 UTF32,
1736};1736};
17371737
1738pub const CharacterLiteral_CharacterKind = extern enum {1738pub const CharacterLiteral_CharacterKind = enum(c_int) {
1739 Ascii,1739 Ascii,
1740 Wide,1740 Wide,
1741 UTF8,1741 UTF8,
...@@ -1743,13 +1743,13 @@ pub const CharacterLiteral_CharacterKind = extern enum {...@@ -1743,13 +1743,13 @@ pub const CharacterLiteral_CharacterKind = extern enum {
1743 UTF32,1743 UTF32,
1744};1744};
17451745
1746pub const VarDecl_TLSKind = extern enum {1746pub const VarDecl_TLSKind = enum(c_int) {
1747 None,1747 None,
1748 Static,1748 Static,
1749 Dynamic,1749 Dynamic,
1750};1750};
17511751
1752pub const ElaboratedTypeKeyword = extern enum {1752pub const ElaboratedTypeKeyword = enum(c_int) {
1753 Struct,1753 Struct,
1754 Interface,1754 Interface,
1755 Union,1755 Union,
...@@ -1759,21 +1759,21 @@ pub const ElaboratedTypeKeyword = extern enum {...@@ -1759,21 +1759,21 @@ pub const ElaboratedTypeKeyword = extern enum {
1759 None,1759 None,
1760};1760};
17611761
1762pub const PreprocessedEntity_EntityKind = extern enum {1762pub const PreprocessedEntity_EntityKind = enum(c_int) {
1763 InvalidKind,1763 InvalidKind,
1764 MacroExpansionKind,1764 MacroExpansionKind,
1765 MacroDefinitionKind,1765 MacroDefinitionKind,
1766 InclusionDirectiveKind,1766 InclusionDirectiveKind,
1767};1767};
17681768
1769pub const Expr_ConstantExprKind = extern enum {1769pub const Expr_ConstantExprKind = enum(c_int) {
1770 Normal,1770 Normal,
1771 NonClassTemplateArgument,1771 NonClassTemplateArgument,
1772 ClassTemplateArgument,1772 ClassTemplateArgument,
1773 ImmediateInvocation,1773 ImmediateInvocation,
1774};1774};
17751775
1776pub const UnaryExprOrTypeTrait_Kind = extern enum {1776pub const UnaryExprOrTypeTrait_Kind = enum(c_int) {
1777 SizeOf,1777 SizeOf,
1778 AlignOf,1778 AlignOf,
1779 VecStep,1779 VecStep,
...@@ -1781,7 +1781,7 @@ pub const UnaryExprOrTypeTrait_Kind = extern enum {...@@ -1781,7 +1781,7 @@ pub const UnaryExprOrTypeTrait_Kind = extern enum {
1781 PreferredAlignOf,1781 PreferredAlignOf,
1782};1782};
17831783
1784pub const OffsetOfNode_Kind = extern enum {1784pub const OffsetOfNode_Kind = enum(c_int) {
1785 Array,1785 Array,
1786 Field,1786 Field,
1787 Identifier,1787 Identifier,
src/codegen/llvm/bindings.zig+9-9
...@@ -131,7 +131,7 @@ extern fn LLVMLookupIntrinsicID(Name: [*]const u8, NameLen: usize) c_uint;...@@ -131,7 +131,7 @@ extern fn LLVMLookupIntrinsicID(Name: [*]const u8, NameLen: usize) c_uint;
131pub const disposeMessage = LLVMDisposeMessage;131pub const disposeMessage = LLVMDisposeMessage;
132extern fn LLVMDisposeMessage(Message: [*:0]const u8) void;132extern fn LLVMDisposeMessage(Message: [*:0]const u8) void;
133133
134pub const VerifierFailureAction = extern enum {134pub const VerifierFailureAction = enum(c_int) {
135 AbortProcess,135 AbortProcess,
136 PrintMessage,136 PrintMessage,
137 ReturnStatus,137 ReturnStatus,
...@@ -228,7 +228,7 @@ pub const Builder = opaque {...@@ -228,7 +228,7 @@ pub const Builder = opaque {
228 extern fn LLVMBuildExtractValue(*const Builder, AggVal: *const Value, Index: c_uint, Name: [*:0]const u8) *const Value;228 extern fn LLVMBuildExtractValue(*const Builder, AggVal: *const Value, Index: c_uint, Name: [*:0]const u8) *const Value;
229};229};
230230
231pub const IntPredicate = extern enum {231pub const IntPredicate = enum(c_int) {
232 EQ = 32,232 EQ = 32,
233 NE = 33,233 NE = 33,
234 UGT = 34,234 UGT = 34,
...@@ -274,7 +274,7 @@ pub const TargetMachine = opaque {...@@ -274,7 +274,7 @@ pub const TargetMachine = opaque {
274 ) Bool;274 ) Bool;
275};275};
276276
277pub const CodeMode = extern enum {277pub const CodeMode = enum(c_int) {
278 Default,278 Default,
279 JITDefault,279 JITDefault,
280 Tiny,280 Tiny,
...@@ -284,14 +284,14 @@ pub const CodeMode = extern enum {...@@ -284,14 +284,14 @@ pub const CodeMode = extern enum {
284 Large,284 Large,
285};285};
286286
287pub const CodeGenOptLevel = extern enum {287pub const CodeGenOptLevel = enum(c_int) {
288 None,288 None,
289 Less,289 Less,
290 Default,290 Default,
291 Aggressive,291 Aggressive,
292};292};
293293
294pub const RelocMode = extern enum {294pub const RelocMode = enum(c_int) {
295 Default,295 Default,
296 Static,296 Static,
297 PIC,297 PIC,
...@@ -301,7 +301,7 @@ pub const RelocMode = extern enum {...@@ -301,7 +301,7 @@ pub const RelocMode = extern enum {
301 ROPI_RWPI,301 ROPI_RWPI,
302};302};
303303
304pub const CodeGenFileType = extern enum {304pub const CodeGenFileType = enum(c_int) {
305 AssemblyFile,305 AssemblyFile,
306 ObjectFile,306 ObjectFile,
307};307};
...@@ -504,7 +504,7 @@ pub const LinkELF = ZigLLDLinkELF;...@@ -504,7 +504,7 @@ pub const LinkELF = ZigLLDLinkELF;
504pub const LinkMachO = ZigLLDLinkMachO;504pub const LinkMachO = ZigLLDLinkMachO;
505pub const LinkWasm = ZigLLDLinkWasm;505pub const LinkWasm = ZigLLDLinkWasm;
506506
507pub const ObjectFormatType = extern enum(c_int) {507pub const ObjectFormatType = enum(c_int) {
508 Unknown,508 Unknown,
509 COFF,509 COFF,
510 ELF,510 ELF,
...@@ -528,7 +528,7 @@ extern fn ZigLLVMWriteArchive(...@@ -528,7 +528,7 @@ extern fn ZigLLVMWriteArchive(
528 os_type: OSType,528 os_type: OSType,
529) bool;529) bool;
530530
531pub const OSType = extern enum(c_int) {531pub const OSType = enum(c_int) {
532 UnknownOS,532 UnknownOS,
533 Ananas,533 Ananas,
534 CloudABI,534 CloudABI,
...@@ -567,7 +567,7 @@ pub const OSType = extern enum(c_int) {...@@ -567,7 +567,7 @@ pub const OSType = extern enum(c_int) {
567 Emscripten,567 Emscripten,
568};568};
569569
570pub const ArchType = extern enum(c_int) {570pub const ArchType = enum(c_int) {
571 UnknownArch,571 UnknownArch,
572 arm,572 arm,
573 armeb,573 armeb,
src/codegen/spirv/spec.zig+31-60
...@@ -3,7 +3,7 @@...@@ -3,7 +3,7 @@
3const Version = @import("std").builtin.Version;3const Version = @import("std").builtin.Version;
4pub const version = Version{ .major = 1, .minor = 5, .patch = 4 };4pub const version = Version{ .major = 1, .minor = 5, .patch = 4 };
5pub const magic_number: u32 = 0x07230203;5pub const magic_number: u32 = 0x07230203;
6pub const Opcode = extern enum(u16) {6pub const Opcode = enum(u16) {
7 OpNop = 0,7 OpNop = 0,
8 OpUndef = 1,8 OpUndef = 1,
9 OpSourceContinued = 2,9 OpSourceContinued = 2,
...@@ -382,12 +382,10 @@ pub const Opcode = extern enum(u16) {...@@ -382,12 +382,10 @@ pub const Opcode = extern enum(u16) {
382 OpGroupNonUniformPartitionNV = 5296,382 OpGroupNonUniformPartitionNV = 5296,
383 OpWritePackedPrimitiveIndices4x8NV = 5299,383 OpWritePackedPrimitiveIndices4x8NV = 5299,
384 OpReportIntersectionNV = 5334,384 OpReportIntersectionNV = 5334,
385 OpReportIntersectionKHR = 5334,
386 OpIgnoreIntersectionNV = 5335,385 OpIgnoreIntersectionNV = 5335,
387 OpTerminateRayNV = 5336,386 OpTerminateRayNV = 5336,
388 OpTraceNV = 5337,387 OpTraceNV = 5337,
389 OpTypeAccelerationStructureNV = 5341,388 OpTypeAccelerationStructureNV = 5341,
390 OpTypeAccelerationStructureKHR = 5341,
391 OpExecuteCallableNV = 5344,389 OpExecuteCallableNV = 5344,
392 OpTypeCooperativeMatrixNV = 5358,390 OpTypeCooperativeMatrixNV = 5358,
393 OpCooperativeMatrixLoadNV = 5359,391 OpCooperativeMatrixLoadNV = 5359,
...@@ -432,9 +430,7 @@ pub const Opcode = extern enum(u16) {...@@ -432,9 +430,7 @@ pub const Opcode = extern enum(u16) {
432 OpAssumeTrueKHR = 5630,430 OpAssumeTrueKHR = 5630,
433 OpExpectKHR = 5631,431 OpExpectKHR = 5631,
434 OpDecorateString = 5632,432 OpDecorateString = 5632,
435 OpDecorateStringGOOGLE = 5632,
436 OpMemberDecorateString = 5633,433 OpMemberDecorateString = 5633,
437 OpMemberDecorateStringGOOGLE = 5633,
438 OpVmeImageINTEL = 5699,434 OpVmeImageINTEL = 5699,
439 OpTypeVmeImageINTEL = 5700,435 OpTypeVmeImageINTEL = 5700,
440 OpTypeAvcImePayloadINTEL = 5701,436 OpTypeAvcImePayloadINTEL = 5701,
...@@ -585,6 +581,9 @@ pub const Opcode = extern enum(u16) {...@@ -585,6 +581,9 @@ pub const Opcode = extern enum(u16) {
585 OpConstantCompositeContinuedINTEL = 6091,581 OpConstantCompositeContinuedINTEL = 6091,
586 OpSpecConstantCompositeContinuedINTEL = 6092,582 OpSpecConstantCompositeContinuedINTEL = 6092,
587 _,583 _,
584
585 const OpReportIntersectionKHR = OpReportIntersectionNV;
586 const OpTypeAccelerationStructureKHR = OpTypeAccelerationStructureNV;
588};587};
589pub const ImageOperands = packed struct {588pub const ImageOperands = packed struct {
590 Bias: bool align(@alignOf(u32)) = false,589 Bias: bool align(@alignOf(u32)) = false,
...@@ -926,7 +925,7 @@ pub const FragmentShadingRate = packed struct {...@@ -926,7 +925,7 @@ pub const FragmentShadingRate = packed struct {
926 _reserved_bit_30: bool = false,925 _reserved_bit_30: bool = false,
927 _reserved_bit_31: bool = false,926 _reserved_bit_31: bool = false,
928};927};
929pub const SourceLanguage = extern enum(u32) {928pub const SourceLanguage = enum(u32) {
930 Unknown = 0,929 Unknown = 0,
931 ESSL = 1,930 ESSL = 1,
932 GLSL = 2,931 GLSL = 2,
...@@ -935,7 +934,7 @@ pub const SourceLanguage = extern enum(u32) {...@@ -935,7 +934,7 @@ pub const SourceLanguage = extern enum(u32) {
935 HLSL = 5,934 HLSL = 5,
936 _,935 _,
937};936};
938pub const ExecutionModel = extern enum(u32) {937pub const ExecutionModel = enum(u32) {
939 Vertex = 0,938 Vertex = 0,
940 TessellationControl = 1,939 TessellationControl = 1,
941 TessellationEvaluation = 2,940 TessellationEvaluation = 2,
...@@ -959,23 +958,21 @@ pub const ExecutionModel = extern enum(u32) {...@@ -959,23 +958,21 @@ pub const ExecutionModel = extern enum(u32) {
959 CallableKHR = 5318,958 CallableKHR = 5318,
960 _,959 _,
961};960};
962pub const AddressingModel = extern enum(u32) {961pub const AddressingModel = enum(u32) {
963 Logical = 0,962 Logical = 0,
964 Physical32 = 1,963 Physical32 = 1,
965 Physical64 = 2,964 Physical64 = 2,
966 PhysicalStorageBuffer64 = 5348,965 PhysicalStorageBuffer64 = 5348,
967 PhysicalStorageBuffer64EXT = 5348,
968 _,966 _,
969};967};
970pub const MemoryModel = extern enum(u32) {968pub const MemoryModel = enum(u32) {
971 Simple = 0,969 Simple = 0,
972 GLSL450 = 1,970 GLSL450 = 1,
973 OpenCL = 2,971 OpenCL = 2,
974 Vulkan = 3,972 Vulkan = 3,
975 VulkanKHR = 3,
976 _,973 _,
977};974};
978pub const ExecutionMode = extern enum(u32) {975pub const ExecutionMode = enum(u32) {
979 Invocations = 0,976 Invocations = 0,
980 SpacingEqual = 1,977 SpacingEqual = 1,
981 SpacingFractionalEven = 2,978 SpacingFractionalEven = 2,
...@@ -1044,7 +1041,7 @@ pub const ExecutionMode = extern enum(u32) {...@@ -1044,7 +1041,7 @@ pub const ExecutionMode = extern enum(u32) {
1044 SchedulerTargetFmaxMhzINTEL = 5903,1041 SchedulerTargetFmaxMhzINTEL = 5903,
1045 _,1042 _,
1046};1043};
1047pub const StorageClass = extern enum(u32) {1044pub const StorageClass = enum(u32) {
1048 UniformConstant = 0,1045 UniformConstant = 0,
1049 Input = 1,1046 Input = 1,
1050 Uniform = 2,1047 Uniform = 2,
...@@ -1058,26 +1055,19 @@ pub const StorageClass = extern enum(u32) {...@@ -1058,26 +1055,19 @@ pub const StorageClass = extern enum(u32) {
1058 AtomicCounter = 10,1055 AtomicCounter = 10,
1059 Image = 11,1056 Image = 11,
1060 StorageBuffer = 12,1057 StorageBuffer = 12,
1061 CallableDataNV = 5328,
1062 CallableDataKHR = 5328,1058 CallableDataKHR = 5328,
1063 IncomingCallableDataNV = 5329,
1064 IncomingCallableDataKHR = 5329,1059 IncomingCallableDataKHR = 5329,
1065 RayPayloadNV = 5338,
1066 RayPayloadKHR = 5338,1060 RayPayloadKHR = 5338,
1067 HitAttributeNV = 5339,
1068 HitAttributeKHR = 5339,1061 HitAttributeKHR = 5339,
1069 IncomingRayPayloadNV = 5342,
1070 IncomingRayPayloadKHR = 5342,1062 IncomingRayPayloadKHR = 5342,
1071 ShaderRecordBufferNV = 5343,
1072 ShaderRecordBufferKHR = 5343,1063 ShaderRecordBufferKHR = 5343,
1073 PhysicalStorageBuffer = 5349,1064 PhysicalStorageBuffer = 5349,
1074 PhysicalStorageBufferEXT = 5349,
1075 CodeSectionINTEL = 5605,1065 CodeSectionINTEL = 5605,
1076 DeviceOnlyINTEL = 5936,1066 DeviceOnlyINTEL = 5936,
1077 HostOnlyINTEL = 5937,1067 HostOnlyINTEL = 5937,
1078 _,1068 _,
1079};1069};
1080pub const Dim = extern enum(u32) {1070pub const Dim = enum(u32) {
1081 @"1D" = 0,1071 @"1D" = 0,
1082 @"2D" = 1,1072 @"2D" = 1,
1083 @"3D" = 2,1073 @"3D" = 2,
...@@ -1087,7 +1077,7 @@ pub const Dim = extern enum(u32) {...@@ -1087,7 +1077,7 @@ pub const Dim = extern enum(u32) {
1087 SubpassData = 6,1077 SubpassData = 6,
1088 _,1078 _,
1089};1079};
1090pub const SamplerAddressingMode = extern enum(u32) {1080pub const SamplerAddressingMode = enum(u32) {
1091 None = 0,1081 None = 0,
1092 ClampToEdge = 1,1082 ClampToEdge = 1,
1093 Clamp = 2,1083 Clamp = 2,
...@@ -1095,12 +1085,12 @@ pub const SamplerAddressingMode = extern enum(u32) {...@@ -1095,12 +1085,12 @@ pub const SamplerAddressingMode = extern enum(u32) {
1095 RepeatMirrored = 4,1085 RepeatMirrored = 4,
1096 _,1086 _,
1097};1087};
1098pub const SamplerFilterMode = extern enum(u32) {1088pub const SamplerFilterMode = enum(u32) {
1099 Nearest = 0,1089 Nearest = 0,
1100 Linear = 1,1090 Linear = 1,
1101 _,1091 _,
1102};1092};
1103pub const ImageFormat = extern enum(u32) {1093pub const ImageFormat = enum(u32) {
1104 Unknown = 0,1094 Unknown = 0,
1105 Rgba32f = 1,1095 Rgba32f = 1,
1106 Rgba16f = 2,1096 Rgba16f = 2,
...@@ -1145,7 +1135,7 @@ pub const ImageFormat = extern enum(u32) {...@@ -1145,7 +1135,7 @@ pub const ImageFormat = extern enum(u32) {
1145 R64i = 41,1135 R64i = 41,
1146 _,1136 _,
1147};1137};
1148pub const ImageChannelOrder = extern enum(u32) {1138pub const ImageChannelOrder = enum(u32) {
1149 R = 0,1139 R = 0,
1150 A = 1,1140 A = 1,
1151 RG = 2,1141 RG = 2,
...@@ -1168,7 +1158,7 @@ pub const ImageChannelOrder = extern enum(u32) {...@@ -1168,7 +1158,7 @@ pub const ImageChannelOrder = extern enum(u32) {
1168 ABGR = 19,1158 ABGR = 19,
1169 _,1159 _,
1170};1160};
1171pub const ImageChannelDataType = extern enum(u32) {1161pub const ImageChannelDataType = enum(u32) {
1172 SnormInt8 = 0,1162 SnormInt8 = 0,
1173 SnormInt16 = 1,1163 SnormInt16 = 1,
1174 UnormInt8 = 2,1164 UnormInt8 = 2,
...@@ -1188,36 +1178,36 @@ pub const ImageChannelDataType = extern enum(u32) {...@@ -1188,36 +1178,36 @@ pub const ImageChannelDataType = extern enum(u32) {
1188 UnormInt101010_2 = 16,1178 UnormInt101010_2 = 16,
1189 _,1179 _,
1190};1180};
1191pub const FPRoundingMode = extern enum(u32) {1181pub const FPRoundingMode = enum(u32) {
1192 RTE = 0,1182 RTE = 0,
1193 RTZ = 1,1183 RTZ = 1,
1194 RTP = 2,1184 RTP = 2,
1195 RTN = 3,1185 RTN = 3,
1196 _,1186 _,
1197};1187};
1198pub const FPDenormMode = extern enum(u32) {1188pub const FPDenormMode = enum(u32) {
1199 Preserve = 0,1189 Preserve = 0,
1200 FlushToZero = 1,1190 FlushToZero = 1,
1201 _,1191 _,
1202};1192};
1203pub const FPOperationMode = extern enum(u32) {1193pub const FPOperationMode = enum(u32) {
1204 IEEE = 0,1194 IEEE = 0,
1205 ALT = 1,1195 ALT = 1,
1206 _,1196 _,
1207};1197};
1208pub const LinkageType = extern enum(u32) {1198pub const LinkageType = enum(u32) {
1209 Export = 0,1199 Export = 0,
1210 Import = 1,1200 Import = 1,
1211 LinkOnceODR = 2,1201 LinkOnceODR = 2,
1212 _,1202 _,
1213};1203};
1214pub const AccessQualifier = extern enum(u32) {1204pub const AccessQualifier = enum(u32) {
1215 ReadOnly = 0,1205 ReadOnly = 0,
1216 WriteOnly = 1,1206 WriteOnly = 1,
1217 ReadWrite = 2,1207 ReadWrite = 2,
1218 _,1208 _,
1219};1209};
1220pub const FunctionParameterAttribute = extern enum(u32) {1210pub const FunctionParameterAttribute = enum(u32) {
1221 Zext = 0,1211 Zext = 0,
1222 Sext = 1,1212 Sext = 1,
1223 ByVal = 2,1213 ByVal = 2,
...@@ -1228,7 +1218,7 @@ pub const FunctionParameterAttribute = extern enum(u32) {...@@ -1228,7 +1218,7 @@ pub const FunctionParameterAttribute = extern enum(u32) {
1228 NoReadWrite = 7,1218 NoReadWrite = 7,
1229 _,1219 _,
1230};1220};
1231pub const Decoration = extern enum(u32) {1221pub const Decoration = enum(u32) {
1232 RelaxedPrecision = 0,1222 RelaxedPrecision = 0,
1233 SpecId = 1,1223 SpecId = 1,
1234 Block = 2,1224 Block = 2,
...@@ -1334,7 +1324,7 @@ pub const Decoration = extern enum(u32) {...@@ -1334,7 +1324,7 @@ pub const Decoration = extern enum(u32) {
1334 VectorComputeCallableFunctionINTEL = 6087,1324 VectorComputeCallableFunctionINTEL = 6087,
1335 _,1325 _,
1336};1326};
1337pub const BuiltIn = extern enum(u32) {1327pub const BuiltIn = enum(u32) {
1338 Position = 0,1328 Position = 0,
1339 PointSize = 1,1329 PointSize = 1,
1340 ClipDistance = 3,1330 ClipDistance = 3,
...@@ -1455,7 +1445,7 @@ pub const BuiltIn = extern enum(u32) {...@@ -1455,7 +1445,7 @@ pub const BuiltIn = extern enum(u32) {
1455 SMIDNV = 5377,1445 SMIDNV = 5377,
1456 _,1446 _,
1457};1447};
1458pub const Scope = extern enum(u32) {1448pub const Scope = enum(u32) {
1459 CrossDevice = 0,1449 CrossDevice = 0,
1460 Device = 1,1450 Device = 1,
1461 Workgroup = 2,1451 Workgroup = 2,
...@@ -1466,7 +1456,7 @@ pub const Scope = extern enum(u32) {...@@ -1466,7 +1456,7 @@ pub const Scope = extern enum(u32) {
1466 ShaderCallKHR = 6,1456 ShaderCallKHR = 6,
1467 _,1457 _,
1468};1458};
1469pub const GroupOperation = extern enum(u32) {1459pub const GroupOperation = enum(u32) {
1470 Reduce = 0,1460 Reduce = 0,
1471 InclusiveScan = 1,1461 InclusiveScan = 1,
1472 ExclusiveScan = 2,1462 ExclusiveScan = 2,
...@@ -1476,13 +1466,13 @@ pub const GroupOperation = extern enum(u32) {...@@ -1476,13 +1466,13 @@ pub const GroupOperation = extern enum(u32) {
1476 PartitionedExclusiveScanNV = 8,1466 PartitionedExclusiveScanNV = 8,
1477 _,1467 _,
1478};1468};
1479pub const KernelEnqueueFlags = extern enum(u32) {1469pub const KernelEnqueueFlags = enum(u32) {
1480 NoWait = 0,1470 NoWait = 0,
1481 WaitKernel = 1,1471 WaitKernel = 1,
1482 WaitWorkGroup = 2,1472 WaitWorkGroup = 2,
1483 _,1473 _,
1484};1474};
1485pub const Capability = extern enum(u32) {1475pub const Capability = enum(u32) {
1486 Matrix = 0,1476 Matrix = 0,
1487 Shader = 1,1477 Shader = 1,
1488 Geometry = 2,1478 Geometry = 2,
...@@ -1560,8 +1550,6 @@ pub const Capability = extern enum(u32) {...@@ -1560,8 +1550,6 @@ pub const Capability = extern enum(u32) {
1560 WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,1550 WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
1561 SubgroupVoteKHR = 4431,1551 SubgroupVoteKHR = 4431,
1562 StorageBuffer16BitAccess = 4433,1552 StorageBuffer16BitAccess = 4433,
1563 StorageUniformBufferBlock16 = 4433,
1564 UniformAndStorageBuffer16BitAccess = 4434,
1565 StorageUniform16 = 4434,1553 StorageUniform16 = 4434,
1566 StoragePushConstant16 = 4435,1554 StoragePushConstant16 = 4435,
1567 StorageInputOutput16 = 4436,1555 StorageInputOutput16 = 4436,
...@@ -1592,7 +1580,6 @@ pub const Capability = extern enum(u32) {...@@ -1592,7 +1580,6 @@ pub const Capability = extern enum(u32) {
1592 ShaderClockKHR = 5055,1580 ShaderClockKHR = 5055,
1593 SampleMaskOverrideCoverageNV = 5249,1581 SampleMaskOverrideCoverageNV = 5249,
1594 GeometryShaderPassthroughNV = 5251,1582 GeometryShaderPassthroughNV = 5251,
1595 ShaderViewportIndexLayerEXT = 5254,
1596 ShaderViewportIndexLayerNV = 5254,1583 ShaderViewportIndexLayerNV = 5254,
1597 ShaderViewportMaskNV = 5255,1584 ShaderViewportMaskNV = 5255,
1598 ShaderStereoViewNV = 5259,1585 ShaderStereoViewNV = 5259,
...@@ -1602,40 +1589,24 @@ pub const Capability = extern enum(u32) {...@@ -1602,40 +1589,24 @@ pub const Capability = extern enum(u32) {
1602 ImageFootprintNV = 5282,1589 ImageFootprintNV = 5282,
1603 FragmentBarycentricNV = 5284,1590 FragmentBarycentricNV = 5284,
1604 ComputeDerivativeGroupQuadsNV = 5288,1591 ComputeDerivativeGroupQuadsNV = 5288,
1605 FragmentDensityEXT = 5291,
1606 ShadingRateNV = 5291,1592 ShadingRateNV = 5291,
1607 GroupNonUniformPartitionedNV = 5297,1593 GroupNonUniformPartitionedNV = 5297,
1608 ShaderNonUniform = 5301,1594 ShaderNonUniform = 5301,
1609 ShaderNonUniformEXT = 5301,
1610 RuntimeDescriptorArray = 5302,1595 RuntimeDescriptorArray = 5302,
1611 RuntimeDescriptorArrayEXT = 5302,
1612 InputAttachmentArrayDynamicIndexing = 5303,1596 InputAttachmentArrayDynamicIndexing = 5303,
1613 InputAttachmentArrayDynamicIndexingEXT = 5303,
1614 UniformTexelBufferArrayDynamicIndexing = 5304,1597 UniformTexelBufferArrayDynamicIndexing = 5304,
1615 UniformTexelBufferArrayDynamicIndexingEXT = 5304,
1616 StorageTexelBufferArrayDynamicIndexing = 5305,1598 StorageTexelBufferArrayDynamicIndexing = 5305,
1617 StorageTexelBufferArrayDynamicIndexingEXT = 5305,
1618 UniformBufferArrayNonUniformIndexing = 5306,1599 UniformBufferArrayNonUniformIndexing = 5306,
1619 UniformBufferArrayNonUniformIndexingEXT = 5306,
1620 SampledImageArrayNonUniformIndexing = 5307,1600 SampledImageArrayNonUniformIndexing = 5307,
1621 SampledImageArrayNonUniformIndexingEXT = 5307,
1622 StorageBufferArrayNonUniformIndexing = 5308,1601 StorageBufferArrayNonUniformIndexing = 5308,
1623 StorageBufferArrayNonUniformIndexingEXT = 5308,
1624 StorageImageArrayNonUniformIndexing = 5309,1602 StorageImageArrayNonUniformIndexing = 5309,
1625 StorageImageArrayNonUniformIndexingEXT = 5309,
1626 InputAttachmentArrayNonUniformIndexing = 5310,1603 InputAttachmentArrayNonUniformIndexing = 5310,
1627 InputAttachmentArrayNonUniformIndexingEXT = 5310,
1628 UniformTexelBufferArrayNonUniformIndexing = 5311,1604 UniformTexelBufferArrayNonUniformIndexing = 5311,
1629 UniformTexelBufferArrayNonUniformIndexingEXT = 5311,
1630 StorageTexelBufferArrayNonUniformIndexing = 5312,1605 StorageTexelBufferArrayNonUniformIndexing = 5312,
1631 StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
1632 RayTracingNV = 5340,1606 RayTracingNV = 5340,
1633 VulkanMemoryModel = 5345,1607 VulkanMemoryModel = 5345,
1634 VulkanMemoryModelKHR = 5345,
1635 VulkanMemoryModelDeviceScope = 5346,1608 VulkanMemoryModelDeviceScope = 5346,
1636 VulkanMemoryModelDeviceScopeKHR = 5346,
1637 PhysicalStorageBufferAddresses = 5347,1609 PhysicalStorageBufferAddresses = 5347,
1638 PhysicalStorageBufferAddressesEXT = 5347,
1639 ComputeDerivativeGroupLinearNV = 5350,1610 ComputeDerivativeGroupLinearNV = 5350,
1640 RayTracingProvisionalKHR = 5353,1611 RayTracingProvisionalKHR = 5353,
1641 CooperativeMatrixNV = 5357,1612 CooperativeMatrixNV = 5357,
...@@ -1685,18 +1656,18 @@ pub const Capability = extern enum(u32) {...@@ -1685,18 +1656,18 @@ pub const Capability = extern enum(u32) {
1685 LongConstantCompositeINTEL = 6089,1656 LongConstantCompositeINTEL = 6089,
1686 _,1657 _,
1687};1658};
1688pub const RayQueryIntersection = extern enum(u32) {1659pub const RayQueryIntersection = enum(u32) {
1689 RayQueryCandidateIntersectionKHR = 0,1660 RayQueryCandidateIntersectionKHR = 0,
1690 RayQueryCommittedIntersectionKHR = 1,1661 RayQueryCommittedIntersectionKHR = 1,
1691 _,1662 _,
1692};1663};
1693pub const RayQueryCommittedIntersectionType = extern enum(u32) {1664pub const RayQueryCommittedIntersectionType = enum(u32) {
1694 RayQueryCommittedIntersectionNoneKHR = 0,1665 RayQueryCommittedIntersectionNoneKHR = 0,
1695 RayQueryCommittedIntersectionTriangleKHR = 1,1666 RayQueryCommittedIntersectionTriangleKHR = 1,
1696 RayQueryCommittedIntersectionGeneratedKHR = 2,1667 RayQueryCommittedIntersectionGeneratedKHR = 2,
1697 _,1668 _,
1698};1669};
1699pub const RayQueryCandidateIntersectionType = extern enum(u32) {1670pub const RayQueryCandidateIntersectionType = enum(u32) {
1700 RayQueryCandidateIntersectionTriangleKHR = 0,1671 RayQueryCandidateIntersectionTriangleKHR = 0,
1701 RayQueryCandidateIntersectionAABBKHR = 1,1672 RayQueryCandidateIntersectionAABBKHR = 1,
1702 _,1673 _,
src/config.zig.in+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1pub const have_llvm = true;1pub const have_llvm = true;
2pub const version: [:0]const u8 = "@ZIG_VERSION@";2pub const version: [:0]const u8 = "@ZIG_VERSION@";
3pub const semver = try @import("std").SemanticVersion.parse(version);3pub const semver = @import("std").SemanticVersion.parse(version) catch unreachable;
4pub const enable_logging: bool = @ZIG_ENABLE_LOGGING_BOOL@;4pub const enable_logging: bool = @ZIG_ENABLE_LOGGING_BOOL@;
5pub const enable_tracy = false;5pub const enable_tracy = false;
6pub const is_stage1 = true;6pub const is_stage1 = true;
src/link/MachO.zig+10-10
...@@ -2700,7 +2700,7 @@ fn writeStubHelperPreamble(self: *MachO) !void {...@@ -2700,7 +2700,7 @@ fn writeStubHelperPreamble(self: *MachO) !void {
2700 const this_addr = stub_helper.addr;2700 const this_addr = stub_helper.addr;
2701 const target_addr = data.addr;2701 const target_addr = data.addr;
2702 data_blk: {2702 data_blk: {
2703 const displacement = math.cast(i21, target_addr - this_addr) catch |_| break :data_blk;2703 const displacement = math.cast(i21, target_addr - this_addr) catch break :data_blk;
2704 // adr x17, disp2704 // adr x17, disp
2705 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.adr(.x17, displacement).toU32());2705 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.adr(.x17, displacement).toU32());
2706 // nop2706 // nop
...@@ -2709,7 +2709,7 @@ fn writeStubHelperPreamble(self: *MachO) !void {...@@ -2709,7 +2709,7 @@ fn writeStubHelperPreamble(self: *MachO) !void {
2709 }2709 }
2710 data_blk: {2710 data_blk: {
2711 const new_this_addr = this_addr + @sizeOf(u32);2711 const new_this_addr = this_addr + @sizeOf(u32);
2712 const displacement = math.cast(i21, target_addr - new_this_addr) catch |_| break :data_blk;2712 const displacement = math.cast(i21, target_addr - new_this_addr) catch break :data_blk;
2713 // nop2713 // nop
2714 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());2714 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
2715 // adr x17, disp2715 // adr x17, disp
...@@ -2738,8 +2738,8 @@ fn writeStubHelperPreamble(self: *MachO) !void {...@@ -2738,8 +2738,8 @@ fn writeStubHelperPreamble(self: *MachO) !void {
2738 const this_addr = stub_helper.addr + 3 * @sizeOf(u32);2738 const this_addr = stub_helper.addr + 3 * @sizeOf(u32);
2739 const target_addr = got.addr;2739 const target_addr = got.addr;
2740 binder_blk: {2740 binder_blk: {
2741 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :binder_blk;2741 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :binder_blk;
2742 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;2742 const literal = math.cast(u18, displacement) catch break :binder_blk;
2743 // ldr x16, label2743 // ldr x16, label
2744 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.ldr(.x16, .{2744 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.ldr(.x16, .{
2745 .literal = literal,2745 .literal = literal,
...@@ -2750,8 +2750,8 @@ fn writeStubHelperPreamble(self: *MachO) !void {...@@ -2750,8 +2750,8 @@ fn writeStubHelperPreamble(self: *MachO) !void {
2750 }2750 }
2751 binder_blk: {2751 binder_blk: {
2752 const new_this_addr = this_addr + @sizeOf(u32);2752 const new_this_addr = this_addr + @sizeOf(u32);
2753 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :binder_blk;2753 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :binder_blk;
2754 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;2754 const literal = math.cast(u18, displacement) catch break :binder_blk;
2755 // nop2755 // nop
2756 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.nop().toU32());2756 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.nop().toU32());
2757 // ldr x16, label2757 // ldr x16, label
...@@ -2816,8 +2816,8 @@ fn writeStub(self: *MachO, index: u32) !void {...@@ -2816,8 +2816,8 @@ fn writeStub(self: *MachO, index: u32) !void {
2816 const this_addr = stub_addr;2816 const this_addr = stub_addr;
2817 const target_addr = la_ptr_addr;2817 const target_addr = la_ptr_addr;
2818 inner: {2818 inner: {
2819 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :inner;2819 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :inner;
2820 const literal = math.cast(u18, displacement) catch |_| break :inner;2820 const literal = math.cast(u18, displacement) catch break :inner;
2821 // ldr x16, literal2821 // ldr x16, literal
2822 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.ldr(.x16, .{2822 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.ldr(.x16, .{
2823 .literal = literal,2823 .literal = literal,
...@@ -2828,8 +2828,8 @@ fn writeStub(self: *MachO, index: u32) !void {...@@ -2828,8 +2828,8 @@ fn writeStub(self: *MachO, index: u32) !void {
2828 }2828 }
2829 inner: {2829 inner: {
2830 const new_this_addr = this_addr + @sizeOf(u32);2830 const new_this_addr = this_addr + @sizeOf(u32);
2831 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :inner;2831 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :inner;
2832 const literal = math.cast(u18, displacement) catch |_| break :inner;2832 const literal = math.cast(u18, displacement) catch break :inner;
2833 // nop2833 // nop
2834 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());2834 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
2835 // ldr x16, literal2835 // ldr x16, literal
src/link/MachO/Trie.zig+1-1
...@@ -334,7 +334,7 @@ pub fn finalize(self: *Trie) !void {...@@ -334,7 +334,7 @@ pub fn finalize(self: *Trie) !void {
334 self.ordered_nodes.shrinkRetainingCapacity(0);334 self.ordered_nodes.shrinkRetainingCapacity(0);
335 try self.ordered_nodes.ensureCapacity(self.allocator, self.node_count);335 try self.ordered_nodes.ensureCapacity(self.allocator, self.node_count);
336336
337 comptime const Fifo = std.fifo.LinearFifo(*Node, .{ .Static = std.math.maxInt(u8) });337 const Fifo = std.fifo.LinearFifo(*Node, .{ .Static = std.math.maxInt(u8) });
338 var fifo = Fifo.init();338 var fifo = Fifo.init();
339 try fifo.writeItem(self.root.?);339 try fifo.writeItem(self.root.?);
340340
src/link/MachO/Zld.zig+10-10
...@@ -1305,7 +1305,7 @@ fn writeStubHelperCommon(self: *Zld) !void {...@@ -1305,7 +1305,7 @@ fn writeStubHelperCommon(self: *Zld) !void {
1305 const this_addr = stub_helper.addr;1305 const this_addr = stub_helper.addr;
1306 const target_addr = data.addr + data.size - @sizeOf(u64);1306 const target_addr = data.addr + data.size - @sizeOf(u64);
1307 data_blk: {1307 data_blk: {
1308 const displacement = math.cast(i21, target_addr - this_addr) catch |_| break :data_blk;1308 const displacement = math.cast(i21, target_addr - this_addr) catch break :data_blk;
1309 // adr x17, disp1309 // adr x17, disp
1310 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.adr(.x17, displacement).toU32());1310 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.adr(.x17, displacement).toU32());
1311 // nop1311 // nop
...@@ -1314,7 +1314,7 @@ fn writeStubHelperCommon(self: *Zld) !void {...@@ -1314,7 +1314,7 @@ fn writeStubHelperCommon(self: *Zld) !void {
1314 }1314 }
1315 data_blk: {1315 data_blk: {
1316 const new_this_addr = this_addr + @sizeOf(u32);1316 const new_this_addr = this_addr + @sizeOf(u32);
1317 const displacement = math.cast(i21, target_addr - new_this_addr) catch |_| break :data_blk;1317 const displacement = math.cast(i21, target_addr - new_this_addr) catch break :data_blk;
1318 // nop1318 // nop
1319 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());1319 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
1320 // adr x17, disp1320 // adr x17, disp
...@@ -1339,8 +1339,8 @@ fn writeStubHelperCommon(self: *Zld) !void {...@@ -1339,8 +1339,8 @@ fn writeStubHelperCommon(self: *Zld) !void {
1339 const this_addr = stub_helper.addr + 3 * @sizeOf(u32);1339 const this_addr = stub_helper.addr + 3 * @sizeOf(u32);
1340 const target_addr = (got.addr + dyld_stub_binder.got_index.? * @sizeOf(u64));1340 const target_addr = (got.addr + dyld_stub_binder.got_index.? * @sizeOf(u64));
1341 binder_blk: {1341 binder_blk: {
1342 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :binder_blk;1342 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :binder_blk;
1343 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;1343 const literal = math.cast(u18, displacement) catch break :binder_blk;
1344 // ldr x16, label1344 // ldr x16, label
1345 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.ldr(.x16, .{1345 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.ldr(.x16, .{
1346 .literal = literal,1346 .literal = literal,
...@@ -1351,8 +1351,8 @@ fn writeStubHelperCommon(self: *Zld) !void {...@@ -1351,8 +1351,8 @@ fn writeStubHelperCommon(self: *Zld) !void {
1351 }1351 }
1352 binder_blk: {1352 binder_blk: {
1353 const new_this_addr = this_addr + @sizeOf(u32);1353 const new_this_addr = this_addr + @sizeOf(u32);
1354 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :binder_blk;1354 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :binder_blk;
1355 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;1355 const literal = math.cast(u18, displacement) catch break :binder_blk;
1356 // Pad with nop to please division.1356 // Pad with nop to please division.
1357 // nop1357 // nop
1358 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.nop().toU32());1358 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.nop().toU32());
...@@ -1444,8 +1444,8 @@ fn writeStub(self: *Zld, index: u32) !void {...@@ -1444,8 +1444,8 @@ fn writeStub(self: *Zld, index: u32) !void {
1444 const this_addr = stub_addr;1444 const this_addr = stub_addr;
1445 const target_addr = la_ptr_addr;1445 const target_addr = la_ptr_addr;
1446 inner: {1446 inner: {
1447 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :inner;1447 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :inner;
1448 const literal = math.cast(u18, displacement) catch |_| break :inner;1448 const literal = math.cast(u18, displacement) catch break :inner;
1449 // ldr x16, literal1449 // ldr x16, literal
1450 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.ldr(.x16, .{1450 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.ldr(.x16, .{
1451 .literal = literal,1451 .literal = literal,
...@@ -1456,8 +1456,8 @@ fn writeStub(self: *Zld, index: u32) !void {...@@ -1456,8 +1456,8 @@ fn writeStub(self: *Zld, index: u32) !void {
1456 }1456 }
1457 inner: {1457 inner: {
1458 const new_this_addr = this_addr + @sizeOf(u32);1458 const new_this_addr = this_addr + @sizeOf(u32);
1459 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :inner;1459 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :inner;
1460 const literal = math.cast(u18, displacement) catch |_| break :inner;1460 const literal = math.cast(u18, displacement) catch break :inner;
1461 // nop1461 // nop
1462 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());1462 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
1463 // ldr x16, literal1463 // ldr x16, literal
src/main.zig+53-1
...@@ -2923,6 +2923,7 @@ pub const usage_fmt =...@@ -2923,6 +2923,7 @@ pub const usage_fmt =
2923 \\ --stdin Format code from stdin; output to stdout2923 \\ --stdin Format code from stdin; output to stdout
2924 \\ --check List non-conforming files and exit with an error2924 \\ --check List non-conforming files and exit with an error
2925 \\ if the list is non-empty2925 \\ if the list is non-empty
2926 \\ --ast-check Run zig ast-check on every file
2926 \\2927 \\
2927 \\2928 \\
2928;2929;
...@@ -2930,6 +2931,7 @@ pub const usage_fmt =...@@ -2930,6 +2931,7 @@ pub const usage_fmt =
2930const Fmt = struct {2931const Fmt = struct {
2931 seen: SeenMap,2932 seen: SeenMap,
2932 any_error: bool,2933 any_error: bool,
2934 check_ast: bool,
2933 color: Color,2935 color: Color,
2934 gpa: *Allocator,2936 gpa: *Allocator,
2935 out_buffer: std.ArrayList(u8),2937 out_buffer: std.ArrayList(u8),
...@@ -2942,6 +2944,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {...@@ -2942,6 +2944,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
2942 var color: Color = .auto;2944 var color: Color = .auto;
2943 var stdin_flag: bool = false;2945 var stdin_flag: bool = false;
2944 var check_flag: bool = false;2946 var check_flag: bool = false;
2947 var check_ast_flag: bool = false;
2945 var input_files = ArrayList([]const u8).init(gpa);2948 var input_files = ArrayList([]const u8).init(gpa);
2946 defer input_files.deinit();2949 defer input_files.deinit();
29472950
...@@ -2967,6 +2970,8 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {...@@ -2967,6 +2970,8 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
2967 stdin_flag = true;2970 stdin_flag = true;
2968 } else if (mem.eql(u8, arg, "--check")) {2971 } else if (mem.eql(u8, arg, "--check")) {
2969 check_flag = true;2972 check_flag = true;
2973 } else if (mem.eql(u8, arg, "--ast-check")) {
2974 check_ast_flag = true;
2970 } else {2975 } else {
2971 fatal("unrecognized parameter: '{s}'", .{arg});2976 fatal("unrecognized parameter: '{s}'", .{arg});
2972 }2977 }
...@@ -3017,6 +3022,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {...@@ -3017,6 +3022,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
3017 .gpa = gpa,3022 .gpa = gpa,
3018 .seen = Fmt.SeenMap.init(gpa),3023 .seen = Fmt.SeenMap.init(gpa),
3019 .any_error = false,3024 .any_error = false,
3025 .check_ast = check_ast_flag,
3020 .color = color,3026 .color = color,
3021 .out_buffer = std.ArrayList(u8).init(gpa),3027 .out_buffer = std.ArrayList(u8).init(gpa),
3022 };3028 };
...@@ -3085,7 +3091,7 @@ fn fmtPathDir(...@@ -3085,7 +3091,7 @@ fn fmtPathDir(
3085 while (try dir_it.next()) |entry| {3091 while (try dir_it.next()) |entry| {
3086 const is_dir = entry.kind == .Directory;3092 const is_dir = entry.kind == .Directory;
30873093
3088 if (is_dir and std.mem.eql(u8, entry.name, "zig-cache")) continue;3094 if (is_dir and (mem.eql(u8, entry.name, "zig-cache") or mem.eql(u8, entry.name, "zig-out"))) continue;
30893095
3090 if (is_dir or mem.endsWith(u8, entry.name, ".zig")) {3096 if (is_dir or mem.endsWith(u8, entry.name, ".zig")) {
3091 const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });3097 const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });
...@@ -3144,6 +3150,52 @@ fn fmtPathFile(...@@ -3144,6 +3150,52 @@ fn fmtPathFile(
3144 return;3150 return;
3145 }3151 }
31463152
3153 if (fmt.check_ast) {
3154 const Module = @import("Module.zig");
3155 const AstGen = @import("AstGen.zig");
3156
3157 var file: Module.Scope.File = .{
3158 .status = .never_loaded,
3159 .source_loaded = true,
3160 .zir_loaded = false,
3161 .sub_file_path = file_path,
3162 .source = source_code,
3163 .stat_size = stat.size,
3164 .stat_inode = stat.inode,
3165 .stat_mtime = stat.mtime,
3166 .tree = tree,
3167 .tree_loaded = true,
3168 .zir = undefined,
3169 .pkg = undefined,
3170 .root_decl = null,
3171 };
3172
3173 if (stat.size > max_src_size)
3174 return error.FileTooBig;
3175
3176 file.zir = try AstGen.generate(fmt.gpa, file.tree);
3177 file.zir_loaded = true;
3178 defer file.zir.deinit(fmt.gpa);
3179
3180 if (file.zir.hasCompileErrors()) {
3181 var arena_instance = std.heap.ArenaAllocator.init(fmt.gpa);
3182 defer arena_instance.deinit();
3183 var errors = std.ArrayList(Compilation.AllErrors.Message).init(fmt.gpa);
3184 defer errors.deinit();
3185
3186 try Compilation.AllErrors.addZir(&arena_instance.allocator, &errors, &file);
3187 const ttyconf: std.debug.TTY.Config = switch (fmt.color) {
3188 .auto => std.debug.detectTTYConfig(),
3189 .on => .escape_codes,
3190 .off => .no_color,
3191 };
3192 for (errors.items) |full_err_msg| {
3193 full_err_msg.renderToStdErr(ttyconf);
3194 }
3195 fmt.any_error = true;
3196 }
3197 }
3198
3147 // As a heuristic, we make enough capacity for the same as the input source.3199 // As a heuristic, we make enough capacity for the same as the input source.
3148 fmt.out_buffer.shrinkRetainingCapacity(0);3200 fmt.out_buffer.shrinkRetainingCapacity(0);
3149 try fmt.out_buffer.ensureCapacity(source_code.len);3201 try fmt.out_buffer.ensureCapacity(source_code.len);
src/stage1.zig+2-2
...@@ -58,7 +58,7 @@ pub const OS = c_int;...@@ -58,7 +58,7 @@ pub const OS = c_int;
58/// Matches std.builtin.BuildMode58/// Matches std.builtin.BuildMode
59pub const BuildMode = c_int;59pub const BuildMode = c_int;
6060
61pub const TargetSubsystem = extern enum(c_int) {61pub const TargetSubsystem = enum(c_int) {
62 Console,62 Console,
63 Windows,63 Windows,
64 Posix,64 Posix,
...@@ -171,7 +171,7 @@ export fn stage2_panic(ptr: [*]const u8, len: usize) void {...@@ -171,7 +171,7 @@ export fn stage2_panic(ptr: [*]const u8, len: usize) void {
171}171}
172172
173// ABI warning173// ABI warning
174const Error = extern enum {174const Error = enum(c_int) {
175 None,175 None,
176 OutOfMemory,176 OutOfMemory,
177 InvalidFormat,177 InvalidFormat,
src/type.zig+4-2
...@@ -6,6 +6,8 @@ const Target = std.Target;...@@ -6,6 +6,8 @@ const Target = std.Target;
6const Module = @import("Module.zig");6const Module = @import("Module.zig");
7const log = std.log.scoped(.Type);7const log = std.log.scoped(.Type);
88
9const file_struct = @This();
10
9/// This is the raw data, with no bookkeeping, no memory awareness, no de-duplication.11/// This is the raw data, with no bookkeeping, no memory awareness, no de-duplication.
10/// It's important for this type to be small.12/// It's important for this type to be small.
11/// Types are not de-duplicated, which helps with multi-threading since it obviates the requirement13/// Types are not de-duplicated, which helps with multi-threading since it obviates the requirement
...@@ -3000,12 +3002,12 @@ pub const Type = extern union {...@@ -3000,12 +3002,12 @@ pub const Type = extern union {
3000 };3002 };
3001 }3003 }
30023004
3003 pub fn init(comptime t: Tag) Type {3005 pub fn init(comptime t: Tag) file_struct.Type {
3004 comptime std.debug.assert(@enumToInt(t) < Tag.no_payload_count);3006 comptime std.debug.assert(@enumToInt(t) < Tag.no_payload_count);
3005 return .{ .tag_if_small_enough = @enumToInt(t) };3007 return .{ .tag_if_small_enough = @enumToInt(t) };
3006 }3008 }
30073009
3008 pub fn create(comptime t: Tag, ally: *Allocator, data: Data(t)) error{OutOfMemory}!Type {3010 pub fn create(comptime t: Tag, ally: *Allocator, data: Data(t)) error{OutOfMemory}!file_struct.Type {
3009 const ptr = try ally.create(t.Type());3011 const ptr = try ally.create(t.Type());
3010 ptr.* = .{3012 ptr.* = .{
3011 .base = .{ .tag = t },3013 .base = .{ .tag = t },
src/windows_sdk.zig+1-1
...@@ -12,7 +12,7 @@ pub const ZigWindowsSDK = extern struct {...@@ -12,7 +12,7 @@ pub const ZigWindowsSDK = extern struct {
12 msvc_lib_dir_ptr: ?[*]const u8,12 msvc_lib_dir_ptr: ?[*]const u8,
13 msvc_lib_dir_len: usize,13 msvc_lib_dir_len: usize,
14};14};
15pub const ZigFindWindowsSdkError = extern enum {15pub const ZigFindWindowsSdkError = enum(c_int) {
16 None,16 None,
17 OutOfMemory,17 OutOfMemory,
18 NotFound,18 NotFound,
test/behavior/bitcast.zig+2-2
...@@ -22,8 +22,8 @@ fn conv2(x: u32) i32 {...@@ -22,8 +22,8 @@ fn conv2(x: u32) i32 {
22 return @bitCast(i32, x);22 return @bitCast(i32, x);
23}23}
2424
25test "@bitCast extern enum to its integer type" {25test "@bitCast enum to its integer type" {
26 const SOCK = extern enum {26 const SOCK = enum(c_int) {
27 A,27 A,
28 B,28 B,
2929
test/behavior/bugs/1111.zig+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1const Foo = extern enum {1const Foo = enum(c_int) {
2 Bar = -1,2 Bar = -1,
3};3};
44
test/behavior/bugs/3046.zig+1-1
...@@ -13,7 +13,7 @@ var some_struct: SomeStruct = undefined;...@@ -13,7 +13,7 @@ var some_struct: SomeStruct = undefined;
1313
14test "fixed" {14test "fixed" {
15 some_struct = SomeStruct{15 some_struct = SomeStruct{
16 .field = couldFail() catch |_| @as(i32, 0),16 .field = couldFail() catch @as(i32, 0),
17 };17 };
18 try expect(some_struct.field == 1);18 try expect(some_struct.field == 1);
19}19}
test/behavior/cast.zig+1-12
...@@ -560,17 +560,6 @@ test "@intToEnum passed a comptime_int to an enum with one item" {...@@ -560,17 +560,6 @@ test "@intToEnum passed a comptime_int to an enum with one item" {
560 try expect(x == E.A);560 try expect(x == E.A);
561}561}
562562
563test "@intToEnum runtime to an extern enum with duplicate values" {
564 const E = extern enum(u8) {
565 A = 1,
566 B = 1,
567 };
568 var a: u8 = 1;
569 var x = @intToEnum(E, a);
570 try expect(x == E.A);
571 try expect(x == E.B);
572}
573
574test "@intCast to u0 and use the result" {563test "@intCast to u0 and use the result" {
575 const S = struct {564 const S = struct {
576 fn doTheTest(zero: u1, one: u1, bigzero: i32) !void {565 fn doTheTest(zero: u1, one: u1, bigzero: i32) !void {
...@@ -665,7 +654,7 @@ test "*const [N]null u8 to ?[]const u8" {...@@ -665,7 +654,7 @@ test "*const [N]null u8 to ?[]const u8" {
665654
666test "peer resolution of string literals" {655test "peer resolution of string literals" {
667 const S = struct {656 const S = struct {
668 const E = extern enum {657 const E = enum {
669 a,658 a,
670 b,659 b,
671 c,660 c,
test/behavior/enum.zig+1-40
...@@ -2,26 +2,6 @@ const expect = @import("std").testing.expect;...@@ -2,26 +2,6 @@ const expect = @import("std").testing.expect;
2const mem = @import("std").mem;2const mem = @import("std").mem;
3const Tag = @import("std").meta.Tag;3const Tag = @import("std").meta.Tag;
44
5test "extern enum" {
6 const S = struct {
7 const i = extern enum {
8 n = 0,
9 o = 2,
10 p = 4,
11 q = 4,
12 };
13 fn doTheTest(y: c_int) void {
14 var x = i.o;
15 switch (x) {
16 .n, .p => unreachable,
17 .o => {},
18 }
19 }
20 };
21 S.doTheTest(52);
22 comptime S.doTheTest(52);
23}
24
25test "non-exhaustive enum" {5test "non-exhaustive enum" {
26 const S = struct {6 const S = struct {
27 const E = enum(u8) {7 const E = enum(u8) {
...@@ -236,11 +216,6 @@ test "@tagName" {...@@ -236,11 +216,6 @@ test "@tagName" {
236 comptime try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));216 comptime try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
237}217}
238218
239test "@tagName extern enum with duplicates" {
240 try expect(mem.eql(u8, testEnumTagNameBare(ExternDuplicates.B), "A"));
241 comptime try expect(mem.eql(u8, testEnumTagNameBare(ExternDuplicates.B), "A"));
242}
243
244test "@tagName non-exhaustive enum" {219test "@tagName non-exhaustive enum" {
245 try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));220 try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
246 comptime try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));221 comptime try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
...@@ -256,11 +231,6 @@ const BareNumber = enum {...@@ -256,11 +231,6 @@ const BareNumber = enum {
256 Three,231 Three,
257};232};
258233
259const ExternDuplicates = extern enum(u8) {
260 A = 1,
261 B = 1,
262};
263
264const NonExhaustive = enum(u8) {234const NonExhaustive = enum(u8) {
265 A,235 A,
266 B,236 B,
...@@ -1018,17 +988,8 @@ test "enum with 1 field but explicit tag type should still have the tag type" {...@@ -1018,17 +988,8 @@ test "enum with 1 field but explicit tag type should still have the tag type" {
1018 comptime try expect(@sizeOf(Enum) == @sizeOf(u8));988 comptime try expect(@sizeOf(Enum) == @sizeOf(u8));
1019}989}
1020990
1021test "empty extern enum with members" {
1022 const E = extern enum {
1023 A,
1024 B,
1025 C,
1026 };
1027 try expect(@sizeOf(E) == @sizeOf(c_int));
1028}
1029
1030test "tag name with assigned enum values" {991test "tag name with assigned enum values" {
1031 const LocalFoo = enum {992 const LocalFoo = enum(u8) {
1032 A = 1,993 A = 1,
1033 B = 0,994 B = 0,
1034 };995 };
test/behavior/error.zig+1-1
...@@ -394,7 +394,7 @@ test "function pointer with return type that is error union with payload which i...@@ -394,7 +394,7 @@ test "function pointer with return type that is error union with payload which i
394 }394 }
395395
396 fn doTheTest() !void {396 fn doTheTest() !void {
397 var x = Foo{ .fun = bar };397 var x = Foo{ .fun = @This().bar };
398 try expectError(error.UnspecifiedErr, x.fun(1));398 try expectError(error.UnspecifiedErr, x.fun(1));
399 }399 }
400 };400 };
test/behavior/eval.zig+2-2
...@@ -415,8 +415,8 @@ test "f128 at compile time is lossy" {...@@ -415,8 +415,8 @@ test "f128 at compile time is lossy" {
415 try expect(@as(f128, 10384593717069655257060992658440192.0) + 1 == 10384593717069655257060992658440192.0);415 try expect(@as(f128, 10384593717069655257060992658440192.0) + 1 == 10384593717069655257060992658440192.0);
416}416}
417417
418comptime {418test {
419 try expect(@as(f128, 1 << 113) == 10384593717069655257060992658440192);419 comptime try expect(@as(f128, 1 << 113) == 10384593717069655257060992658440192);
420}420}
421421
422pub fn TypeWithCompTimeSlice(comptime field_name: []const u8) type {422pub fn TypeWithCompTimeSlice(comptime field_name: []const u8) type {
test/behavior/generics.zig+3-3
...@@ -45,9 +45,9 @@ test "var params" {...@@ -45,9 +45,9 @@ test "var params" {
45 try expect(max_f64(1.2, 3.4) == 3.4);45 try expect(max_f64(1.2, 3.4) == 3.4);
46}46}
4747
48comptime {48test {
49 try expect(max_i32(12, 34) == 34);49 comptime try expect(max_i32(12, 34) == 34);
50 try expect(max_f64(1.2, 3.4) == 3.4);50 comptime try expect(max_f64(1.2, 3.4) == 3.4);
51}51}
5252
53fn max_var(a: anytype, b: anytype) @TypeOf(a + b) {53fn max_var(a: anytype, b: anytype) @TypeOf(a + b) {
test/behavior/misc.zig+2-6
...@@ -546,19 +546,15 @@ const PackedUnion = packed union {...@@ -546,19 +546,15 @@ const PackedUnion = packed union {
546 a: u8,546 a: u8,
547 b: u32,547 b: u32,
548};548};
549const PackedEnum = packed enum {
550 A,
551 B,
552};
553549
554test "packed struct, enum, union parameters in extern function" {550test "packed struct, enum, union parameters in extern function" {
555 testPackedStuff(&(PackedStruct{551 testPackedStuff(&(PackedStruct{
556 .a = 1,552 .a = 1,
557 .b = 2,553 .b = 2,
558 }), &(PackedUnion{ .a = 1 }), PackedEnum.A);554 }), &(PackedUnion{ .a = 1 }));
559}555}
560556
561export fn testPackedStuff(a: *const PackedStruct, b: *const PackedUnion, c: PackedEnum) void {}557export fn testPackedStuff(a: *const PackedStruct, b: *const PackedUnion) void {}
562558
563test "slicing zero length array" {559test "slicing zero length array" {
564 const s1 = ""[0..];560 const s1 = ""[0..];
test/behavior/syntax.zig+1-2
...@@ -4,7 +4,7 @@...@@ -4,7 +4,7 @@
4extern var a: c_int;4extern var a: c_int;
5extern "c" var b: c_int;5extern "c" var b: c_int;
6export var c: c_int = 0;6export var c: c_int = 0;
7threadlocal var d: c_int;7threadlocal var d: c_int = 0;
8extern threadlocal var e: c_int;8extern threadlocal var e: c_int;
9extern "c" threadlocal var f: c_int;9extern "c" threadlocal var f: c_int;
10export threadlocal var g: c_int = 0;10export threadlocal var g: c_int = 0;
...@@ -24,7 +24,6 @@ fn container_init() void {...@@ -24,7 +24,6 @@ fn container_init() void {
24fn type_expr_return1() if (true) A {}24fn type_expr_return1() if (true) A {}
25fn type_expr_return2() for (true) |_| A {}25fn type_expr_return2() for (true) |_| A {}
26fn type_expr_return3() while (true) A {}26fn type_expr_return3() while (true) A {}
27fn type_expr_return4() comptime A {}
2827
29fn switch_cases(x: i32) void {28fn switch_cases(x: i32) void {
30 switch (x) {29 switch (x) {
test/behavior/type.zig+1-1
...@@ -410,7 +410,7 @@ test "Type.Union from Type.Enum" {...@@ -410,7 +410,7 @@ test "Type.Union from Type.Enum" {
410}410}
411411
412test "Type.Union from regular enum" {412test "Type.Union from regular enum" {
413 const E = enum { working_as_expected = 0 };413 const E = enum { working_as_expected };
414 const T = @Type(.{414 const T = @Type(.{
415 .Union = .{415 .Union = .{
416 .layout = .Auto,416 .layout = .Auto,
test/behavior/union.zig+1-1
...@@ -776,7 +776,7 @@ test "@unionInit on union w/ tag but no fields" {...@@ -776,7 +776,7 @@ test "@unionInit on union w/ tag but no fields" {
776 };776 };
777777
778 comptime {778 comptime {
779 try expect(@sizeOf(Data) != 0);779 std.debug.assert(@sizeOf(Data) != 0);
780 }780 }
781781
782 fn doTheTest() !void {782 fn doTheTest() !void {
test/stage2/test.zig+14
...@@ -880,6 +880,20 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -880,6 +880,20 @@ pub fn addCases(ctx: *TestContext) !void {
880 &.{":3:22: error: redundant comptime keyword in already comptime scope"},880 &.{":3:22: error: redundant comptime keyword in already comptime scope"},
881 );881 );
882 }882 }
883 {
884 var case = ctx.exe("try in comptime in struct in test", linux_x64);
885 case.addError(
886 \\test "@unionInit on union w/ tag but no fields" {
887 \\ const S = struct {
888 \\ comptime {
889 \\ try expect(false);
890 \\ }
891 \\ };
892 \\}
893 ,
894 &.{":4:13: error: invalid 'try' outside function scope"},
895 );
896 }
883 {897 {
884 var case = ctx.exe("import private", linux_x64);898 var case = ctx.exe("import private", linux_x64);
885 case.addError(899 case.addError(
test/tests.zig+2-5
...@@ -107,7 +107,6 @@ const test_targets = blk: {...@@ -107,7 +107,6 @@ const test_targets = blk: {
107 .link_libc = true,107 .link_libc = true,
108 },108 },
109109
110
111 TestTarget{110 TestTarget{
112 .target = .{111 .target = .{
113 .cpu_arch = .aarch64,112 .cpu_arch = .aarch64,
...@@ -228,7 +227,6 @@ const test_targets = blk: {...@@ -228,7 +227,6 @@ const test_targets = blk: {
228 .link_libc = true,227 .link_libc = true,
229 },228 },
230229
231
232 TestTarget{230 TestTarget{
233 .target = .{231 .target = .{
234 .cpu_arch = .riscv64,232 .cpu_arch = .riscv64,
...@@ -656,7 +654,7 @@ pub const StackTracesContext = struct {...@@ -656,7 +654,7 @@ pub const StackTracesContext = struct {
656 const b = self.b;654 const b = self.b;
657 const src_basename = "source.zig";655 const src_basename = "source.zig";
658 const write_src = b.addWriteFile(src_basename, source);656 const write_src = b.addWriteFile(src_basename, source);
659 const exe = b.addExecutableSource("test", write_src.getFileSource(src_basename).?);657 const exe = b.addExecutableSource("test", write_src.getFileSource(src_basename).?);
660 exe.setBuildMode(mode);658 exe.setBuildMode(mode);
661659
662 const run_and_compare = RunAndCompareStep.create(660 const run_and_compare = RunAndCompareStep.create(
...@@ -670,7 +668,6 @@ pub const StackTracesContext = struct {...@@ -670,7 +668,6 @@ pub const StackTracesContext = struct {
670 self.step.dependOn(&run_and_compare.step);668 self.step.dependOn(&run_and_compare.step);
671 }669 }
672670
673
674 const RunAndCompareStep = struct {671 const RunAndCompareStep = struct {
675 pub const base_id = .custom;672 pub const base_id = .custom;
676673
...@@ -1376,4 +1373,4 @@ fn printInvocation(args: []const []const u8) void {...@@ -1376,4 +1373,4 @@ fn printInvocation(args: []const []const u8) void {
1376 warn("{s} ", .{arg});1373 warn("{s} ", .{arg});
1377 }1374 }
1378 warn("\n", .{});1375 warn("\n", .{});
1379}
\ No newline at end of file
1376}