From fc9430f56798a53f9393a697f4ccd6bf9981b970 Mon Sep 17 00:00:00 2001 From: Martin Wickham Date: Thu, 3 Jun 2021 15:39:26 -0500 Subject: Breaking hash map changes for 0.8.0 - hash/eql functions moved into a Context object - *Context functions pass an explicit context - *Adapted functions pass specialized keys and contexts - new getPtr() function returns a pointer to value - remove functions renamed to fetchRemove - new remove functions return bool - removeAssertDiscard deleted, use assert(remove(...)) instead - Keys and values are stored in separate arrays - Entry is now {*K, *V}, the new KV is {K, V} - BufSet/BufMap functions renamed to match other set/map types - fixed iterating-while-modifying bug in src/link/C.zig --- src/codegen/wasm.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/codegen/wasm.zig') diff --git a/src/codegen/wasm.zig b/src/codegen/wasm.zig index 528b233589..d7fe239d3b 100644 --- a/src/codegen/wasm.zig +++ b/src/codegen/wasm.zig @@ -625,10 +625,10 @@ pub const Context = struct { const struct_data: *Module.Struct = ty.castTag(.@"struct").?.data; const fields_len = @intCast(u32, struct_data.fields.count()); try self.locals.ensureCapacity(self.gpa, self.locals.items.len + fields_len); - for (struct_data.fields.items()) |entry| { + for (struct_data.fields.values()) |*value| { const val_type = try self.genValtype( .{ .node_offset = struct_data.node_offset }, - entry.value.ty, + value.ty, ); self.locals.appendAssumeCapacity(val_type); self.local_index += 1; @@ -1018,7 +1018,7 @@ pub const Context = struct { .enum_full, .enum_nonexhaustive => { const enum_full = ty.cast(Type.Payload.EnumFull).?.data; if (enum_full.values.count() != 0) { - const tag_val = enum_full.values.entries.items[field_index.data].key; + const tag_val = enum_full.values.keys()[field_index.data]; try self.emitConstant(src, tag_val, enum_full.tag_ty); } else { try writer.writeByte(wasm.opcode(.i32_const)); -- cgit v1.2.3