stage2: update to new ArrayHashMap API

This commit is contained in:
Andrew Kelley 2022-01-31 21:12:37 -07:00
parent cf88cf2657
commit 39983d7ff5
4 changed files with 9 additions and 5 deletions

View File

@ -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,

View File

@ -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);
}
};

View File

@ -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);
}
};

View File

@ -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);
}
};