zig build fmt

This commit is contained in:
Kendall Condon 2025-12-02 10:11:35 -05:00
parent 21e95ed635
commit 374cd51385
8 changed files with 57 additions and 37 deletions

View file

@ -1700,7 +1700,8 @@ pub fn initSearchPath(comp: *Compilation, includes: []const Include, verbose: bo
std.debug.print("#include <...> search starts here:\n", .{}); std.debug.print("#include <...> search starts here:\n", .{});
} }
std.debug.print(" {s}{s}\n", .{ std.debug.print(" {s}{s}\n", .{
include.path, if (include.kind.isFramework()) include.path,
if (include.kind.isFramework())
" (framework directory)" " (framework directory)"
else else
"", "",

View file

@ -1213,7 +1213,8 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
.tag = .slice, .tag = .slice,
.main_token = l_bracket, .main_token = l_bracket,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
string, try c.addExtra(std.zig.Ast.Node.Slice{ string,
try c.addExtra(std.zig.Ast.Node.Slice{
.start = start, .start = start,
.end = end, .end = end,
}), }),
@ -2720,7 +2721,8 @@ fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex {
.tag = .call, .tag = .call,
.main_token = lparen, .main_token = lparen,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
lhs, try c.addExtra(NodeSubRange{ lhs,
try c.addExtra(NodeSubRange{
.start = span.start, .start = span.start,
.end = span.end, .end = span.end,
}), }),

View file

@ -8,8 +8,7 @@ const has_armaes = builtin.cpu.has(.aarch64, .aes);
// C backend doesn't currently support passing vectors to inline asm. // 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: { 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"); break :impl @import("aes/aesni.zig");
} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) } else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) impl: {
impl: {
break :impl @import("aes/armcrypto.zig"); break :impl @import("aes/armcrypto.zig");
} else impl: { } else impl: {
break :impl @import("aes/soft.zig"); break :impl @import("aes/soft.zig");

View file

@ -1245,14 +1245,16 @@ test utf8ToUtf16Le {
const length = try utf8ToUtf16Le(utf16le[0..], "This string has been designed to test the vectorized implementat" ++ 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¡"); "ion by beginning with one hundred twenty-seven ASCII characters¡");
try testing.expectEqualSlices(u8, &.{ 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, '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, '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, ' ', 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, '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, '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, ' ', 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, '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, '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])); }, mem.sliceAsBytes(utf16le[0..length]));
} }
} }
@ -1317,14 +1319,16 @@ test utf8ToUtf16LeAllocZ {
"ion by beginning with one hundred twenty-seven ASCII characters¡"); "ion by beginning with one hundred twenty-seven ASCII characters¡");
defer testing.allocator.free(utf16); defer testing.allocator.free(utf16);
try testing.expectEqualSlices(u8, &.{ 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, '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, '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, ' ', 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, '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, '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, ' ', 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, '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, '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)); }, mem.sliceAsBytes(utf16));
} }
} }

View file

@ -384,28 +384,32 @@ pub const list = list: {
}, },
}, },
.{ .{
"@cVaArg", .{ "@cVaArg",
.{
.tag = .c_va_arg, .tag = .c_va_arg,
.param_count = 2, .param_count = 2,
.illegal_outside_function = true, .illegal_outside_function = true,
}, },
}, },
.{ .{
"@cVaCopy", .{ "@cVaCopy",
.{
.tag = .c_va_copy, .tag = .c_va_copy,
.param_count = 1, .param_count = 1,
.illegal_outside_function = true, .illegal_outside_function = true,
}, },
}, },
.{ .{
"@cVaEnd", .{ "@cVaEnd",
.{
.tag = .c_va_end, .tag = .c_va_end,
.param_count = 1, .param_count = 1,
.illegal_outside_function = true, .illegal_outside_function = true,
}, },
}, },
.{ .{
"@cVaStart", .{ "@cVaStart",
.{
.tag = .c_va_start, .tag = .c_va_start,
.param_count = 0, .param_count = 0,
.illegal_outside_function = true, .illegal_outside_function = true,
@ -1042,7 +1046,8 @@ pub const list = list: {
}, },
}, },
.{ .{
"@workItemId", .{ "@workItemId",
.{
.tag = .work_item_id, .tag = .work_item_id,
.param_count = 1, .param_count = 1,
.illegal_outside_function = true, .illegal_outside_function = true,

View file

@ -885,7 +885,8 @@ fn expectContainerField(p: *Parse) !Node.Index {
.tag = .container_field, .tag = .container_field,
.main_token = main_token, .main_token = main_token,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
type_expr, try p.addExtra(Node.ContainerField{ type_expr,
try p.addExtra(Node.ContainerField{
.align_expr = align_expr.?, .align_expr = align_expr.?,
.value_expr = value_expr.?, .value_expr = value_expr.?,
}), }),
@ -1188,7 +1189,8 @@ fn expectIfStatement(p: *Parse) !Node.Index {
.tag = .@"if", .tag = .@"if",
.main_token = if_token, .main_token = if_token,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
condition, try p.addExtra(Node.If{ condition,
try p.addExtra(Node.If{
.then_expr = then_expr, .then_expr = then_expr,
.else_expr = else_expr, .else_expr = else_expr,
}), }),
@ -1369,7 +1371,8 @@ fn parseWhileStatement(p: *Parse) !?Node.Index {
.tag = .@"while", .tag = .@"while",
.main_token = while_token, .main_token = while_token,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
condition, try p.addExtra(Node.While{ condition,
try p.addExtra(Node.While{
.cont_expr = .fromOptional(cont_expr), .cont_expr = .fromOptional(cont_expr),
.then_expr = then_expr, .then_expr = then_expr,
.else_expr = else_expr, .else_expr = else_expr,
@ -1948,7 +1951,8 @@ fn parseTypeExpr(p: *Parse) Error!?Node.Index {
.tag = .array_type_sentinel, .tag = .array_type_sentinel,
.main_token = lbracket, .main_token = lbracket,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
len_expr.?, try p.addExtra(Node.ArrayTypeSentinel{ len_expr.?,
try p.addExtra(Node.ArrayTypeSentinel{
.sentinel = sentinel.?, .sentinel = sentinel.?,
.elem_type = elem_type, .elem_type = elem_type,
}), }),
@ -2743,7 +2747,8 @@ fn parseWhileTypeExpr(p: *Parse) !?Node.Index {
.tag = .while_cont, .tag = .while_cont,
.main_token = while_token, .main_token = while_token,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
condition, try p.addExtra(Node.WhileCont{ condition,
try p.addExtra(Node.WhileCont{
.cont_expr = cont_expr.?, .cont_expr = cont_expr.?,
.then_expr = then_expr, .then_expr = then_expr,
}), }),
@ -2757,7 +2762,8 @@ fn parseWhileTypeExpr(p: *Parse) !?Node.Index {
.tag = .@"while", .tag = .@"while",
.main_token = while_token, .main_token = while_token,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
condition, try p.addExtra(Node.While{ condition,
try p.addExtra(Node.While{
.cont_expr = .fromOptional(cont_expr), .cont_expr = .fromOptional(cont_expr),
.then_expr = then_expr, .then_expr = then_expr,
.else_expr = else_expr, .else_expr = else_expr,
@ -3235,7 +3241,8 @@ fn parseSuffixOp(p: *Parse, lhs: Node.Index) !?Node.Index {
.tag = .slice_sentinel, .tag = .slice_sentinel,
.main_token = lbracket, .main_token = lbracket,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
lhs, try p.addExtra(Node.SliceSentinel{ lhs,
try p.addExtra(Node.SliceSentinel{
.start = index_expr, .start = index_expr,
.end = .fromOptional(opt_end_expr), .end = .fromOptional(opt_end_expr),
.sentinel = sentinel, .sentinel = sentinel,
@ -3258,7 +3265,8 @@ fn parseSuffixOp(p: *Parse, lhs: Node.Index) !?Node.Index {
.tag = .slice, .tag = .slice,
.main_token = lbracket, .main_token = lbracket,
.data = .{ .node_and_extra = .{ .data = .{ .node_and_extra = .{
lhs, try p.addExtra(Node.Slice{ lhs,
try p.addExtra(Node.Slice{
.start = index_expr, .start = index_expr,
.end = end_expr, .end = end_expr,
}), }),

View file

@ -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_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_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); pub const RegisterManager = RegisterManagerFn(@import("CodeGen.zig"), Register, &allocatable_regs);

View file

@ -2040,7 +2040,8 @@ fn resolveLibInput(
const test_path: Path = .{ const test_path: Path = .{
.root_dir = lib_directory, .root_dir = lib_directory,
.sub_path = try std.fmt.allocPrint(arena, "{s}{s}{s}", .{ .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(), .static => target.staticLibSuffix(),
.dynamic => target.dynamicLibSuffix(), .dynamic => target.dynamicLibSuffix(),
}, },