authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-07 11:38:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-07 13:39:16-07:00
logaa52bb83271edc626cd931cf9e8dfbcfc90d4cf2
tree4ddab249d8aabafb74221d2d96812b554eedfd39
parenta59c35cbf86e0266d5074ce219feef8436e45268

zig fmt


17 files changed, 35 insertions(+), 35 deletions(-)

lib/std/Build/Module.zig+1-1
...@@ -572,7 +572,7 @@ pub fn appendZigProcessFlags(...@@ -572,7 +572,7 @@ pub fn appendZigProcessFlags(
572 try zig_args.append(switch (unwind_tables) {572 try zig_args.append(switch (unwind_tables) {
573 .none => "-fno-unwind-tables",573 .none => "-fno-unwind-tables",
574 .sync => "-funwind-tables",574 .sync => "-funwind-tables",
575 .@"async" => "-fasync-unwind-tables",575 .async => "-fasync-unwind-tables",
576 });576 });
577 }577 }
578578
lib/std/Target.zig+1-1
...@@ -1691,7 +1691,7 @@ pub const Cpu = struct {...@@ -1691,7 +1691,7 @@ pub const Cpu = struct {
1691 pub fn fromCallingConvention(cc: std.builtin.CallingConvention.Tag) []const Arch {1691 pub fn fromCallingConvention(cc: std.builtin.CallingConvention.Tag) []const Arch {
1692 return switch (cc) {1692 return switch (cc) {
1693 .auto,1693 .auto,
1694 .@"async",1694 .async,
1695 .naked,1695 .naked,
1696 .@"inline",1696 .@"inline",
1697 => unreachable,1697 => unreachable,
lib/std/builtin.zig+2-2
...@@ -246,7 +246,7 @@ pub const CallingConvention = union(enum(u8)) {...@@ -246,7 +246,7 @@ pub const CallingConvention = union(enum(u8)) {
246 /// The calling convention of a function that can be called with `async` syntax. An `async` call246 /// The calling convention of a function that can be called with `async` syntax. An `async` call
247 /// of a runtime-known function must target a function with this calling convention.247 /// of a runtime-known function must target a function with this calling convention.
248 /// Comptime-known functions with other calling conventions may be coerced to this one.248 /// Comptime-known functions with other calling conventions may be coerced to this one.
249 @"async",249 async,
250250
251 /// Functions with this calling convention have no prologue or epilogue, making the function251 /// Functions with this calling convention have no prologue or epilogue, making the function
252 /// uncallable in regular Zig code. This can be useful when integrating with assembly.252 /// uncallable in regular Zig code. This can be useful when integrating with assembly.
...@@ -849,7 +849,7 @@ pub const LinkMode = enum {...@@ -849,7 +849,7 @@ pub const LinkMode = enum {
849pub const UnwindTables = enum {849pub const UnwindTables = enum {
850 none,850 none,
851 sync,851 sync,
852 @"async",852 async,
853};853};
854854
855/// This data structure is used by the Zig language code generation and855/// This data structure is used by the Zig language code generation and
lib/std/zig/llvm/Builder.zig+2-2
...@@ -1521,9 +1521,9 @@ pub const Attribute = union(Kind) {...@@ -1521,9 +1521,9 @@ pub const Attribute = union(Kind) {
1521 pub const UwTable = enum(u32) {1521 pub const UwTable = enum(u32) {
1522 none,1522 none,
1523 sync,1523 sync,
1524 @"async",1524 async,
15251525
1526 pub const default = UwTable.@"async";1526 pub const default = UwTable.async;
1527 };1527 };
15281528
1529 pub const VScaleRange = packed struct(u32) {1529 pub const VScaleRange = packed struct(u32) {
src/Compilation.zig+1-1
...@@ -6466,7 +6466,7 @@ pub fn addCCArgs(...@@ -6466,7 +6466,7 @@ pub fn addCCArgs(
6466 try argv.append("-fno-asynchronous-unwind-tables");6466 try argv.append("-fno-asynchronous-unwind-tables");
6467 try argv.append("-funwind-tables");6467 try argv.append("-funwind-tables");
6468 },6468 },
6469 .@"async" => try argv.append("-fasynchronous-unwind-tables"),6469 .async => try argv.append("-fasynchronous-unwind-tables"),
6470 }6470 }
64716471
6472 try argv.append("-nostdinc");6472 try argv.append("-nostdinc");
src/Sema.zig+1-1
...@@ -26687,7 +26687,7 @@ fn explainWhyTypeIsNotExtern(...@@ -26687,7 +26687,7 @@ fn explainWhyTypeIsNotExtern(
26687 }26687 }
26688 switch (ty.fnCallingConvention(zcu)) {26688 switch (ty.fnCallingConvention(zcu)) {
26689 .auto => try sema.errNote(src_loc, msg, "extern function must specify calling convention", .{}),26689 .auto => try sema.errNote(src_loc, msg, "extern function must specify calling convention", .{}),
26690 .@"async" => try sema.errNote(src_loc, msg, "async function cannot be extern", .{}),26690 .async => try sema.errNote(src_loc, msg, "async function cannot be extern", .{}),
26691 .@"inline" => try sema.errNote(src_loc, msg, "inline function cannot be extern", .{}),26691 .@"inline" => try sema.errNote(src_loc, msg, "inline function cannot be extern", .{}),
26692 else => return,26692 else => return,
26693 }26693 }
src/Type.zig+1-1
...@@ -382,7 +382,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error...@@ -382,7 +382,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
382 }382 }
383 }383 }
384 switch (fn_info.cc) {384 switch (fn_info.cc) {
385 .auto, .@"async", .naked, .@"inline" => try writer.print("callconv(.{}) ", .{std.zig.fmtId(@tagName(fn_info.cc))}),385 .auto, .async, .naked, .@"inline" => try writer.print("callconv(.{}) ", .{std.zig.fmtId(@tagName(fn_info.cc))}),
386 else => try writer.print("callconv({any}) ", .{fn_info.cc}),386 else => try writer.print("callconv({any}) ", .{fn_info.cc}),
387 }387 }
388 }388 }
src/Zcu.zig+1-1
...@@ -4453,7 +4453,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu...@@ -4453,7 +4453,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
4453 const backend = target_util.zigBackend(target, zcu.comp.config.use_llvm);4453 const backend = target_util.zigBackend(target, zcu.comp.config.use_llvm);
4454 switch (cc) {4454 switch (cc) {
4455 .auto, .@"inline" => return .ok,4455 .auto, .@"inline" => return .ok,
4456 .@"async" => return .{ .bad_backend = backend }, // nothing supports async currently4456 .async => return .{ .bad_backend = backend }, // nothing supports async currently
4457 .naked => {}, // depends only on backend4457 .naked => {}, // depends only on backend
4458 else => for (cc.archs()) |allowed_arch| {4458 else => for (cc.archs()) |allowed_arch| {
4459 if (allowed_arch == target.cpu.arch) break;4459 if (allowed_arch == target.cpu.arch) break;
src/codegen/llvm.zig+5-5
...@@ -2758,7 +2758,7 @@ pub const Object = struct {...@@ -2758,7 +2758,7 @@ pub const Object = struct {
2758 llvm_arg_i += 1;2758 llvm_arg_i += 1;
2759 }2759 }
27602760
2761 if (fn_info.cc == .@"async") {2761 if (fn_info.cc == .async) {
2762 @panic("TODO: LLVM backend lower async function");2762 @panic("TODO: LLVM backend lower async function");
2763 }2763 }
27642764
...@@ -2910,7 +2910,7 @@ pub const Object = struct {...@@ -2910,7 +2910,7 @@ pub const Object = struct {
2910 try attributes.addFnAttr(.nounwind, &o.builder);2910 try attributes.addFnAttr(.nounwind, &o.builder);
2911 if (owner_mod.unwind_tables != .none) {2911 if (owner_mod.unwind_tables != .none) {
2912 try attributes.addFnAttr(2912 try attributes.addFnAttr(
2913 .{ .uwtable = if (owner_mod.unwind_tables == .@"async") .@"async" else .sync },2913 .{ .uwtable = if (owner_mod.unwind_tables == .async) .async else .sync },
2914 &o.builder,2914 &o.builder,
2915 );2915 );
2916 }2916 }
...@@ -11871,7 +11871,7 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *const s...@@ -11871,7 +11871,7 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *const s
11871 }11871 }
11872 return switch (cc_tag) {11872 return switch (cc_tag) {
11873 .@"inline" => unreachable,11873 .@"inline" => unreachable,
11874 .auto, .@"async" => .fastcc,11874 .auto, .async => .fastcc,
11875 .naked => .ccc,11875 .naked => .ccc,
11876 .x86_64_sysv => .x86_64_sysvcc,11876 .x86_64_sysv => .x86_64_sysvcc,
11877 .x86_64_win => .win64cc,11877 .x86_64_win => .win64cc,
...@@ -12379,7 +12379,7 @@ const ParamTypeIterator = struct {...@@ -12379,7 +12379,7 @@ const ParamTypeIterator = struct {
12379 return .byval;12379 return .byval;
12380 }12380 }
12381 },12381 },
12382 .@"async" => {12382 .async => {
12383 @panic("TODO implement async function lowering in the LLVM backend");12383 @panic("TODO implement async function lowering in the LLVM backend");
12384 },12384 },
12385 .x86_64_sysv => return it.nextSystemV(ty),12385 .x86_64_sysv => return it.nextSystemV(ty),
...@@ -12634,7 +12634,7 @@ fn ccAbiPromoteInt(...@@ -12634,7 +12634,7 @@ fn ccAbiPromoteInt(
12634) ?std.builtin.Signedness {12634) ?std.builtin.Signedness {
12635 const target = zcu.getTarget();12635 const target = zcu.getTarget();
12636 switch (cc) {12636 switch (cc) {
12637 .auto, .@"inline", .@"async" => return null,12637 .auto, .@"inline", .async => return null,
12638 else => {},12638 else => {},
12639 }12639 }
12640 const int_info = switch (ty.zigTypeTag(zcu)) {12640 const int_info = switch (ty.zigTypeTag(zcu)) {
src/libs/libcxx.zig+1-1
...@@ -325,7 +325,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -325,7 +325,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
325 // See the `-fno-exceptions` logic for WASI.325 // See the `-fno-exceptions` logic for WASI.
326 // The old 32-bit x86 variant of SEH doesn't use tables.326 // The old 32-bit x86 variant of SEH doesn't use tables.
327 const unwind_tables: std.builtin.UnwindTables =327 const unwind_tables: std.builtin.UnwindTables =
328 if (target.os.tag == .wasi or (target.cpu.arch == .x86 and target.os.tag == .windows)) .none else .@"async";328 if (target.os.tag == .wasi or (target.cpu.arch == .x86 and target.os.tag == .windows)) .none else .async;
329329
330 const config = Compilation.Config.resolve(.{330 const config = Compilation.Config.resolve(.{
331 .output_mode = output_mode,331 .output_mode = output_mode,
src/libs/libtsan.zig+1-1
...@@ -48,7 +48,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo...@@ -48,7 +48,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
48 const optimize_mode = comp.compilerRtOptMode();48 const optimize_mode = comp.compilerRtOptMode();
49 const strip = comp.compilerRtStrip();49 const strip = comp.compilerRtStrip();
50 const unwind_tables: std.builtin.UnwindTables =50 const unwind_tables: std.builtin.UnwindTables =
51 if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .@"async";51 if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .async;
52 const link_libcpp = target.os.tag.isDarwin();52 const link_libcpp = target.os.tag.isDarwin();
5353
54 const config = Compilation.Config.resolve(.{54 const config = Compilation.Config.resolve(.{
src/libs/libunwind.zig+1-1
...@@ -29,7 +29,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -29,7 +29,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
29 const output_mode = .Lib;29 const output_mode = .Lib;
30 const target = &comp.root_mod.resolved_target.result;30 const target = &comp.root_mod.resolved_target.result;
31 const unwind_tables: std.builtin.UnwindTables =31 const unwind_tables: std.builtin.UnwindTables =
32 if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .@"async";32 if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .async;
33 const config = Compilation.Config.resolve(.{33 const config = Compilation.Config.resolve(.{
34 .output_mode = output_mode,34 .output_mode = output_mode,
35 .resolved_target = comp.root_mod.resolved_target,35 .resolved_target = comp.root_mod.resolved_target,
src/libs/mingw.zig+1-1
...@@ -29,7 +29,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -29,7 +29,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
29 const target = comp.getTarget();29 const target = comp.getTarget();
3030
31 // The old 32-bit x86 variant of SEH doesn't use tables.31 // The old 32-bit x86 variant of SEH doesn't use tables.
32 const unwind_tables: std.builtin.UnwindTables = if (target.cpu.arch != .x86) .@"async" else .none;32 const unwind_tables: std.builtin.UnwindTables = if (target.cpu.arch != .x86) .async else .none;
3333
34 switch (crt_file) {34 switch (crt_file) {
35 .crt2_o => {35 .crt2_o => {
src/link/Dwarf.zig+1-1
...@@ -3596,7 +3596,7 @@ fn updateLazyType(...@@ -3596,7 +3596,7 @@ fn updateLazyType(
3596 // For better or worse, we try to match what Clang emits.3596 // For better or worse, we try to match what Clang emits.
3597 break :cc switch (func_type.cc) {3597 break :cc switch (func_type.cc) {
3598 .@"inline" => .nocall,3598 .@"inline" => .nocall,
3599 .@"async", .auto, .naked => .normal,3599 .async, .auto, .naked => .normal,
3600 .x86_64_sysv => .LLVM_X86_64SysV,3600 .x86_64_sysv => .LLVM_X86_64SysV,
3601 .x86_64_win => .LLVM_Win64,3601 .x86_64_win => .LLVM_Win64,
3602 .x86_64_regcall_v3_sysv => .LLVM_X86RegCall,3602 .x86_64_regcall_v3_sysv => .LLVM_X86RegCall,
src/main.zig+6-6
...@@ -1416,7 +1416,7 @@ fn buildOutputType(...@@ -1416,7 +1416,7 @@ fn buildOutputType(
1416 } else if (mem.eql(u8, arg, "-funwind-tables")) {1416 } else if (mem.eql(u8, arg, "-funwind-tables")) {
1417 mod_opts.unwind_tables = .sync;1417 mod_opts.unwind_tables = .sync;
1418 } else if (mem.eql(u8, arg, "-fasync-unwind-tables")) {1418 } else if (mem.eql(u8, arg, "-fasync-unwind-tables")) {
1419 mod_opts.unwind_tables = .@"async";1419 mod_opts.unwind_tables = .async;
1420 } else if (mem.eql(u8, arg, "-fno-unwind-tables")) {1420 } else if (mem.eql(u8, arg, "-fno-unwind-tables")) {
1421 mod_opts.unwind_tables = .none;1421 mod_opts.unwind_tables = .none;
1422 } else if (mem.eql(u8, arg, "-fstack-check")) {1422 } else if (mem.eql(u8, arg, "-fstack-check")) {
...@@ -2035,15 +2035,15 @@ fn buildOutputType(...@@ -2035,15 +2035,15 @@ fn buildOutputType(
2035 .none => {2035 .none => {
2036 mod_opts.unwind_tables = .sync;2036 mod_opts.unwind_tables = .sync;
2037 },2037 },
2038 .sync, .@"async" => {},2038 .sync, .async => {},
2039 } else {2039 } else {
2040 mod_opts.unwind_tables = .sync;2040 mod_opts.unwind_tables = .sync;
2041 },2041 },
2042 .no_unwind_tables => mod_opts.unwind_tables = .none,2042 .no_unwind_tables => mod_opts.unwind_tables = .none,
2043 .asynchronous_unwind_tables => mod_opts.unwind_tables = .@"async",2043 .asynchronous_unwind_tables => mod_opts.unwind_tables = .async,
2044 .no_asynchronous_unwind_tables => if (mod_opts.unwind_tables) |uwt| switch (uwt) {2044 .no_asynchronous_unwind_tables => if (mod_opts.unwind_tables) |uwt| switch (uwt) {
2045 .none, .sync => {},2045 .none, .sync => {},
2046 .@"async" => {2046 .async => {
2047 mod_opts.unwind_tables = .sync;2047 mod_opts.unwind_tables = .sync;
2048 },2048 },
2049 } else {2049 } else {
...@@ -2951,7 +2951,7 @@ fn buildOutputType(...@@ -2951,7 +2951,7 @@ fn buildOutputType(
2951 create_module.opts.any_fuzz = true;2951 create_module.opts.any_fuzz = true;
2952 if (mod_opts.unwind_tables) |uwt| switch (uwt) {2952 if (mod_opts.unwind_tables) |uwt| switch (uwt) {
2953 .none => {},2953 .none => {},
2954 .sync, .@"async" => create_module.opts.any_unwind_tables = true,2954 .sync, .async => create_module.opts.any_unwind_tables = true,
2955 };2955 };
2956 if (mod_opts.strip == false)2956 if (mod_opts.strip == false)
2957 create_module.opts.any_non_stripped = true;2957 create_module.opts.any_non_stripped = true;
...@@ -7413,7 +7413,7 @@ fn handleModArg(...@@ -7413,7 +7413,7 @@ fn handleModArg(
7413 create_module.opts.any_fuzz = true;7413 create_module.opts.any_fuzz = true;
7414 if (mod_opts.unwind_tables) |uwt| switch (uwt) {7414 if (mod_opts.unwind_tables) |uwt| switch (uwt) {
7415 .none => {},7415 .none => {},
7416 .sync, .@"async" => create_module.opts.any_unwind_tables = true,7416 .sync, .async => create_module.opts.any_unwind_tables = true,
7417 };7417 };
7418 if (mod_opts.strip == false)7418 if (mod_opts.strip == false)
7419 create_module.opts.any_non_stripped = true;7419 create_module.opts.any_non_stripped = true;
src/target.zig+6-6
...@@ -483,12 +483,12 @@ pub fn clangSupportsNoImplicitFloatArg(target: *const std.Target) bool {...@@ -483,12 +483,12 @@ pub fn clangSupportsNoImplicitFloatArg(target: *const std.Target) bool {
483pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: bool) std.builtin.UnwindTables {483pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: bool) std.builtin.UnwindTables {
484 if (target.os.tag == .windows) {484 if (target.os.tag == .windows) {
485 // The old 32-bit x86 variant of SEH doesn't use tables.485 // The old 32-bit x86 variant of SEH doesn't use tables.
486 return if (target.cpu.arch != .x86) .@"async" else .none;486 return if (target.cpu.arch != .x86) .async else .none;
487 }487 }
488 if (target.os.tag.isDarwin()) return .@"async";488 if (target.os.tag.isDarwin()) return .async;
489 if (libunwind) return .@"async";489 if (libunwind) return .async;
490 if (libtsan) return .@"async";490 if (libtsan) return .async;
491 if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .@"async";491 if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .async;
492 return .none;492 return .none;
493}493}
494494
...@@ -815,7 +815,7 @@ pub fn compilerRtIntAbbrev(bits: u16) []const u8 {...@@ -815,7 +815,7 @@ pub fn compilerRtIntAbbrev(bits: u16) []const u8 {
815815
816pub fn fnCallConvAllowsZigTypes(cc: std.builtin.CallingConvention) bool {816pub fn fnCallConvAllowsZigTypes(cc: std.builtin.CallingConvention) bool {
817 return switch (cc) {817 return switch (cc) {
818 .auto, .@"async", .@"inline" => true,818 .auto, .async, .@"inline" => true,
819 // For now we want to authorize PTX kernel to use zig objects, even if819 // For now we want to authorize PTX kernel to use zig objects, even if
820 // we end up exposing the ABI. The goal is to experiment with more820 // we end up exposing the ABI. The goal is to experiment with more
821 // integrated CPU/GPU code.821 // integrated CPU/GPU code.
test/standalone/stack_iterator/build.zig+3-3
...@@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {...@@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {
29 .root_source_file = b.path("unwind.zig"),29 .root_source_file = b.path("unwind.zig"),
30 .target = target,30 .target = target,
31 .optimize = optimize,31 .optimize = optimize,
32 .unwind_tables = if (target.result.os.tag.isDarwin()) .@"async" else null,32 .unwind_tables = if (target.result.os.tag.isDarwin()) .async else null,
33 .omit_frame_pointer = false,33 .omit_frame_pointer = false,
34 }),34 }),
35 });35 });
...@@ -54,7 +54,7 @@ pub fn build(b: *std.Build) void {...@@ -54,7 +54,7 @@ pub fn build(b: *std.Build) void {
54 .root_source_file = b.path("unwind.zig"),54 .root_source_file = b.path("unwind.zig"),
55 .target = target,55 .target = target,
56 .optimize = optimize,56 .optimize = optimize,
57 .unwind_tables = .@"async",57 .unwind_tables = .async,
58 .omit_frame_pointer = true,58 .omit_frame_pointer = true,
59 }),59 }),
60 // self-hosted lacks omit_frame_pointer support60 // self-hosted lacks omit_frame_pointer support
...@@ -101,7 +101,7 @@ pub fn build(b: *std.Build) void {...@@ -101,7 +101,7 @@ pub fn build(b: *std.Build) void {
101 .root_source_file = b.path("shared_lib_unwind.zig"),101 .root_source_file = b.path("shared_lib_unwind.zig"),
102 .target = target,102 .target = target,
103 .optimize = optimize,103 .optimize = optimize,
104 .unwind_tables = if (target.result.os.tag.isDarwin()) .@"async" else null,104 .unwind_tables = if (target.result.os.tag.isDarwin()) .async else null,
105 .omit_frame_pointer = true,105 .omit_frame_pointer = true,
106 }),106 }),
107 // zig objcopy doesn't support incremental binaries107 // zig objcopy doesn't support incremental binaries