authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-13 15:34:31-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-13 15:34:31-07:00
log204f61d7f5aa7b5e27bdaaab9237fca17096ad3e
tree374e2979a0f40ffe9ece7887353e59de3047524d
parent75a720565bb72e7fab03346df6a35e9a8f380962

stage2: Module: use StringHashMapUnmanaged


1 files changed, 3 insertions(+), 4 deletions(-)

src-self-hosted/Module.zig+3-4
......@@ -36,7 +36,7 @@ bin_file_path: []const u8,
3636decl_exports: std.AutoHashMapUnmanaged(*Decl, []*Export) = .{},
3737/// We track which export is associated with the given symbol name for quick
3838/// detection of symbol collisions.
39symbol_exports: std.StringHashMap(*Export),
39symbol_exports: std.StringHashMapUnmanaged(*Export) = .{},
4040/// This models the Decls that perform exports, so that `decl_exports` can be updated when a Decl
4141/// is modified. Note that the key of this table is not the Decl being exported, but the Decl that
4242/// is performing the export of another Decl.
......@@ -769,7 +769,6 @@ pub fn init(gpa: *Allocator, options: InitOptions) !Module {
769769 .bin_file_path = options.bin_file_path,
770770 .bin_file = bin_file,
771771 .optimize_mode = options.optimize_mode,
772 .symbol_exports = std.StringHashMap(*Export).init(gpa),
773772 .work_queue = std.fifo.LinearFifo(WorkItem, .Dynamic).init(gpa),
774773 .keep_source_files_loaded = options.keep_source_files_loaded,
775774 };
......@@ -812,7 +811,7 @@ pub fn deinit(self: *Module) void {
812811 }
813812 self.export_owners.deinit(gpa);
814813
815 self.symbol_exports.deinit();
814 self.symbol_exports.deinit(gpa);
816815 self.root_scope.destroy(gpa);
817816 self.* = undefined;
818817}
......@@ -2305,7 +2304,7 @@ fn analyzeExport(self: *Module, scope: *Scope, src: usize, symbol_name: []const
23052304 return;
23062305 }
23072306
2308 try self.symbol_exports.putNoClobber(symbol_name, new_export);
2307 try self.symbol_exports.putNoClobber(self.gpa, symbol_name, new_export);
23092308 self.bin_file.updateDeclExports(self, exported_decl, de_gop.entry.value) catch |err| switch (err) {
23102309 error.OutOfMemory => return error.OutOfMemory,
23112310 else => {