From 39983d7ff524a3e1e25dbd6904e28a6dd11120e6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 31 Jan 2022 21:12:37 -0700 Subject: [PATCH] stage2: update to new ArrayHashMap API --- src/InternArena.zig | 5 +++-- src/codegen/spirv/type.zig | 3 ++- src/type.zig | 3 ++- src/value.zig | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/InternArena.zig b/src/InternArena.zig index a8e9c75e50c8eb7dd902f0cc00193db87f4881ad..5dba21e11c4c34e07ebcdfecc5ce76b29746407f 100644 --- 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 index 3eef2d804027718d393579050cf367c7b6ba46c4..d9504f4d23fc20dd0017153371dd55c10dd2a0de 100644 --- 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 index 23a741eed02118375de120f68767e0b5a8913f70..5632629bff726070df6b0846b7f9ed03418a0b4c 100644 --- 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 index df1531533b69cb3fc71114dd31702e32c6ad5da2..75c3aac6e72c74c09087f64e0874e57dd7400494 100644 --- 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); } }; -- 2.54.0