aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-12-31 04:58:00 -0500
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 13:38:30 -0800
commit3f2a65594e1d3c0a4f4943a4ea522e8405db81e0 (patch)
treed93d69c0a60cf7d8c695f9d434b114c57005257f /src/Sema.zig
parent4129996211edd30b25c23454520fd78b2a70394b (diff)
downloadzig-3f2a65594e1d3c0a4f4943a4ea522e8405db81e0.tar.gz
zig-3f2a65594e1d3c0a4f4943a4ea522e8405db81e0.zip
Compilation: cleanup hashmap usage
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index d99e7827be..2f1dc07328 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -93,7 +93,7 @@ no_partial_func_ty: bool = false,
/// The temporary arena is used for the memory of the `InferredAlloc` values
/// here so the values can be dropped without any cleanup.
-unresolved_inferred_allocs: std.AutoHashMapUnmanaged(Air.Inst.Index, InferredAlloc) = .{},
+unresolved_inferred_allocs: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InferredAlloc) = .{},
/// Indices of comptime-mutable decls created by this Sema. These decls' values
/// should be interned after analysis completes, as they may refer to memory in
@@ -4040,7 +4040,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
},
.inferred_alloc => {
const ia1 = sema.air_instructions.items(.data)[@intFromEnum(ptr_inst)].inferred_alloc;
- const ia2 = sema.unresolved_inferred_allocs.fetchRemove(ptr_inst).?.value;
+ const ia2 = sema.unresolved_inferred_allocs.fetchSwapRemove(ptr_inst).?.value;
const peer_vals = try sema.arena.alloc(Air.Inst.Ref, ia2.prongs.items.len);
for (peer_vals, ia2.prongs.items) |*peer_val, store_inst| {
assert(sema.air_instructions.items(.tag)[@intFromEnum(store_inst)] == .store);