authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-01-31 21:12:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-01-31 21:12:37-07:00
log39983d7ff524a3e1e25dbd6904e28a6dd11120e6
tree07fbae62ddf8d78dffd7210545d0962f358ccf98
parentcf88cf2657d721c68055a284e8c498a18639f74c

stage2: update to new ArrayHashMap API


4 files changed, 9 insertions(+), 5 deletions(-)

src/InternArena.zig+3-2
...@@ -187,8 +187,9 @@ pub fn deinit(ia: *InternArena, gpa: Allocator) void {...@@ -187,8 +187,9 @@ pub fn deinit(ia: *InternArena, gpa: Allocator) void {
187}187}
188188
189pub fn indexToKey(ia: InternArena, index: Index) Key {189pub fn indexToKey(ia: InternArena, index: Index) Key {
190 const data = ia.items.items(.data)[@enumToInt(index)];190 const item = ia.items.get(@enumToInt(index));
191 return switch (ia.items.items(.tag)[@enumToInt(index)]) {191 const data = item.data;
192 return switch (item.tag) {
192 .type_int_signed => .{193 .type_int_signed => .{
193 .int_type = .{194 .int_type = .{
194 .signedness = .signed,195 .signedness = .signed,
src/codegen/spirv/type.zig+2-1
...@@ -157,8 +157,9 @@ pub const Type = extern union {...@@ -157,8 +157,9 @@ pub const Type = extern union {
157 _ = self;157 _ = self;
158 return @truncate(u32, t.hashShallow());158 return @truncate(u32, t.hashShallow());
159 }159 }
160 pub fn eql(self: @This(), a: Type, b: Type) bool {160 pub fn eql(self: @This(), a: Type, b: Type, b_index: usize) bool {
161 _ = self;161 _ = self;
162 _ = b_index;
162 return a.eqlShallow(b);163 return a.eqlShallow(b);
163 }164 }
164 };165 };
src/type.zig+2-1
...@@ -798,8 +798,9 @@ pub const Type = extern union {...@@ -798,8 +798,9 @@ pub const Type = extern union {
798 _ = self;798 _ = self;
799 return @truncate(u32, t.hash());799 return @truncate(u32, t.hash());
800 }800 }
801 pub fn eql(self: @This(), a: Type, b: Type) bool {801 pub fn eql(self: @This(), a: Type, b: Type, b_index: usize) bool {
802 _ = self;802 _ = self;
803 _ = b_index;
803 return a.eql(b);804 return a.eql(b);
804 }805 }
805 };806 };
src/value.zig+2-1
...@@ -1765,7 +1765,8 @@ pub const Value = extern union {...@@ -1765,7 +1765,8 @@ pub const Value = extern union {
1765 const other_context: HashContext = .{ .ty = self.ty };1765 const other_context: HashContext = .{ .ty = self.ty };
1766 return @truncate(u32, other_context.hash(val));1766 return @truncate(u32, other_context.hash(val));
1767 }1767 }
1768 pub fn eql(self: @This(), a: Value, b: Value) bool {1768 pub fn eql(self: @This(), a: Value, b: Value, b_index: usize) bool {
1769 _ = b_index;
1769 return a.eql(b, self.ty);1770 return a.eql(b, self.ty);
1770 }1771 }
1771 };1772 };