mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
zig build fmt
This commit is contained in:
parent
21e95ed635
commit
374cd51385
8 changed files with 57 additions and 37 deletions
3
lib/compiler/aro/aro/Compilation.zig
vendored
3
lib/compiler/aro/aro/Compilation.zig
vendored
|
|
@ -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(" {s}{s}\n", .{
|
||||
include.path, if (include.kind.isFramework())
|
||||
include.path,
|
||||
if (include.kind.isFramework())
|
||||
" (framework directory)"
|
||||
else
|
||||
"",
|
||||
|
|
|
|||
6
lib/compiler/translate-c/ast.zig
vendored
6
lib/compiler/translate-c/ast.zig
vendored
|
|
@ -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,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
@ -1948,7 +1951,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,
|
||||
}),
|
||||
|
|
@ -2743,7 +2747,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,
|
||||
}),
|
||||
|
|
@ -2757,7 +2762,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,
|
||||
|
|
@ -3235,7 +3241,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,
|
||||
|
|
@ -3258,7 +3265,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,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -2040,7 +2040,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(),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue