aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2024-09-12 19:50:38 +0100
committerGitHub <noreply@github.com>2024-09-12 19:50:38 +0100
commit0001f91e4e1e51cd64cdd5c0a21451c8bad67233 (patch)
tree9c3efb262890fa76a9b1d02c694dadad11c316f4 /src/codegen/c.zig
parentb95e0e09dcbe4ca948fd4098a8e3a4d90df9cb22 (diff)
parent9271a89c65967ff0fed7011b4195abdd0f9195eb (diff)
downloadzig-0001f91e4e1e51cd64cdd5c0a21451c8bad67233.tar.gz
zig-0001f91e4e1e51cd64cdd5c0a21451c8bad67233.zip
Merge pull request #21287 from linusg/deprecated-default-init
Replace deprecated default initializations with decl literals
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 0ec5513b6f..466bdcde6a 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -304,14 +304,14 @@ pub const Function = struct {
air: Air,
liveness: Liveness,
value_map: CValueMap,
- blocks: std.AutoHashMapUnmanaged(Air.Inst.Index, BlockData) = .{},
+ blocks: std.AutoHashMapUnmanaged(Air.Inst.Index, BlockData) = .empty,
next_arg_index: usize = 0,
next_block_index: usize = 0,
object: Object,
lazy_fns: LazyFnMap,
func_index: InternPool.Index,
/// All the locals, to be emitted at the top of the function.
- locals: std.ArrayListUnmanaged(Local) = .{},
+ locals: std.ArrayListUnmanaged(Local) = .empty,
/// Which locals are available for reuse, based on Type.
free_locals_map: LocalsMap = .{},
/// Locals which will not be freed by Liveness. This is used after a
@@ -320,10 +320,10 @@ pub const Function = struct {
/// of variable declarations at the top of a function, sorted descending
/// by type alignment.
/// The value is whether the alloc needs to be emitted in the header.
- allocs: std.AutoArrayHashMapUnmanaged(LocalIndex, bool) = .{},
+ allocs: std.AutoArrayHashMapUnmanaged(LocalIndex, bool) = .empty,
/// Maps from `loop_switch_br` instructions to the allocated local used
/// for the switch cond. Dispatches should set this local to the new cond.
- loop_switch_conds: std.AutoHashMapUnmanaged(Air.Inst.Index, LocalIndex) = .{},
+ loop_switch_conds: std.AutoHashMapUnmanaged(Air.Inst.Index, LocalIndex) = .empty,
fn resolveInst(f: *Function, ref: Air.Inst.Ref) !CValue {
const gop = try f.value_map.getOrPut(ref);