zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 39983d7ff524a3e1e25dbd6904e28a6dd11120e6 (tree)
parent cf88cf2657d721c68055a284e8c498a18639f74c
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon, 31 Jan 2022 21:12:37 -0700

stage2: update to new ArrayHashMap API

Diffstat:
Msrc/InternArena.zig | 5+++--
Msrc/codegen/spirv/type.zig | 3++-
Msrc/type.zig | 3++-
Msrc/value.zig | 3++-
4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/InternArena.zig b/src/InternArena.zig @@ -187,8 +187,9 @@ pub fn deinit(ia: *InternArena, gpa: Allocator) void { } pub fn indexToKey(ia: InternArena, index: Index) Key { - const data = ia.items.items(.data)[@enumToInt(index)]; - return switch (ia.items.items(.tag)[@enumToInt(index)]) { + const item = ia.items.get(@enumToInt(index)); + const data = item.data; + return switch (item.tag) { .type_int_signed => .{ .int_type = .{ .signedness = .signed, diff --git a/src/codegen/spirv/type.zig b/src/codegen/spirv/type.zig @@ -157,8 +157,9 @@ pub const Type = extern union { _ = self; return @truncate(u32, t.hashShallow()); } - pub fn eql(self: @This(), a: Type, b: Type) bool { + pub fn eql(self: @This(), a: Type, b: Type, b_index: usize) bool { _ = self; + _ = b_index; return a.eqlShallow(b); } }; diff --git a/src/type.zig b/src/type.zig @@ -798,8 +798,9 @@ pub const Type = extern union { _ = self; return @truncate(u32, t.hash()); } - pub fn eql(self: @This(), a: Type, b: Type) bool { + pub fn eql(self: @This(), a: Type, b: Type, b_index: usize) bool { _ = self; + _ = b_index; return a.eql(b); } }; diff --git a/src/value.zig b/src/value.zig @@ -1765,7 +1765,8 @@ pub const Value = extern union { const other_context: HashContext = .{ .ty = self.ty }; return @truncate(u32, other_context.hash(val)); } - pub fn eql(self: @This(), a: Value, b: Value) bool { + pub fn eql(self: @This(), a: Value, b: Value, b_index: usize) bool { + _ = b_index; return a.eql(b, self.ty); } };