aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-07-07 11:38:15 -0700
committerAndrew Kelley <andrew@ziglang.org>2025-07-07 13:39:16 -0700
commitaa52bb83271edc626cd931cf9e8dfbcfc90d4cf2 (patch)
tree4ddab249d8aabafb74221d2d96812b554eedfd39 /src
parenta59c35cbf86e0266d5074ce219feef8436e45268 (diff)
downloadzig-aa52bb83271edc626cd931cf9e8dfbcfc90d4cf2.tar.gz
zig-aa52bb83271edc626cd931cf9e8dfbcfc90d4cf2.zip
zig fmt
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig2
-rw-r--r--src/Sema.zig2
-rw-r--r--src/Type.zig2
-rw-r--r--src/Zcu.zig2
-rw-r--r--src/codegen/llvm.zig10
-rw-r--r--src/libs/libcxx.zig2
-rw-r--r--src/libs/libtsan.zig2
-rw-r--r--src/libs/libunwind.zig2
-rw-r--r--src/libs/mingw.zig2
-rw-r--r--src/link/Dwarf.zig2
-rw-r--r--src/main.zig12
-rw-r--r--src/target.zig12
12 files changed, 26 insertions, 26 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index c954fc76bc..c85fb9608e 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -6466,7 +6466,7 @@ pub fn addCCArgs(
try argv.append("-fno-asynchronous-unwind-tables");
try argv.append("-funwind-tables");
},
- .@"async" => try argv.append("-fasynchronous-unwind-tables"),
+ .async => try argv.append("-fasynchronous-unwind-tables"),
}
try argv.append("-nostdinc");
diff --git a/src/Sema.zig b/src/Sema.zig
index bcb5dbe085..118e3da5a2 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -26687,7 +26687,7 @@ fn explainWhyTypeIsNotExtern(
}
switch (ty.fnCallingConvention(zcu)) {
.auto => try sema.errNote(src_loc, msg, "extern function must specify calling convention", .{}),
- .@"async" => try sema.errNote(src_loc, msg, "async function cannot be extern", .{}),
+ .async => try sema.errNote(src_loc, msg, "async function cannot be extern", .{}),
.@"inline" => try sema.errNote(src_loc, msg, "inline function cannot be extern", .{}),
else => return,
}
diff --git a/src/Type.zig b/src/Type.zig
index 219ef4a383..333e738b05 100644
--- a/src/Type.zig
+++ b/src/Type.zig
@@ -382,7 +382,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
}
}
switch (fn_info.cc) {
- .auto, .@"async", .naked, .@"inline" => try writer.print("callconv(.{}) ", .{std.zig.fmtId(@tagName(fn_info.cc))}),
+ .auto, .async, .naked, .@"inline" => try writer.print("callconv(.{}) ", .{std.zig.fmtId(@tagName(fn_info.cc))}),
else => try writer.print("callconv({any}) ", .{fn_info.cc}),
}
}
diff --git a/src/Zcu.zig b/src/Zcu.zig
index 24e7213753..5ba12056fd 100644
--- a/src/Zcu.zig
+++ b/src/Zcu.zig
@@ -4453,7 +4453,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
const backend = target_util.zigBackend(target, zcu.comp.config.use_llvm);
switch (cc) {
.auto, .@"inline" => return .ok,
- .@"async" => return .{ .bad_backend = backend }, // nothing supports async currently
+ .async => return .{ .bad_backend = backend }, // nothing supports async currently
.naked => {}, // depends only on backend
else => for (cc.archs()) |allowed_arch| {
if (allowed_arch == target.cpu.arch) break;
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index d2d6f431d7..827c6b796d 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -2758,7 +2758,7 @@ pub const Object = struct {
llvm_arg_i += 1;
}
- if (fn_info.cc == .@"async") {
+ if (fn_info.cc == .async) {
@panic("TODO: LLVM backend lower async function");
}
@@ -2910,7 +2910,7 @@ pub const Object = struct {
try attributes.addFnAttr(.nounwind, &o.builder);
if (owner_mod.unwind_tables != .none) {
try attributes.addFnAttr(
- .{ .uwtable = if (owner_mod.unwind_tables == .@"async") .@"async" else .sync },
+ .{ .uwtable = if (owner_mod.unwind_tables == .async) .async else .sync },
&o.builder,
);
}
@@ -11871,7 +11871,7 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *const s
}
return switch (cc_tag) {
.@"inline" => unreachable,
- .auto, .@"async" => .fastcc,
+ .auto, .async => .fastcc,
.naked => .ccc,
.x86_64_sysv => .x86_64_sysvcc,
.x86_64_win => .win64cc,
@@ -12379,7 +12379,7 @@ const ParamTypeIterator = struct {
return .byval;
}
},
- .@"async" => {
+ .async => {
@panic("TODO implement async function lowering in the LLVM backend");
},
.x86_64_sysv => return it.nextSystemV(ty),
@@ -12634,7 +12634,7 @@ fn ccAbiPromoteInt(
) ?std.builtin.Signedness {
const target = zcu.getTarget();
switch (cc) {
- .auto, .@"inline", .@"async" => return null,
+ .auto, .@"inline", .async => return null,
else => {},
}
const int_info = switch (ty.zigTypeTag(zcu)) {
diff --git a/src/libs/libcxx.zig b/src/libs/libcxx.zig
index f26f27732b..eebbb9cb73 100644
--- a/src/libs/libcxx.zig
+++ b/src/libs/libcxx.zig
@@ -325,7 +325,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
// See the `-fno-exceptions` logic for WASI.
// The old 32-bit x86 variant of SEH doesn't use tables.
const unwind_tables: std.builtin.UnwindTables =
- if (target.os.tag == .wasi or (target.cpu.arch == .x86 and target.os.tag == .windows)) .none else .@"async";
+ if (target.os.tag == .wasi or (target.cpu.arch == .x86 and target.os.tag == .windows)) .none else .async;
const config = Compilation.Config.resolve(.{
.output_mode = output_mode,
diff --git a/src/libs/libtsan.zig b/src/libs/libtsan.zig
index 36ca5faa25..de5a770e30 100644
--- a/src/libs/libtsan.zig
+++ b/src/libs/libtsan.zig
@@ -48,7 +48,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
const optimize_mode = comp.compilerRtOptMode();
const strip = comp.compilerRtStrip();
const unwind_tables: std.builtin.UnwindTables =
- if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .@"async";
+ if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .async;
const link_libcpp = target.os.tag.isDarwin();
const config = Compilation.Config.resolve(.{
diff --git a/src/libs/libunwind.zig b/src/libs/libunwind.zig
index 430ff59748..71cc6ccbc0 100644
--- a/src/libs/libunwind.zig
+++ b/src/libs/libunwind.zig
@@ -29,7 +29,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
const output_mode = .Lib;
const target = &comp.root_mod.resolved_target.result;
const unwind_tables: std.builtin.UnwindTables =
- if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .@"async";
+ if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .async;
const config = Compilation.Config.resolve(.{
.output_mode = output_mode,
.resolved_target = comp.root_mod.resolved_target,
diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig
index c5713b2ff7..00ab86e31f 100644
--- a/src/libs/mingw.zig
+++ b/src/libs/mingw.zig
@@ -29,7 +29,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
const target = comp.getTarget();
// The old 32-bit x86 variant of SEH doesn't use tables.
- const unwind_tables: std.builtin.UnwindTables = if (target.cpu.arch != .x86) .@"async" else .none;
+ const unwind_tables: std.builtin.UnwindTables = if (target.cpu.arch != .x86) .async else .none;
switch (crt_file) {
.crt2_o => {
diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig
index 605d1d23a4..8bdc54fcf0 100644
--- a/src/link/Dwarf.zig
+++ b/src/link/Dwarf.zig
@@ -3596,7 +3596,7 @@ fn updateLazyType(
// For better or worse, we try to match what Clang emits.
break :cc switch (func_type.cc) {
.@"inline" => .nocall,
- .@"async", .auto, .naked => .normal,
+ .async, .auto, .naked => .normal,
.x86_64_sysv => .LLVM_X86_64SysV,
.x86_64_win => .LLVM_Win64,
.x86_64_regcall_v3_sysv => .LLVM_X86RegCall,
diff --git a/src/main.zig b/src/main.zig
index aa20b8fae1..f3e8eb9634 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1416,7 +1416,7 @@ fn buildOutputType(
} else if (mem.eql(u8, arg, "-funwind-tables")) {
mod_opts.unwind_tables = .sync;
} else if (mem.eql(u8, arg, "-fasync-unwind-tables")) {
- mod_opts.unwind_tables = .@"async";
+ mod_opts.unwind_tables = .async;
} else if (mem.eql(u8, arg, "-fno-unwind-tables")) {
mod_opts.unwind_tables = .none;
} else if (mem.eql(u8, arg, "-fstack-check")) {
@@ -2035,15 +2035,15 @@ fn buildOutputType(
.none => {
mod_opts.unwind_tables = .sync;
},
- .sync, .@"async" => {},
+ .sync, .async => {},
} else {
mod_opts.unwind_tables = .sync;
},
.no_unwind_tables => mod_opts.unwind_tables = .none,
- .asynchronous_unwind_tables => mod_opts.unwind_tables = .@"async",
+ .asynchronous_unwind_tables => mod_opts.unwind_tables = .async,
.no_asynchronous_unwind_tables => if (mod_opts.unwind_tables) |uwt| switch (uwt) {
.none, .sync => {},
- .@"async" => {
+ .async => {
mod_opts.unwind_tables = .sync;
},
} else {
@@ -2951,7 +2951,7 @@ fn buildOutputType(
create_module.opts.any_fuzz = true;
if (mod_opts.unwind_tables) |uwt| switch (uwt) {
.none => {},
- .sync, .@"async" => create_module.opts.any_unwind_tables = true,
+ .sync, .async => create_module.opts.any_unwind_tables = true,
};
if (mod_opts.strip == false)
create_module.opts.any_non_stripped = true;
@@ -7413,7 +7413,7 @@ fn handleModArg(
create_module.opts.any_fuzz = true;
if (mod_opts.unwind_tables) |uwt| switch (uwt) {
.none => {},
- .sync, .@"async" => create_module.opts.any_unwind_tables = true,
+ .sync, .async => create_module.opts.any_unwind_tables = true,
};
if (mod_opts.strip == false)
create_module.opts.any_non_stripped = true;
diff --git a/src/target.zig b/src/target.zig
index 7852dda7a4..8c33a26939 100644
--- a/src/target.zig
+++ b/src/target.zig
@@ -483,12 +483,12 @@ pub fn clangSupportsNoImplicitFloatArg(target: *const std.Target) bool {
pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: bool) std.builtin.UnwindTables {
if (target.os.tag == .windows) {
// The old 32-bit x86 variant of SEH doesn't use tables.
- return if (target.cpu.arch != .x86) .@"async" else .none;
+ return if (target.cpu.arch != .x86) .async else .none;
}
- if (target.os.tag.isDarwin()) return .@"async";
- if (libunwind) return .@"async";
- if (libtsan) return .@"async";
- if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .@"async";
+ if (target.os.tag.isDarwin()) return .async;
+ if (libunwind) return .async;
+ if (libtsan) return .async;
+ if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .async;
return .none;
}
@@ -815,7 +815,7 @@ pub fn compilerRtIntAbbrev(bits: u16) []const u8 {
pub fn fnCallConvAllowsZigTypes(cc: std.builtin.CallingConvention) bool {
return switch (cc) {
- .auto, .@"async", .@"inline" => true,
+ .auto, .async, .@"inline" => true,
// For now we want to authorize PTX kernel to use zig objects, even if
// we end up exposing the ABI. The goal is to experiment with more
// integrated CPU/GPU code.