From 02e8339ca78e0f701b84da0bc31201a7fe95cec4 Mon Sep 17 00:00:00 2001 From: Kendall Condon Date: Thu, 12 Mar 2026 17:44:03 -0400 Subject: [PATCH] zig build fmt --- lib/compiler/aro/aro/Compilation.zig | 3 ++- lib/compiler/translate-c/ast.zig | 6 +++-- lib/std/crypto/aes.zig | 3 +-- lib/std/unicode.zig | 36 +++++++++++++++------------- lib/std/zig/BuiltinFn.zig | 15 ++++++++---- lib/std/zig/Parse.zig | 24 ++++++++++++------- src/codegen/sparc64/abi.zig | 4 ++-- src/link.zig | 3 ++- 8 files changed, 57 insertions(+), 37 deletions(-) diff --git a/lib/compiler/aro/aro/Compilation.zig b/lib/compiler/aro/aro/Compilation.zig index 44e0248b8b..f2fa236115 100644 --- a/lib/compiler/aro/aro/Compilation.zig +++ b/lib/compiler/aro/aro/Compilation.zig @@ -1707,7 +1707,8 @@ pub fn initSearchPath(comp: *Compilation, includes: []const Include, verbose: bo std.debug.print("#include <...> search starts here:\n", .{}); } std.debug.print(" {s}{s}\n", .{ - include.path, if (include.kind.isFramework()) + include.path, + if (include.kind.isFramework()) " (framework directory)" else "", diff --git a/lib/compiler/translate-c/ast.zig b/lib/compiler/translate-c/ast.zig index b7a8fd488a..0b03ec411e 100644 --- a/lib/compiler/translate-c/ast.zig +++ b/lib/compiler/translate-c/ast.zig @@ -1213,7 +1213,8 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .slice, .main_token = l_bracket, .data = .{ .node_and_extra = .{ - string, try c.addExtra(std.zig.Ast.Node.Slice{ + string, + try c.addExtra(std.zig.Ast.Node.Slice{ .start = start, .end = end, }), @@ -2720,7 +2721,8 @@ fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex { .tag = .call, .main_token = lparen, .data = .{ .node_and_extra = .{ - lhs, try c.addExtra(NodeSubRange{ + lhs, + try c.addExtra(NodeSubRange{ .start = span.start, .end = span.end, }), diff --git a/lib/std/crypto/aes.zig b/lib/std/crypto/aes.zig index b660fabe25..99f61eda6c 100644 --- a/lib/std/crypto/aes.zig +++ b/lib/std/crypto/aes.zig @@ -8,8 +8,7 @@ const has_armaes = builtin.cpu.has(.aarch64, .aes); // C backend doesn't currently support passing vectors to inline asm. const impl = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx) impl: { break :impl @import("aes/aesni.zig"); -} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) -impl: { +} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) impl: { break :impl @import("aes/armcrypto.zig"); } else impl: { break :impl @import("aes/soft.zig"); diff --git a/lib/std/unicode.zig b/lib/std/unicode.zig index 1aae6d488f..3aa8603638 100644 --- a/lib/std/unicode.zig +++ b/lib/std/unicode.zig @@ -1245,14 +1245,16 @@ test utf8ToUtf16Le { const length = try utf8ToUtf16Le(utf16le[0..], "This string has been designed to test the vectorized implementat" ++ "ion by beginning with one hundred twenty-seven ASCII characters¡"); try testing.expectEqualSlices(u8, &.{ - 'T', 0, 'h', 0, 'i', 0, 's', 0, ' ', 0, 's', 0, 't', 0, 'r', 0, 'i', 0, 'n', 0, 'g', 0, ' ', 0, 'h', 0, 'a', 0, 's', 0, ' ', 0, - 'b', 0, 'e', 0, 'e', 0, 'n', 0, ' ', 0, 'd', 0, 'e', 0, 's', 0, 'i', 0, 'g', 0, 'n', 0, 'e', 0, 'd', 0, ' ', 0, 't', 0, 'o', 0, - ' ', 0, 't', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, 't', 0, 'h', 0, 'e', 0, ' ', 0, 'v', 0, 'e', 0, 'c', 0, 't', 0, 'o', 0, 'r', 0, - 'i', 0, 'z', 0, 'e', 0, 'd', 0, ' ', 0, 'i', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0, 'a', 0, 't', 0, - 'i', 0, 'o', 0, 'n', 0, ' ', 0, 'b', 0, 'y', 0, ' ', 0, 'b', 0, 'e', 0, 'g', 0, 'i', 0, 'n', 0, 'n', 0, 'i', 0, 'n', 0, 'g', 0, - ' ', 0, 'w', 0, 'i', 0, 't', 0, 'h', 0, ' ', 0, 'o', 0, 'n', 0, 'e', 0, ' ', 0, 'h', 0, 'u', 0, 'n', 0, 'd', 0, 'r', 0, 'e', 0, - 'd', 0, ' ', 0, 't', 0, 'w', 0, 'e', 0, 'n', 0, 't', 0, 'y', 0, '-', 0, 's', 0, 'e', 0, 'v', 0, 'e', 0, 'n', 0, ' ', 0, 'A', 0, - 'S', 0, 'C', 0, 'I', 0, 'I', 0, ' ', 0, 'c', 0, 'h', 0, 'a', 0, 'r', 0, 'a', 0, 'c', 0, 't', 0, 'e', 0, 'r', 0, 's', 0, '¡', 0, + 'T', 0, 'h', 0, 'i', 0, 's', 0, ' ', 0, 's', 0, 't', 0, 'r', 0, 'i', 0, 'n', 0, 'g', 0, ' ', 0, 'h', 0, 'a', 0, 's', 0, ' ', 0, + 'b', 0, 'e', 0, 'e', 0, 'n', 0, ' ', 0, 'd', 0, 'e', 0, 's', 0, 'i', 0, 'g', 0, 'n', 0, 'e', 0, 'd', 0, ' ', 0, 't', 0, 'o', 0, + ' ', 0, 't', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, 't', 0, 'h', 0, 'e', 0, ' ', 0, 'v', 0, 'e', 0, 'c', 0, 't', 0, 'o', 0, 'r', 0, + 'i', 0, 'z', 0, 'e', 0, 'd', 0, ' ', 0, 'i', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0, 'a', 0, 't', 0, + 'i', 0, 'o', 0, 'n', 0, ' ', 0, 'b', 0, 'y', 0, ' ', 0, 'b', 0, 'e', 0, 'g', 0, 'i', 0, 'n', 0, 'n', 0, 'i', 0, 'n', 0, 'g', 0, + ' ', 0, 'w', 0, 'i', 0, 't', 0, 'h', 0, ' ', 0, 'o', 0, 'n', 0, 'e', 0, ' ', 0, 'h', 0, 'u', 0, 'n', 0, 'd', 0, 'r', 0, 'e', 0, + 'd', 0, ' ', 0, 't', 0, 'w', 0, 'e', 0, 'n', 0, 't', 0, 'y', 0, '-', 0, 's', 0, 'e', 0, 'v', 0, 'e', 0, 'n', 0, ' ', 0, 'A', 0, + 'S', 0, 'C', 0, 'I', 0, 'I', 0, ' ', 0, 'c', 0, 'h', 0, 'a', 0, 'r', 0, 'a', 0, 'c', 0, 't', 0, 'e', 0, 'r', 0, 's', 0, + '¡', + 0, }, mem.sliceAsBytes(utf16le[0..length])); } } @@ -1317,14 +1319,16 @@ test utf8ToUtf16LeAllocZ { "ion by beginning with one hundred twenty-seven ASCII characters¡"); defer testing.allocator.free(utf16); try testing.expectEqualSlices(u8, &.{ - 'T', 0, 'h', 0, 'i', 0, 's', 0, ' ', 0, 's', 0, 't', 0, 'r', 0, 'i', 0, 'n', 0, 'g', 0, ' ', 0, 'h', 0, 'a', 0, 's', 0, ' ', 0, - 'b', 0, 'e', 0, 'e', 0, 'n', 0, ' ', 0, 'd', 0, 'e', 0, 's', 0, 'i', 0, 'g', 0, 'n', 0, 'e', 0, 'd', 0, ' ', 0, 't', 0, 'o', 0, - ' ', 0, 't', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, 't', 0, 'h', 0, 'e', 0, ' ', 0, 'v', 0, 'e', 0, 'c', 0, 't', 0, 'o', 0, 'r', 0, - 'i', 0, 'z', 0, 'e', 0, 'd', 0, ' ', 0, 'i', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0, 'a', 0, 't', 0, - 'i', 0, 'o', 0, 'n', 0, ' ', 0, 'b', 0, 'y', 0, ' ', 0, 'b', 0, 'e', 0, 'g', 0, 'i', 0, 'n', 0, 'n', 0, 'i', 0, 'n', 0, 'g', 0, - ' ', 0, 'w', 0, 'i', 0, 't', 0, 'h', 0, ' ', 0, 'o', 0, 'n', 0, 'e', 0, ' ', 0, 'h', 0, 'u', 0, 'n', 0, 'd', 0, 'r', 0, 'e', 0, - 'd', 0, ' ', 0, 't', 0, 'w', 0, 'e', 0, 'n', 0, 't', 0, 'y', 0, '-', 0, 's', 0, 'e', 0, 'v', 0, 'e', 0, 'n', 0, ' ', 0, 'A', 0, - 'S', 0, 'C', 0, 'I', 0, 'I', 0, ' ', 0, 'c', 0, 'h', 0, 'a', 0, 'r', 0, 'a', 0, 'c', 0, 't', 0, 'e', 0, 'r', 0, 's', 0, '¡', 0, + 'T', 0, 'h', 0, 'i', 0, 's', 0, ' ', 0, 's', 0, 't', 0, 'r', 0, 'i', 0, 'n', 0, 'g', 0, ' ', 0, 'h', 0, 'a', 0, 's', 0, ' ', 0, + 'b', 0, 'e', 0, 'e', 0, 'n', 0, ' ', 0, 'd', 0, 'e', 0, 's', 0, 'i', 0, 'g', 0, 'n', 0, 'e', 0, 'd', 0, ' ', 0, 't', 0, 'o', 0, + ' ', 0, 't', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, 't', 0, 'h', 0, 'e', 0, ' ', 0, 'v', 0, 'e', 0, 'c', 0, 't', 0, 'o', 0, 'r', 0, + 'i', 0, 'z', 0, 'e', 0, 'd', 0, ' ', 0, 'i', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0, 'a', 0, 't', 0, + 'i', 0, 'o', 0, 'n', 0, ' ', 0, 'b', 0, 'y', 0, ' ', 0, 'b', 0, 'e', 0, 'g', 0, 'i', 0, 'n', 0, 'n', 0, 'i', 0, 'n', 0, 'g', 0, + ' ', 0, 'w', 0, 'i', 0, 't', 0, 'h', 0, ' ', 0, 'o', 0, 'n', 0, 'e', 0, ' ', 0, 'h', 0, 'u', 0, 'n', 0, 'd', 0, 'r', 0, 'e', 0, + 'd', 0, ' ', 0, 't', 0, 'w', 0, 'e', 0, 'n', 0, 't', 0, 'y', 0, '-', 0, 's', 0, 'e', 0, 'v', 0, 'e', 0, 'n', 0, ' ', 0, 'A', 0, + 'S', 0, 'C', 0, 'I', 0, 'I', 0, ' ', 0, 'c', 0, 'h', 0, 'a', 0, 'r', 0, 'a', 0, 'c', 0, 't', 0, 'e', 0, 'r', 0, 's', 0, + '¡', + 0, }, mem.sliceAsBytes(utf16)); } } diff --git a/lib/std/zig/BuiltinFn.zig b/lib/std/zig/BuiltinFn.zig index cdc63f9666..2bb6f6578a 100644 --- a/lib/std/zig/BuiltinFn.zig +++ b/lib/std/zig/BuiltinFn.zig @@ -384,28 +384,32 @@ pub const list = list: { }, }, .{ - "@cVaArg", .{ + "@cVaArg", + .{ .tag = .c_va_arg, .param_count = 2, .illegal_outside_function = true, }, }, .{ - "@cVaCopy", .{ + "@cVaCopy", + .{ .tag = .c_va_copy, .param_count = 1, .illegal_outside_function = true, }, }, .{ - "@cVaEnd", .{ + "@cVaEnd", + .{ .tag = .c_va_end, .param_count = 1, .illegal_outside_function = true, }, }, .{ - "@cVaStart", .{ + "@cVaStart", + .{ .tag = .c_va_start, .param_count = 0, .illegal_outside_function = true, @@ -1042,7 +1046,8 @@ pub const list = list: { }, }, .{ - "@workItemId", .{ + "@workItemId", + .{ .tag = .work_item_id, .param_count = 1, .illegal_outside_function = true, diff --git a/lib/std/zig/Parse.zig b/lib/std/zig/Parse.zig index d3f37ed026..5dcc183a21 100644 --- a/lib/std/zig/Parse.zig +++ b/lib/std/zig/Parse.zig @@ -885,7 +885,8 @@ fn expectContainerField(p: *Parse) !Node.Index { .tag = .container_field, .main_token = main_token, .data = .{ .node_and_extra = .{ - type_expr, try p.addExtra(Node.ContainerField{ + type_expr, + try p.addExtra(Node.ContainerField{ .align_expr = align_expr.?, .value_expr = value_expr.?, }), @@ -1188,7 +1189,8 @@ fn expectIfStatement(p: *Parse) !Node.Index { .tag = .@"if", .main_token = if_token, .data = .{ .node_and_extra = .{ - condition, try p.addExtra(Node.If{ + condition, + try p.addExtra(Node.If{ .then_expr = then_expr, .else_expr = else_expr, }), @@ -1369,7 +1371,8 @@ fn parseWhileStatement(p: *Parse) !?Node.Index { .tag = .@"while", .main_token = while_token, .data = .{ .node_and_extra = .{ - condition, try p.addExtra(Node.While{ + condition, + try p.addExtra(Node.While{ .cont_expr = .fromOptional(cont_expr), .then_expr = then_expr, .else_expr = else_expr, @@ -1937,7 +1940,8 @@ fn parseTypeExpr(p: *Parse) Error!?Node.Index { .tag = .array_type_sentinel, .main_token = lbracket, .data = .{ .node_and_extra = .{ - len_expr.?, try p.addExtra(Node.ArrayTypeSentinel{ + len_expr.?, + try p.addExtra(Node.ArrayTypeSentinel{ .sentinel = sentinel.?, .elem_type = elem_type, }), @@ -2732,7 +2736,8 @@ fn parseWhileTypeExpr(p: *Parse) !?Node.Index { .tag = .while_cont, .main_token = while_token, .data = .{ .node_and_extra = .{ - condition, try p.addExtra(Node.WhileCont{ + condition, + try p.addExtra(Node.WhileCont{ .cont_expr = cont_expr.?, .then_expr = then_expr, }), @@ -2746,7 +2751,8 @@ fn parseWhileTypeExpr(p: *Parse) !?Node.Index { .tag = .@"while", .main_token = while_token, .data = .{ .node_and_extra = .{ - condition, try p.addExtra(Node.While{ + condition, + try p.addExtra(Node.While{ .cont_expr = .fromOptional(cont_expr), .then_expr = then_expr, .else_expr = else_expr, @@ -3198,7 +3204,8 @@ fn parseSuffixOp(p: *Parse, lhs: Node.Index) !?Node.Index { .tag = .slice_sentinel, .main_token = lbracket, .data = .{ .node_and_extra = .{ - lhs, try p.addExtra(Node.SliceSentinel{ + lhs, + try p.addExtra(Node.SliceSentinel{ .start = index_expr, .end = .fromOptional(opt_end_expr), .sentinel = sentinel, @@ -3221,7 +3228,8 @@ fn parseSuffixOp(p: *Parse, lhs: Node.Index) !?Node.Index { .tag = .slice, .main_token = lbracket, .data = .{ .node_and_extra = .{ - lhs, try p.addExtra(Node.Slice{ + lhs, + try p.addExtra(Node.Slice{ .start = index_expr, .end = end_expr, }), diff --git a/src/codegen/sparc64/abi.zig b/src/codegen/sparc64/abi.zig index a26ab9a20b..5b5cf552d0 100644 --- a/src/codegen/sparc64/abi.zig +++ b/src/codegen/sparc64/abi.zig @@ -38,10 +38,10 @@ const allocatable_regs = [_]Register{ }; pub const c_abi_int_param_regs_caller_view = [_]Register{ .o0, .o1, .o2, .o3, .o4, .o5 }; -pub const c_abi_int_param_regs_callee_view = [_]Register{ .@"i0", .@"i1", .@"i2", .@"i3", .@"i4", .@"i5" }; +pub const c_abi_int_param_regs_callee_view = [_]Register{ .i0, .i1, .i2, .i3, .i4, .i5 }; pub const c_abi_int_return_regs_caller_view = [_]Register{ .o0, .o1, .o2, .o3 }; -pub const c_abi_int_return_regs_callee_view = [_]Register{ .@"i0", .@"i1", .@"i2", .@"i3" }; +pub const c_abi_int_return_regs_callee_view = [_]Register{ .i0, .i1, .i2, .i3 }; pub const RegisterManager = RegisterManagerFn(@import("CodeGen.zig"), Register, &allocatable_regs); diff --git a/src/link.zig b/src/link.zig index 80141676d4..0243fe9fa3 100644 --- a/src/link.zig +++ b/src/link.zig @@ -2097,7 +2097,8 @@ fn resolveLibInput( const test_path: Path = .{ .root_dir = lib_directory, .sub_path = try std.fmt.allocPrint(arena, "{s}{s}{s}", .{ - target.libPrefix(), lib_name, switch (link_mode) { + target.libPrefix(), lib_name, + switch (link_mode) { .static => target.staticLibSuffix(), .dynamic => target.dynamicLibSuffix(), },