Skip to content

Commit 7d24a43

Browse files
committed
zig build fmt
1 parent 25c6f9b commit 7d24a43

File tree

8 files changed

+57
-37
lines changed

8 files changed

+57
-37
lines changed

lib/compiler/aro/aro/Compilation.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,8 @@ pub fn initSearchPath(comp: *Compilation, includes: []const Include, verbose: bo
17001700
std.debug.print("#include <...> search starts here:\n", .{});
17011701
}
17021702
std.debug.print(" {s}{s}\n", .{
1703-
include.path, if (include.kind.isFramework())
1703+
include.path,
1704+
if (include.kind.isFramework())
17041705
" (framework directory)"
17051706
else
17061707
"",

lib/compiler/translate-c/ast.zig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,8 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
12131213
.tag = .slice,
12141214
.main_token = l_bracket,
12151215
.data = .{ .node_and_extra = .{
1216-
string, try c.addExtra(std.zig.Ast.Node.Slice{
1216+
string,
1217+
try c.addExtra(std.zig.Ast.Node.Slice{
12171218
.start = start,
12181219
.end = end,
12191220
}),
@@ -2720,7 +2721,8 @@ fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex {
27202721
.tag = .call,
27212722
.main_token = lparen,
27222723
.data = .{ .node_and_extra = .{
2723-
lhs, try c.addExtra(NodeSubRange{
2724+
lhs,
2725+
try c.addExtra(NodeSubRange{
27242726
.start = span.start,
27252727
.end = span.end,
27262728
}),

lib/std/crypto/aes.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const has_armaes = builtin.cpu.has(.aarch64, .aes);
88
// C backend doesn't currently support passing vectors to inline asm.
99
const impl = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx) impl: {
1010
break :impl @import("aes/aesni.zig");
11-
} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes)
12-
impl: {
11+
} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) impl: {
1312
break :impl @import("aes/armcrypto.zig");
1413
} else impl: {
1514
break :impl @import("aes/soft.zig");

lib/std/unicode.zig

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,14 +1245,16 @@ test utf8ToUtf16Le {
12451245
const length = try utf8ToUtf16Le(utf16le[0..], "This string has been designed to test the vectorized implementat" ++
12461246
"ion by beginning with one hundred twenty-seven ASCII characters¡");
12471247
try testing.expectEqualSlices(u8, &.{
1248-
'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,
1249-
'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,
1250-
' ', 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,
1251-
'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,
1252-
'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,
1253-
' ', 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,
1254-
'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,
1255-
'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,
1248+
'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,
1249+
'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,
1250+
' ', 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,
1251+
'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,
1252+
'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,
1253+
' ', 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,
1254+
'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,
1255+
'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,
1256+
'¡',
1257+
0,
12561258
}, mem.sliceAsBytes(utf16le[0..length]));
12571259
}
12581260
}
@@ -1317,14 +1319,16 @@ test utf8ToUtf16LeAllocZ {
13171319
"ion by beginning with one hundred twenty-seven ASCII characters¡");
13181320
defer testing.allocator.free(utf16);
13191321
try testing.expectEqualSlices(u8, &.{
1320-
'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,
1321-
'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,
1322-
' ', 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,
1323-
'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,
1324-
'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,
1325-
' ', 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,
1326-
'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,
1327-
'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,
1322+
'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,
1323+
'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,
1324+
' ', 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,
1325+
'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,
1326+
'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,
1327+
' ', 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,
1328+
'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,
1329+
'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,
1330+
'¡',
1331+
0,
13281332
}, mem.sliceAsBytes(utf16));
13291333
}
13301334
}

lib/std/zig/BuiltinFn.zig

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,28 +384,32 @@ pub const list = list: {
384384
},
385385
},
386386
.{
387-
"@cVaArg", .{
387+
"@cVaArg",
388+
.{
388389
.tag = .c_va_arg,
389390
.param_count = 2,
390391
.illegal_outside_function = true,
391392
},
392393
},
393394
.{
394-
"@cVaCopy", .{
395+
"@cVaCopy",
396+
.{
395397
.tag = .c_va_copy,
396398
.param_count = 1,
397399
.illegal_outside_function = true,
398400
},
399401
},
400402
.{
401-
"@cVaEnd", .{
403+
"@cVaEnd",
404+
.{
402405
.tag = .c_va_end,
403406
.param_count = 1,
404407
.illegal_outside_function = true,
405408
},
406409
},
407410
.{
408-
"@cVaStart", .{
411+
"@cVaStart",
412+
.{
409413
.tag = .c_va_start,
410414
.param_count = 0,
411415
.illegal_outside_function = true,
@@ -1042,7 +1046,8 @@ pub const list = list: {
10421046
},
10431047
},
10441048
.{
1045-
"@workItemId", .{
1049+
"@workItemId",
1050+
.{
10461051
.tag = .work_item_id,
10471052
.param_count = 1,
10481053
.illegal_outside_function = true,

lib/std/zig/Parse.zig

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,8 @@ fn expectContainerField(p: *Parse) !Node.Index {
885885
.tag = .container_field,
886886
.main_token = main_token,
887887
.data = .{ .node_and_extra = .{
888-
type_expr, try p.addExtra(Node.ContainerField{
888+
type_expr,
889+
try p.addExtra(Node.ContainerField{
889890
.align_expr = align_expr.?,
890891
.value_expr = value_expr.?,
891892
}),
@@ -1188,7 +1189,8 @@ fn expectIfStatement(p: *Parse) !Node.Index {
11881189
.tag = .@"if",
11891190
.main_token = if_token,
11901191
.data = .{ .node_and_extra = .{
1191-
condition, try p.addExtra(Node.If{
1192+
condition,
1193+
try p.addExtra(Node.If{
11921194
.then_expr = then_expr,
11931195
.else_expr = else_expr,
11941196
}),
@@ -1369,7 +1371,8 @@ fn parseWhileStatement(p: *Parse) !?Node.Index {
13691371
.tag = .@"while",
13701372
.main_token = while_token,
13711373
.data = .{ .node_and_extra = .{
1372-
condition, try p.addExtra(Node.While{
1374+
condition,
1375+
try p.addExtra(Node.While{
13731376
.cont_expr = .fromOptional(cont_expr),
13741377
.then_expr = then_expr,
13751378
.else_expr = else_expr,
@@ -1948,7 +1951,8 @@ fn parseTypeExpr(p: *Parse) Error!?Node.Index {
19481951
.tag = .array_type_sentinel,
19491952
.main_token = lbracket,
19501953
.data = .{ .node_and_extra = .{
1951-
len_expr.?, try p.addExtra(Node.ArrayTypeSentinel{
1954+
len_expr.?,
1955+
try p.addExtra(Node.ArrayTypeSentinel{
19521956
.sentinel = sentinel.?,
19531957
.elem_type = elem_type,
19541958
}),
@@ -2743,7 +2747,8 @@ fn parseWhileTypeExpr(p: *Parse) !?Node.Index {
27432747
.tag = .while_cont,
27442748
.main_token = while_token,
27452749
.data = .{ .node_and_extra = .{
2746-
condition, try p.addExtra(Node.WhileCont{
2750+
condition,
2751+
try p.addExtra(Node.WhileCont{
27472752
.cont_expr = cont_expr.?,
27482753
.then_expr = then_expr,
27492754
}),
@@ -2757,7 +2762,8 @@ fn parseWhileTypeExpr(p: *Parse) !?Node.Index {
27572762
.tag = .@"while",
27582763
.main_token = while_token,
27592764
.data = .{ .node_and_extra = .{
2760-
condition, try p.addExtra(Node.While{
2765+
condition,
2766+
try p.addExtra(Node.While{
27612767
.cont_expr = .fromOptional(cont_expr),
27622768
.then_expr = then_expr,
27632769
.else_expr = else_expr,
@@ -3235,7 +3241,8 @@ fn parseSuffixOp(p: *Parse, lhs: Node.Index) !?Node.Index {
32353241
.tag = .slice_sentinel,
32363242
.main_token = lbracket,
32373243
.data = .{ .node_and_extra = .{
3238-
lhs, try p.addExtra(Node.SliceSentinel{
3244+
lhs,
3245+
try p.addExtra(Node.SliceSentinel{
32393246
.start = index_expr,
32403247
.end = .fromOptional(opt_end_expr),
32413248
.sentinel = sentinel,
@@ -3258,7 +3265,8 @@ fn parseSuffixOp(p: *Parse, lhs: Node.Index) !?Node.Index {
32583265
.tag = .slice,
32593266
.main_token = lbracket,
32603267
.data = .{ .node_and_extra = .{
3261-
lhs, try p.addExtra(Node.Slice{
3268+
lhs,
3269+
try p.addExtra(Node.Slice{
32623270
.start = index_expr,
32633271
.end = end_expr,
32643272
}),

src/codegen/sparc64/abi.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const allocatable_regs = [_]Register{
3838
};
3939

4040
pub const c_abi_int_param_regs_caller_view = [_]Register{ .o0, .o1, .o2, .o3, .o4, .o5 };
41-
pub const c_abi_int_param_regs_callee_view = [_]Register{ .@"i0", .@"i1", .@"i2", .@"i3", .@"i4", .@"i5" };
41+
pub const c_abi_int_param_regs_callee_view = [_]Register{ .i0, .i1, .i2, .i3, .i4, .i5 };
4242

4343
pub const c_abi_int_return_regs_caller_view = [_]Register{ .o0, .o1, .o2, .o3 };
44-
pub const c_abi_int_return_regs_callee_view = [_]Register{ .@"i0", .@"i1", .@"i2", .@"i3" };
44+
pub const c_abi_int_return_regs_callee_view = [_]Register{ .i0, .i1, .i2, .i3 };
4545

4646
pub const RegisterManager = RegisterManagerFn(@import("CodeGen.zig"), Register, &allocatable_regs);
4747

src/link.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,8 @@ fn resolveLibInput(
20402040
const test_path: Path = .{
20412041
.root_dir = lib_directory,
20422042
.sub_path = try std.fmt.allocPrint(arena, "{s}{s}{s}", .{
2043-
target.libPrefix(), lib_name, switch (link_mode) {
2043+
target.libPrefix(), lib_name,
2044+
switch (link_mode) {
20442045
.static => target.staticLibSuffix(),
20452046
.dynamic => target.dynamicLibSuffix(),
20462047
},

0 commit comments

Comments
 (0)