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(
572572 try zig_args.append(switch (unwind_tables) {
573573 .none => "-fno-unwind-tables",
574574 .sync => "-funwind-tables",
575 .@"async" => "-fasync-unwind-tables",
575 .async => "-fasync-unwind-tables",
576576 });
577577 }
578578
lib/std/Target.zig+1-1
......@@ -1691,7 +1691,7 @@ pub const Cpu = struct {
16911691 pub fn fromCallingConvention(cc: std.builtin.CallingConvention.Tag) []const Arch {
16921692 return switch (cc) {
16931693 .auto,
1694 .@"async",
1694 .async,
16951695 .naked,
16961696 .@"inline",
16971697 => unreachable,
lib/std/builtin.zig+2-2
......@@ -246,7 +246,7 @@ pub const CallingConvention = union(enum(u8)) {
246246 /// The calling convention of a function that can be called with `async` syntax. An `async` call
247247 /// of a runtime-known function must target a function with this calling convention.
248248 /// Comptime-known functions with other calling conventions may be coerced to this one.
249 @"async",
249 async,
250250
251251 /// Functions with this calling convention have no prologue or epilogue, making the function
252252 /// uncallable in regular Zig code. This can be useful when integrating with assembly.
......@@ -849,7 +849,7 @@ pub const LinkMode = enum {
849849pub const UnwindTables = enum {
850850 none,
851851 sync,
852 @"async",
852 async,
853853};
854854
855855/// 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) {
15211521 pub const UwTable = enum(u32) {
15221522 none,
15231523 sync,
1524 @"async",
1524 async,
15251525
1526 pub const default = UwTable.@"async";
1526 pub const default = UwTable.async;
15271527 };
15281528
15291529 pub const VScaleRange = packed struct(u32) {
src/Compilation.zig+1-1
......@@ -6466,7 +6466,7 @@ pub fn addCCArgs(
64666466 try argv.append("-fno-asynchronous-unwind-tables");
64676467 try argv.append("-funwind-tables");
64686468 },
6469 .@"async" => try argv.append("-fasynchronous-unwind-tables"),
6469 .async => try argv.append("-fasynchronous-unwind-tables"),
64706470 }
64716471
64726472 try argv.append("-nostdinc");
src/Sema.zig+1-1
......@@ -26687,7 +26687,7 @@ fn explainWhyTypeIsNotExtern(
2668726687 }
2668826688 switch (ty.fnCallingConvention(zcu)) {
2668926689 .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", .{}),
2669126691 .@"inline" => try sema.errNote(src_loc, msg, "inline function cannot be extern", .{}),
2669226692 else => return,
2669326693 }
src/Type.zig+1-1
......@@ -382,7 +382,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
382382 }
383383 }
384384 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))}),
386386 else => try writer.print("callconv({any}) ", .{fn_info.cc}),
387387 }
388388 }
src/Zcu.zig+1-1
......@@ -4453,7 +4453,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
44534453 const backend = target_util.zigBackend(target, zcu.comp.config.use_llvm);
44544454 switch (cc) {
44554455 .auto, .@"inline" => return .ok,
4456 .@"async" => return .{ .bad_backend = backend }, // nothing supports async currently
4456 .async => return .{ .bad_backend = backend }, // nothing supports async currently
44574457 .naked => {}, // depends only on backend
44584458 else => for (cc.archs()) |allowed_arch| {
44594459 if (allowed_arch == target.cpu.arch) break;
src/codegen/llvm.zig+5-5
......@@ -2758,7 +2758,7 @@ pub const Object = struct {
27582758 llvm_arg_i += 1;
27592759 }
27602760
2761 if (fn_info.cc == .@"async") {
2761 if (fn_info.cc == .async) {
27622762 @panic("TODO: LLVM backend lower async function");
27632763 }
27642764
......@@ -2910,7 +2910,7 @@ pub const Object = struct {
29102910 try attributes.addFnAttr(.nounwind, &o.builder);
29112911 if (owner_mod.unwind_tables != .none) {
29122912 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 },
29142914 &o.builder,
29152915 );
29162916 }
......@@ -11871,7 +11871,7 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *const s
1187111871 }
1187211872 return switch (cc_tag) {
1187311873 .@"inline" => unreachable,
11874 .auto, .@"async" => .fastcc,
11874 .auto, .async => .fastcc,
1187511875 .naked => .ccc,
1187611876 .x86_64_sysv => .x86_64_sysvcc,
1187711877 .x86_64_win => .win64cc,
......@@ -12379,7 +12379,7 @@ const ParamTypeIterator = struct {
1237912379 return .byval;
1238012380 }
1238112381 },
12382 .@"async" => {
12382 .async => {
1238312383 @panic("TODO implement async function lowering in the LLVM backend");
1238412384 },
1238512385 .x86_64_sysv => return it.nextSystemV(ty),
......@@ -12634,7 +12634,7 @@ fn ccAbiPromoteInt(
1263412634) ?std.builtin.Signedness {
1263512635 const target = zcu.getTarget();
1263612636 switch (cc) {
12637 .auto, .@"inline", .@"async" => return null,
12637 .auto, .@"inline", .async => return null,
1263812638 else => {},
1263912639 }
1264012640 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
325325 // See the `-fno-exceptions` logic for WASI.
326326 // The old 32-bit x86 variant of SEH doesn't use tables.
327327 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
330330 const config = Compilation.Config.resolve(.{
331331 .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
4848 const optimize_mode = comp.compilerRtOptMode();
4949 const strip = comp.compilerRtStrip();
5050 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;
5252 const link_libcpp = target.os.tag.isDarwin();
5353
5454 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
2929 const output_mode = .Lib;
3030 const target = &comp.root_mod.resolved_target.result;
3131 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;
3333 const config = Compilation.Config.resolve(.{
3434 .output_mode = output_mode,
3535 .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
2929 const target = comp.getTarget();
3030
3131 // 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
3434 switch (crt_file) {
3535 .crt2_o => {
src/link/Dwarf.zig+1-1
......@@ -3596,7 +3596,7 @@ fn updateLazyType(
35963596 // For better or worse, we try to match what Clang emits.
35973597 break :cc switch (func_type.cc) {
35983598 .@"inline" => .nocall,
3599 .@"async", .auto, .naked => .normal,
3599 .async, .auto, .naked => .normal,
36003600 .x86_64_sysv => .LLVM_X86_64SysV,
36013601 .x86_64_win => .LLVM_Win64,
36023602 .x86_64_regcall_v3_sysv => .LLVM_X86RegCall,
src/main.zig+6-6
......@@ -1416,7 +1416,7 @@ fn buildOutputType(
14161416 } else if (mem.eql(u8, arg, "-funwind-tables")) {
14171417 mod_opts.unwind_tables = .sync;
14181418 } else if (mem.eql(u8, arg, "-fasync-unwind-tables")) {
1419 mod_opts.unwind_tables = .@"async";
1419 mod_opts.unwind_tables = .async;
14201420 } else if (mem.eql(u8, arg, "-fno-unwind-tables")) {
14211421 mod_opts.unwind_tables = .none;
14221422 } else if (mem.eql(u8, arg, "-fstack-check")) {
......@@ -2035,15 +2035,15 @@ fn buildOutputType(
20352035 .none => {
20362036 mod_opts.unwind_tables = .sync;
20372037 },
2038 .sync, .@"async" => {},
2038 .sync, .async => {},
20392039 } else {
20402040 mod_opts.unwind_tables = .sync;
20412041 },
20422042 .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,
20442044 .no_asynchronous_unwind_tables => if (mod_opts.unwind_tables) |uwt| switch (uwt) {
20452045 .none, .sync => {},
2046 .@"async" => {
2046 .async => {
20472047 mod_opts.unwind_tables = .sync;
20482048 },
20492049 } else {
......@@ -2951,7 +2951,7 @@ fn buildOutputType(
29512951 create_module.opts.any_fuzz = true;
29522952 if (mod_opts.unwind_tables) |uwt| switch (uwt) {
29532953 .none => {},
2954 .sync, .@"async" => create_module.opts.any_unwind_tables = true,
2954 .sync, .async => create_module.opts.any_unwind_tables = true,
29552955 };
29562956 if (mod_opts.strip == false)
29572957 create_module.opts.any_non_stripped = true;
......@@ -7413,7 +7413,7 @@ fn handleModArg(
74137413 create_module.opts.any_fuzz = true;
74147414 if (mod_opts.unwind_tables) |uwt| switch (uwt) {
74157415 .none => {},
7416 .sync, .@"async" => create_module.opts.any_unwind_tables = true,
7416 .sync, .async => create_module.opts.any_unwind_tables = true,
74177417 };
74187418 if (mod_opts.strip == false)
74197419 create_module.opts.any_non_stripped = true;
src/target.zig+6-6
......@@ -483,12 +483,12 @@ pub fn clangSupportsNoImplicitFloatArg(target: *const std.Target) bool {
483483pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: bool) std.builtin.UnwindTables {
484484 if (target.os.tag == .windows) {
485485 // 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;
487487 }
488 if (target.os.tag.isDarwin()) return .@"async";
489 if (libunwind) return .@"async";
490 if (libtsan) return .@"async";
491 if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .@"async";
488 if (target.os.tag.isDarwin()) return .async;
489 if (libunwind) return .async;
490 if (libtsan) return .async;
491 if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .async;
492492 return .none;
493493}
494494
......@@ -815,7 +815,7 @@ pub fn compilerRtIntAbbrev(bits: u16) []const u8 {
815815
816816pub fn fnCallConvAllowsZigTypes(cc: std.builtin.CallingConvention) bool {
817817 return switch (cc) {
818 .auto, .@"async", .@"inline" => true,
818 .auto, .async, .@"inline" => true,
819819 // For now we want to authorize PTX kernel to use zig objects, even if
820820 // we end up exposing the ABI. The goal is to experiment with more
821821 // integrated CPU/GPU code.
test/standalone/stack_iterator/build.zig+3-3
......@@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {
2929 .root_source_file = b.path("unwind.zig"),
3030 .target = target,
3131 .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,
3333 .omit_frame_pointer = false,
3434 }),
3535 });
......@@ -54,7 +54,7 @@ pub fn build(b: *std.Build) void {
5454 .root_source_file = b.path("unwind.zig"),
5555 .target = target,
5656 .optimize = optimize,
57 .unwind_tables = .@"async",
57 .unwind_tables = .async,
5858 .omit_frame_pointer = true,
5959 }),
6060 // self-hosted lacks omit_frame_pointer support
......@@ -101,7 +101,7 @@ pub fn build(b: *std.Build) void {
101101 .root_source_file = b.path("shared_lib_unwind.zig"),
102102 .target = target,
103103 .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,
105105 .omit_frame_pointer = true,
106106 }),
107107 // zig objcopy doesn't support incremental binaries