authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-11 05:59:44+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-11 05:59:44+02:00
logb28460b499847151f3b62a87cb3ddf5f1e73093c
tree6a386ce03e8507a171255612fab077cb302d3e94
parent6ae46c1bc8c55db2207bc32183a62607a80ee642
parentc91727108ec70019b0e1940e719bbf795ebf26c8

Merge pull request 'Rename usages of all deprecated `ArrayHashMapUnmanaged` to `array_hash_map`' (#35470) from kada49/zig:array_hash_map_deprecation_rename into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35470 Reviewed-by: Andrew Kelley <andrew@ziglang.org>

79 files changed, 389 insertions(+), 389 deletions(-)

lib/compiler/Maker.zig+4-4
...@@ -49,7 +49,7 @@ web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn,...@@ -49,7 +49,7 @@ web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn,
49/// Allocated into `gpa`.49/// Allocated into `gpa`.
50memory_blocked_steps: std.ArrayList(Configuration.Step.Index),50memory_blocked_steps: std.ArrayList(Configuration.Step.Index),
51/// Allocated into `gpa`.51/// Allocated into `gpa`.
52step_stack: std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),52step_stack: std.array_hash_map.Auto(Configuration.Step.Index, void),
53pkg_config: PkgConfig,53pkg_config: PkgConfig,
5454
55error_style: ErrorStyle,55error_style: ErrorStyle,
...@@ -481,7 +481,7 @@ pub fn main(init: process.Init.Minimal) !void {...@@ -481,7 +481,7 @@ pub fn main(init: process.Init.Minimal) !void {
481 // maker process fails or crashes and it's helpful to be able to repeat481 // maker process fails or crashes and it's helpful to be able to repeat
482 // execution of the command line or otherwise inspect the configuration file.482 // execution of the command line or otherwise inspect the configuration file.
483 const c = &configuration;483 const c = &configuration;
484 var top_level_steps: std.StringArrayHashMapUnmanaged(Configuration.Step.Index) = .empty;484 var top_level_steps: std.array_hash_map.String(Configuration.Step.Index) = .empty;
485 for (configuration.steps, 0..) |*conf_step, step_index_usize| {485 for (configuration.steps, 0..) |*conf_step, step_index_usize| {
486 if (conf_step.owner != .root) continue;486 if (conf_step.owner != .root) continue;
487 const step_index: Configuration.Step.Index = @enumFromInt(step_index_usize);487 const step_index: Configuration.Step.Index = @enumFromInt(step_index_usize);
...@@ -1217,7 +1217,7 @@ fn printTreeStep(...@@ -1217,7 +1217,7 @@ fn printTreeStep(
1217 step_index: Configuration.Step.Index,1217 step_index: Configuration.Step.Index,
1218 stderr: Io.Terminal,1218 stderr: Io.Terminal,
1219 parent_node: *PrintNode,1219 parent_node: *PrintNode,
1220 step_stack: *std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),1220 step_stack: *std.array_hash_map.Auto(Configuration.Step.Index, void),
1221) !void {1221) !void {
1222 const writer = stderr.writer;1222 const writer = stderr.writer;
1223 const first = step_stack.swapRemove(step_index);1223 const first = step_stack.swapRemove(step_index);
...@@ -1502,7 +1502,7 @@ fn printChildNodePrefix(stderr: Io.Terminal) !void {...@@ -1502,7 +1502,7 @@ fn printChildNodePrefix(stderr: Io.Terminal) !void {
1502fn constructGraphAndCheckForDependencyLoop(1502fn constructGraphAndCheckForDependencyLoop(
1503 maker: *Maker,1503 maker: *Maker,
1504 step_index: Configuration.Step.Index,1504 step_index: Configuration.Step.Index,
1505 step_stack: *std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),1505 step_stack: *std.array_hash_map.Auto(Configuration.Step.Index, void),
1506 rand: std.Random,1506 rand: std.Random,
1507) error{ DependencyLoopDetected, OutOfMemory }!void {1507) error{ DependencyLoopDetected, OutOfMemory }!void {
1508 const c = &maker.scanned_config.configuration;1508 const c = &maker.scanned_config.configuration;
lib/compiler/Maker/Fuzz.zig+2-2
...@@ -27,7 +27,7 @@ prog_node: std.Progress.Node,...@@ -27,7 +27,7 @@ prog_node: std.Progress.Node,
2727
28/// Protects `coverage_files`.28/// Protects `coverage_files`.
29coverage_mutex: Io.Mutex,29coverage_mutex: Io.Mutex,
30coverage_files: std.AutoArrayHashMapUnmanaged(u64, CoverageMap),30coverage_files: std.array_hash_map.Auto(u64, CoverageMap),
3131
32queue_mutex: Io.Mutex,32queue_mutex: Io.Mutex,
33queue_cond: Io.Condition,33queue_cond: Io.Condition,
...@@ -273,7 +273,7 @@ pub fn serveSourcesTar(fuzz: *Fuzz, req: *std.http.Server.Request) !void {...@@ -273,7 +273,7 @@ pub fn serveSourcesTar(fuzz: *Fuzz, req: *std.http.Server.Request) !void {
273 defer arena_state.deinit();273 defer arena_state.deinit();
274 const arena = arena_state.allocator();274 const arena = arena_state.allocator();
275275
276 const DedupTable = std.ArrayHashMapUnmanaged(Build.Cache.Path, void, Build.Cache.Path.TableAdapter, false);276 const DedupTable = std.array_hash_map.Custom(Build.Cache.Path, void, Build.Cache.Path.TableAdapter, false);
277 var dedup_table: DedupTable = .empty;277 var dedup_table: DedupTable = .empty;
278 defer dedup_table.deinit(gpa);278 defer dedup_table.deinit(gpa);
279279
lib/compiler/Maker/ScannedConfig.zig+1-1
...@@ -8,7 +8,7 @@ const Serializer = std.zon.Serializer;...@@ -8,7 +8,7 @@ const Serializer = std.zon.Serializer;
8const Graph = @import("Graph.zig");8const Graph = @import("Graph.zig");
99
10configuration: Configuration,10configuration: Configuration,
11top_level_steps: std.StringArrayHashMapUnmanaged(Configuration.Step.Index),11top_level_steps: std.array_hash_map.String(Configuration.Step.Index),
12path: []const u8,12path: []const u8,
1313
14pub fn print(sc: *const ScannedConfig, w: *Writer) Writer.Error!void {14pub fn print(sc: *const ScannedConfig, w: *Writer) Writer.Error!void {
lib/compiler/Maker/Step.zig+1-1
...@@ -180,7 +180,7 @@ pub const Inputs = struct {...@@ -180,7 +180,7 @@ pub const Inputs = struct {
180 .table = .{},180 .table = .{},
181 };181 };
182182
183 pub const Table = std.ArrayHashMapUnmanaged(Path, Files, Path.TableAdapter, false);183 pub const Table = std.array_hash_map.Custom(Path, Files, Path.TableAdapter, false);
184 /// The special file name "." means any changes inside the directory.184 /// The special file name "." means any changes inside the directory.
185 pub const Files = std.ArrayList([]const u8);185 pub const Files = std.ArrayList([]const u8);
186186
lib/compiler/Maker/Step/Compile.zig+7-7
...@@ -119,9 +119,9 @@ fn updateGeneratedFile(...@@ -119,9 +119,9 @@ fn updateGeneratedFile(
119119
120/// List of importable modules in a compilation's module graph, including120/// List of importable modules in a compilation's module graph, including
121/// the root module. The root module is guaranteed to be first.121/// the root module. The root module is guaranteed to be first.
122const ModuleList = std.AutoArrayHashMapUnmanaged(Configuration.Module.Index, Configuration.String);122const ModuleList = std.array_hash_map.Auto(Configuration.Module.Index, Configuration.String);
123/// Keyed on the first key in the module list.123/// Keyed on the first key in the module list.
124pub const ModuleGraph = std.ArrayHashMapUnmanaged(ModuleList, void, ModuleListContext, false);124pub const ModuleGraph = std.array_hash_map.Custom(ModuleList, void, ModuleListContext, false);
125125
126const ModuleListContext = struct {126const ModuleListContext = struct {
127 pub fn eql(ctx: @This(), a: ModuleList, b: ModuleList) bool {127 pub fn eql(ctx: @This(), a: ModuleList, b: ModuleList) bool {
...@@ -221,8 +221,8 @@ fn lowerZigArgs(...@@ -221,8 +221,8 @@ fn lowerZigArgs(
221 // module, along with any C compiler arguments that need to be passed221 // module, along with any C compiler arguments that need to be passed
222 // to the compiler for each module individually as reported by222 // to the compiler for each module individually as reported by
223 // pkg-config.223 // pkg-config.
224 var seen_system_libs: std.AutoArrayHashMapUnmanaged(Configuration.String, []const []const u8) = .empty;224 var seen_system_libs: std.array_hash_map.Auto(Configuration.String, []const []const u8) = .empty;
225 var frameworks: std.AutoArrayHashMapUnmanaged(Configuration.String, Configuration.Module.Framework.Flags) = .empty;225 var frameworks: std.array_hash_map.Auto(Configuration.String, Configuration.Module.Framework.Flags) = .empty;
226 var module_graph: ModuleGraph = .empty;226 var module_graph: ModuleGraph = .empty;
227227
228 var prev_has_cflags = false;228 var prev_has_cflags = false;
...@@ -1126,8 +1126,8 @@ fn moduleNeedsCliArg(mod: *const Configuration.Module, conf: *const Configuratio...@@ -1126,8 +1126,8 @@ fn moduleNeedsCliArg(mod: *const Configuration.Module, conf: *const Configuratio
1126}1126}
11271127
1128const CliNamedModules = struct {1128const CliNamedModules = struct {
1129 modules: std.AutoArrayHashMapUnmanaged(Configuration.Module.Index, void),1129 modules: std.array_hash_map.Auto(Configuration.Module.Index, void),
1130 names: std.StringArrayHashMapUnmanaged(void),1130 names: std.array_hash_map.String(void),
11311131
1132 /// Traverse the whole dependency graph and give every module a unique1132 /// Traverse the whole dependency graph and give every module a unique
1133 /// name, ideally one named after what it's called somewhere in the graph.1133 /// name, ideally one named after what it's called somewhere in the graph.
...@@ -1177,7 +1177,7 @@ pub fn getCompileDependencies(...@@ -1177,7 +1177,7 @@ pub fn getCompileDependencies(
1177 start: Configuration.Step.Index,1177 start: Configuration.Step.Index,
1178 chase_dynamic: bool,1178 chase_dynamic: bool,
1179) ![]const Configuration.Step.Index {1179) ![]const Configuration.Step.Index {
1180 var compiles: std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void) = .empty;1180 var compiles: std.array_hash_map.Auto(Configuration.Step.Index, void) = .empty;
1181 var compiles_i: usize = 0;1181 var compiles_i: usize = 0;
11821182
1183 try compiles.putNoClobber(arena, start, {});1183 try compiles.putNoClobber(arena, start, {});
lib/compiler/Maker/Step/TranslateC.zig+1-1
...@@ -66,7 +66,7 @@ pub fn make(...@@ -66,7 +66,7 @@ pub fn make(
6666
67 var prev_search_strategy: std.Build.Module.SystemLib.SearchStrategy = .paths_first;67 var prev_search_strategy: std.Build.Module.SystemLib.SearchStrategy = .paths_first;
68 var prev_preferred_link_mode: std.builtin.LinkMode = .dynamic;68 var prev_preferred_link_mode: std.builtin.LinkMode = .dynamic;
69 var seen_system_libs: std.AutoArrayHashMapUnmanaged(Configuration.String, []const []const u8) = .empty;69 var seen_system_libs: std.array_hash_map.Auto(Configuration.String, []const []const u8) = .empty;
7070
71 for (conf_tc.system_libs.slice) |system_lib_index| {71 for (conf_tc.system_libs.slice) |system_lib_index| {
72 const system_lib = system_lib_index.get(conf);72 const system_lib = system_lib_index.get(conf);
lib/compiler/Maker/Watch.zig+6-6
...@@ -27,11 +27,11 @@ pub const have_impl = Os != void;...@@ -27,11 +27,11 @@ pub const have_impl = Os != void;
27/// interested in noticing changes to.27/// interested in noticing changes to.
28///28///
29/// Value is generation.29/// Value is generation.
30const DirTable = std.ArrayHashMapUnmanaged(Cache.Path, void, Cache.Path.TableAdapter, false);30const DirTable = std.array_hash_map.Custom(Cache.Path, void, Cache.Path.TableAdapter, false);
3131
32/// Special key of "." means any changes in this directory trigger the steps.32/// Special key of "." means any changes in this directory trigger the steps.
33const ReactionSet = std.StringArrayHashMapUnmanaged(StepSet);33const ReactionSet = std.array_hash_map.String(StepSet);
34const StepSet = std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, Generation);34const StepSet = std.array_hash_map.Auto(Configuration.Step.Index, Generation);
3535
36const Generation = u8;36const Generation = u8;
3737
...@@ -46,10 +46,10 @@ const Os = switch (builtin.os.tag) {...@@ -46,10 +46,10 @@ const Os = switch (builtin.os.tag) {
46 handle_table: HandleTable,46 handle_table: HandleTable,
47 /// fanotify file descriptors are keyed by mount id since marks47 /// fanotify file descriptors are keyed by mount id since marks
48 /// are limited to a single filesystem.48 /// are limited to a single filesystem.
49 poll_fds: std.AutoArrayHashMapUnmanaged(MountId, posix.pollfd),49 poll_fds: std.array_hash_map.Auto(MountId, posix.pollfd),
5050
51 const MountId = i32;51 const MountId = i32;
52 const HandleTable = std.ArrayHashMapUnmanaged(FileHandle, struct { mount_id: MountId, reaction_set: ReactionSet }, FileHandle.Adapter, false);52 const HandleTable = std.array_hash_map.Custom(FileHandle, struct { mount_id: MountId, reaction_set: ReactionSet }, FileHandle.Adapter, false);
5353
54 const fan_mask: std.os.linux.fanotify.MarkMask = .{54 const fan_mask: std.os.linux.fanotify.MarkMask = .{
55 .CLOSE_WRITE = true,55 .CLOSE_WRITE = true,
...@@ -314,7 +314,7 @@ const Os = switch (builtin.os.tag) {...@@ -314,7 +314,7 @@ const Os = switch (builtin.os.tag) {
314 const windows = std.os.windows;314 const windows = std.os.windows;
315315
316 /// Keyed differently but indexes correspond 1:1 with `dir_table`.316 /// Keyed differently but indexes correspond 1:1 with `dir_table`.
317 handle_table: std.ArrayHashMapUnmanaged(*Directory, void, Directory.TableAdapter, false),317 handle_table: std.array_hash_map.Custom(*Directory, void, Directory.TableAdapter, false),
318 ready_dirs: std.DoublyLinkedList,318 ready_dirs: std.DoublyLinkedList,
319319
320 const FileId = struct {320 const FileId = struct {
lib/compiler/aro/aro/Compilation.zig+2-2
...@@ -140,7 +140,7 @@ io: Io,...@@ -140,7 +140,7 @@ io: Io,
140cwd: std.Io.Dir,140cwd: std.Io.Dir,
141diagnostics: *Diagnostics,141diagnostics: *Diagnostics,
142142
143sources: std.StringArrayHashMapUnmanaged(Source) = .empty,143sources: std.array_hash_map.String(Source) = .empty,
144source_aliases: std.ArrayList(Source) = .empty,144source_aliases: std.ArrayList(Source) = .empty,
145/// Allocated into `gpa`, but keys are externally managed.145/// Allocated into `gpa`, but keys are externally managed.
146search_path: std.ArrayList(Include) = .empty,146search_path: std.ArrayList(Include) = .empty,
...@@ -159,7 +159,7 @@ builtins: Builtins = .{},...@@ -159,7 +159,7 @@ builtins: Builtins = .{},
159string_interner: StringInterner = .{},159string_interner: StringInterner = .{},
160interner: Interner = .{},160interner: Interner = .{},
161type_store: TypeStore = .{},161type_store: TypeStore = .{},
162pragma_handlers: std.StringArrayHashMapUnmanaged(*Pragma) = .empty,162pragma_handlers: std.array_hash_map.String(*Pragma) = .empty,
163/// If this is not null, the directory containing the specified Source will be searched for includes163/// If this is not null, the directory containing the specified Source will be searched for includes
164/// Used by MS extensions which allow searching for includes relative to the directory of the main source file.164/// Used by MS extensions which allow searching for includes relative to the directory of the main source file.
165ms_cwd_source_id: ?Source.Id = null,165ms_cwd_source_id: ?Source.Id = null,
lib/compiler/aro/aro/DepFile.zig+1-1
...@@ -6,7 +6,7 @@ pub const Format = enum { make, nmake };...@@ -6,7 +6,7 @@ pub const Format = enum { make, nmake };
6const DepFile = @This();6const DepFile = @This();
77
8target: []const u8,8target: []const u8,
9deps: std.StringArrayHashMapUnmanaged(void) = .empty,9deps: std.array_hash_map.String(void) = .empty,
10format: Format,10format: Format,
1111
12pub fn deinit(d: *DepFile, gpa: Allocator) void {12pub fn deinit(d: *DepFile, gpa: Allocator) void {
lib/compiler/aro/aro/Preprocessor.zig+1-1
...@@ -23,7 +23,7 @@ const Tree = @import("Tree.zig");...@@ -23,7 +23,7 @@ const Tree = @import("Tree.zig");
23const Token = Tree.Token;23const Token = Tree.Token;
24const TokenWithExpansionLocs = Tree.TokenWithExpansionLocs;24const TokenWithExpansionLocs = Tree.TokenWithExpansionLocs;
2525
26const DefineMap = std.StringArrayHashMapUnmanaged(Macro);26const DefineMap = std.array_hash_map.String(Macro);
27const RawTokenList = std.ArrayList(RawToken);27const RawTokenList = std.ArrayList(RawToken);
28const max_include_depth = 200;28const max_include_depth = 200;
2929
lib/compiler/aro/aro/StringInterner.zig+1-1
...@@ -19,7 +19,7 @@ pub const StringId = enum(u32) {...@@ -19,7 +19,7 @@ pub const StringId = enum(u32) {
19 }19 }
20};20};
2121
22table: std.StringArrayHashMapUnmanaged(void) = .empty,22table: std.array_hash_map.String(void) = .empty,
2323
24pub fn deinit(si: *StringInterner, allocator: mem.Allocator) void {24pub fn deinit(si: *StringInterner, allocator: mem.Allocator) void {
25 si.table.deinit(allocator);25 si.table.deinit(allocator);
lib/compiler/aro/backend/Interner.zig+1-1
...@@ -8,7 +8,7 @@ const Limb = std.math.big.Limb;...@@ -8,7 +8,7 @@ const Limb = std.math.big.Limb;
88
9const Interner = @This();9const Interner = @This();
1010
11map: std.AutoArrayHashMapUnmanaged(void, void) = .empty,11map: std.array_hash_map.Auto(void, void) = .empty,
12items: std.MultiArrayList(struct {12items: std.MultiArrayList(struct {
13 tag: Tag,13 tag: Tag,
14 data: u32,14 data: u32,
lib/compiler/aro/backend/Ir.zig+4-4
...@@ -7,7 +7,7 @@ const Object = @import("Object.zig");...@@ -7,7 +7,7 @@ const Object = @import("Object.zig");
7const Ir = @This();7const Ir = @This();
88
9interner: *Interner,9interner: *Interner,
10decls: std.StringArrayHashMapUnmanaged(Decl),10decls: std.array_hash_map.String(Decl),
1111
12pub const Decl = struct {12pub const Decl = struct {
13 instructions: std.MultiArrayList(Inst),13 instructions: std.MultiArrayList(Inst),
...@@ -26,7 +26,7 @@ pub const Builder = struct {...@@ -26,7 +26,7 @@ pub const Builder = struct {
26 arena: std.heap.ArenaAllocator,26 arena: std.heap.ArenaAllocator,
27 interner: *Interner,27 interner: *Interner,
2828
29 decls: std.StringArrayHashMapUnmanaged(Decl) = .empty,29 decls: std.array_hash_map.String(Decl) = .empty,
30 instructions: std.MultiArrayList(Ir.Inst) = .empty,30 instructions: std.MultiArrayList(Ir.Inst) = .empty,
31 body: std.ArrayList(Ref) = .empty,31 body: std.ArrayList(Ref) = .empty,
32 alloc_count: u32 = 0,32 alloc_count: u32 = 0,
...@@ -181,7 +181,7 @@ pub const Renderer = struct {...@@ -181,7 +181,7 @@ pub const Renderer = struct {
181 ir: *const Ir,181 ir: *const Ir,
182 errors: ErrorList = .{},182 errors: ErrorList = .{},
183183
184 pub const ErrorList = std.StringArrayHashMapUnmanaged([]const u8);184 pub const ErrorList = std.array_hash_map.String([]const u8);
185185
186 pub const Error = Allocator.Error || error{LowerFail};186 pub const Error = Allocator.Error || error{LowerFail};
187187
...@@ -380,7 +380,7 @@ const REF = std.Io.Terminal.Color.bright_blue;...@@ -380,7 +380,7 @@ const REF = std.Io.Terminal.Color.bright_blue;
380const LITERAL = std.Io.Terminal.Color.bright_green;380const LITERAL = std.Io.Terminal.Color.bright_green;
381const ATTRIBUTE = std.Io.Terminal.Color.bright_yellow;381const ATTRIBUTE = std.Io.Terminal.Color.bright_yellow;
382382
383const RefMap = std.AutoArrayHashMapUnmanaged(Ref, void);383const RefMap = std.array_hash_map.Auto(Ref, void);
384384
385pub const DumpError = std.Io.Terminal.SetColorError || std.mem.Allocator.Error;385pub const DumpError = std.Io.Terminal.SetColorError || std.mem.Allocator.Error;
386386
lib/compiler/configurer.zig+3-3
...@@ -160,10 +160,10 @@ pub fn main(init: process.Init.Minimal) !void {...@@ -160,10 +160,10 @@ pub fn main(init: process.Init.Minimal) !void {
160const Serialize = struct {160const Serialize = struct {
161 arena: Allocator,161 arena: Allocator,
162 wc: *Configuration.Wip,162 wc: *Configuration.Wip,
163 module_map: std.AutoArrayHashMapUnmanaged(*std.Build.Module, Configuration.Module.Index) = .empty,163 module_map: std.array_hash_map.Auto(*std.Build.Module, Configuration.Module.Index) = .empty,
164 package_map: std.AutoArrayHashMapUnmanaged(*std.Build, Configuration.Package.Index) = .empty,164 package_map: std.array_hash_map.Auto(*std.Build, Configuration.Package.Index) = .empty,
165 /// Index corresponds to `Configuration.steps` index.165 /// Index corresponds to `Configuration.steps` index.
166 step_map: std.AutoArrayHashMapUnmanaged(*Step, void) = .empty,166 step_map: std.array_hash_map.Auto(*Step, void) = .empty,
167167
168 fn builderToPackage(s: *Serialize, b: *std.Build) !Configuration.Package.Index {168 fn builderToPackage(s: *Serialize, b: *std.Build) !Configuration.Package.Index {
169 if (b.pkg_hash.len == 0) return .root;169 if (b.pkg_hash.len == 0) return .root;
lib/compiler/reduce/Walk.zig+2-2
...@@ -44,7 +44,7 @@ pub const Transformation = union(enum) {...@@ -44,7 +44,7 @@ pub const Transformation = union(enum) {
44 imported_string: []const u8,44 imported_string: []const u8,
45 /// Identifier names that must be renamed in the inlined code or else45 /// Identifier names that must be renamed in the inlined code or else
46 /// will cause ambiguous reference errors.46 /// will cause ambiguous reference errors.
47 in_scope_names: std.StringArrayHashMapUnmanaged(void),47 in_scope_names: std.array_hash_map.String(void),
48 };48 };
49};49};
5050
...@@ -723,7 +723,7 @@ fn walkBuiltinCall(...@@ -723,7 +723,7 @@ fn walkBuiltinCall(
723 try w.transformations.append(.{ .inline_imported_file = .{723 try w.transformations.append(.{ .inline_imported_file = .{
724 .builtin_call_node = call_node,724 .builtin_call_node = call_node,
725 .imported_string = imported_string,725 .imported_string = imported_string,
726 .in_scope_names = try std.StringArrayHashMapUnmanaged(void).init(726 .in_scope_names = try std.array_hash_map.String(void).init(
727 w.arena,727 w.arena,
728 w.in_scope_names.keys(),728 w.in_scope_names.keys(),
729 &.{},729 &.{},
lib/compiler/resinator/cli.zig+1-1
...@@ -159,7 +159,7 @@ pub const Options = struct {...@@ -159,7 +159,7 @@ pub const Options = struct {
159 default_language_id: ?u16 = null,159 default_language_id: ?u16 = null,
160 default_code_page: ?SupportedCodePage = null,160 default_code_page: ?SupportedCodePage = null,
161 verbose: bool = false,161 verbose: bool = false,
162 symbols: std.StringArrayHashMapUnmanaged(SymbolValue) = .empty,162 symbols: std.array_hash_map.String(SymbolValue) = .empty,
163 null_terminate_string_table_strings: bool = false,163 null_terminate_string_table_strings: bool = false,
164 max_string_literal_codepoints: u15 = lex.default_max_string_literal_codepoints,164 max_string_literal_codepoints: u15 = lex.default_max_string_literal_codepoints,
165 silent_duplicate_control_ids: bool = false,165 silent_duplicate_control_ids: bool = false,
lib/compiler/resinator/compile.zig+2-2
...@@ -3049,7 +3049,7 @@ pub const StringTablesByLanguage = struct {...@@ -3049,7 +3049,7 @@ pub const StringTablesByLanguage = struct {
3049 /// when the first STRINGTABLE for the language was defined, and all blocks for a given3049 /// when the first STRINGTABLE for the language was defined, and all blocks for a given
3050 /// language are written contiguously.3050 /// language are written contiguously.
3051 /// Using an ArrayHashMap here gives us this property for free.3051 /// Using an ArrayHashMap here gives us this property for free.
3052 tables: std.AutoArrayHashMapUnmanaged(res.Language, StringTable) = .empty,3052 tables: std.array_hash_map.Auto(res.Language, StringTable) = .empty,
30533053
3054 pub fn deinit(self: *StringTablesByLanguage, allocator: Allocator) void {3054 pub fn deinit(self: *StringTablesByLanguage, allocator: Allocator) void {
3055 self.tables.deinit(allocator);3055 self.tables.deinit(allocator);
...@@ -3080,7 +3080,7 @@ pub const StringTable = struct {...@@ -3080,7 +3080,7 @@ pub const StringTable = struct {
3080 /// was added to the block (i.e. `STRINGTABLE { 16 "b" 0 "a" }` would then get written3080 /// was added to the block (i.e. `STRINGTABLE { 16 "b" 0 "a" }` would then get written
3081 /// with block ID 2 (the one with "b") first and block ID 1 (the one with "a") second).3081 /// with block ID 2 (the one with "b") first and block ID 1 (the one with "a") second).
3082 /// Using an ArrayHashMap here gives us this property for free.3082 /// Using an ArrayHashMap here gives us this property for free.
3083 blocks: std.AutoArrayHashMapUnmanaged(u16, Block) = .empty,3083 blocks: std.array_hash_map.Auto(u16, Block) = .empty,
30843084
3085 pub const Block = struct {3085 pub const Block = struct {
3086 strings: std.ArrayList(Token) = .empty,3086 strings: std.ArrayList(Token) = .empty,
lib/compiler/resinator/cvtres.zig+5-5
...@@ -439,9 +439,9 @@ pub const ResourceDataEntry = extern struct {...@@ -439,9 +439,9 @@ pub const ResourceDataEntry = extern struct {
439439
440/// type -> name -> language440/// type -> name -> language
441const ResourceTree = struct {441const ResourceTree = struct {
442 type_to_name_map: std.ArrayHashMapUnmanaged(NameOrOrdinal, NameToLanguageMap, NameOrOrdinalHashContext, true),442 type_to_name_map: std.array_hash_map.Custom(NameOrOrdinal, NameToLanguageMap, NameOrOrdinalHashContext, true),
443 rsrc_string_table: std.ArrayHashMapUnmanaged(NameOrOrdinal, void, NameOrOrdinalHashContext, true),443 rsrc_string_table: std.array_hash_map.Custom(NameOrOrdinal, void, NameOrOrdinalHashContext, true),
444 deduplicated_data: std.StringArrayHashMapUnmanaged(u32),444 deduplicated_data: std.array_hash_map.String(u32),
445 data_offsets: std.ArrayList(u32),445 data_offsets: std.ArrayList(u32),
446 rsrc02_len: u32,446 rsrc02_len: u32,
447 coff_options: CoffOptions,447 coff_options: CoffOptions,
...@@ -451,8 +451,8 @@ const ResourceTree = struct {...@@ -451,8 +451,8 @@ const ResourceTree = struct {
451 resource: *const Resource,451 resource: *const Resource,
452 original_index: usize,452 original_index: usize,
453 };453 };
454 const LanguageToResourceMap = std.AutoArrayHashMapUnmanaged(Language, RelocatableResource);454 const LanguageToResourceMap = std.array_hash_map.Auto(Language, RelocatableResource);
455 const NameToLanguageMap = std.ArrayHashMapUnmanaged(NameOrOrdinal, LanguageToResourceMap, NameOrOrdinalHashContext, true);455 const NameToLanguageMap = std.array_hash_map.Custom(NameOrOrdinal, LanguageToResourceMap, NameOrOrdinalHashContext, true);
456456
457 const NameOrOrdinalHashContext = struct {457 const NameOrOrdinalHashContext = struct {
458 pub fn hash(self: @This(), v: NameOrOrdinal) u32 {458 pub fn hash(self: @This(), v: NameOrOrdinal) u32 {
lib/compiler/translate-c/Scope.zig+5-5
...@@ -7,7 +7,7 @@ const Translator = @import("Translator.zig");...@@ -7,7 +7,7 @@ const Translator = @import("Translator.zig");
77
8const Scope = @This();8const Scope = @This();
99
10pub const SymbolTable = std.StringArrayHashMapUnmanaged(ast.Node);10pub const SymbolTable = std.array_hash_map.String(ast.Node);
11pub const AliasList = std.ArrayList(struct {11pub const AliasList = std.ArrayList(struct {
12 alias: []const u8,12 alias: []const u8,
13 name: []const u8,13 name: []const u8,
...@@ -18,7 +18,7 @@ pub const ContainerMemberFns = struct {...@@ -18,7 +18,7 @@ pub const ContainerMemberFns = struct {
18 container_decl_ptr: *ast.Node,18 container_decl_ptr: *ast.Node,
19 member_fns: std.ArrayList(*ast.Payload.Func) = .empty,19 member_fns: std.ArrayList(*ast.Payload.Func) = .empty,
20};20};
21pub const ContainerMemberFnsHashMap = std.ArrayHashMapUnmanaged(21pub const ContainerMemberFnsHashMap = std.array_hash_map.Custom(
22 aro.QualType,22 aro.QualType,
23 ContainerMemberFns,23 ContainerMemberFns,
24 struct {24 struct {
...@@ -79,7 +79,7 @@ pub const Block = struct {...@@ -79,7 +79,7 @@ pub const Block = struct {
79 /// will be used. This maps the variable's name to the Discard payload, so that if79 /// will be used. This maps the variable's name to the Discard payload, so that if
80 /// the variable is subsequently referenced we can indicate that the discard should80 /// the variable is subsequently referenced we can indicate that the discard should
81 /// be skipped during the intermediate AST -> Zig AST render step.81 /// be skipped during the intermediate AST -> Zig AST render step.
82 variable_discards: std.StringArrayHashMapUnmanaged(*ast.Payload.Discard),82 variable_discards: std.array_hash_map.String(*ast.Payload.Discard),
8383
84 /// When the block corresponds to a function, keep track of the return type84 /// When the block corresponds to a function, keep track of the return type
85 /// so that the return expression can be cast, if necessary85 /// so that the return expression can be cast, if necessary
...@@ -209,7 +209,7 @@ pub const Root = struct {...@@ -209,7 +209,7 @@ pub const Root = struct {
209 base: Scope,209 base: Scope,
210 translator: *Translator,210 translator: *Translator,
211 sym_table: SymbolTable,211 sym_table: SymbolTable,
212 blank_macros: std.StringArrayHashMapUnmanaged(void),212 blank_macros: std.array_hash_map.String(void),
213 nodes: std.ArrayList(ast.Node),213 nodes: std.ArrayList(ast.Node),
214 container_member_fns_map: ContainerMemberFnsHashMap,214 container_member_fns_map: ContainerMemberFnsHashMap,
215215
...@@ -267,7 +267,7 @@ pub const Root = struct {...@@ -267,7 +267,7 @@ pub const Root = struct {
267 const gpa = root.translator.gpa;267 const gpa = root.translator.gpa;
268 const arena = root.translator.arena;268 const arena = root.translator.arena;
269269
270 var member_names: std.StringArrayHashMapUnmanaged(void) = .empty;270 var member_names: std.array_hash_map.String(void) = .empty;
271 defer member_names.deinit(gpa);271 defer member_names.deinit(gpa);
272 for (root.container_member_fns_map.keys(), root.container_member_fns_map.values()) |container_qt, members| {272 for (root.container_member_fns_map.keys(), root.container_member_fns_map.values()) |container_qt, members| {
273 // Get the container name273 // Get the container name
lib/compiler/translate-c/Translator.zig+4-4
...@@ -106,7 +106,7 @@ global_scope: *Scope.Root,...@@ -106,7 +106,7 @@ global_scope: *Scope.Root,
106mangle_count: u32 = 0,106mangle_count: u32 = 0,
107107
108/// Table of declarations for enum, struct, union and typedef types.108/// Table of declarations for enum, struct, union and typedef types.
109type_decls: std.AutoArrayHashMapUnmanaged(Node.Index, []const u8) = .empty,109type_decls: std.array_hash_map.Auto(Node.Index, []const u8) = .empty,
110/// Table of record decls that have been demoted to opaques.110/// Table of record decls that have been demoted to opaques.
111opaque_demotes: std.HashMapUnmanaged(QualType, void, QualTypeHashContext, std.hash_map.default_max_load_percentage) = .empty,111opaque_demotes: std.HashMapUnmanaged(QualType, void, QualTypeHashContext, std.hash_map.default_max_load_percentage) = .empty,
112/// Table of unnamed enums and records that are child types of typedefs.112/// Table of unnamed enums and records that are child types of typedefs.
...@@ -123,7 +123,7 @@ anonymous_record_field_names: std.HashMapUnmanaged(...@@ -123,7 +123,7 @@ anonymous_record_field_names: std.HashMapUnmanaged(
123/// a list of names that we found by visiting all the top level decls without123/// a list of names that we found by visiting all the top level decls without
124/// translating them. The other maps are updated as we translate; this one is updated124/// translating them. The other maps are updated as we translate; this one is updated
125/// up front in a pre-processing step.125/// up front in a pre-processing step.
126global_names: std.StringArrayHashMapUnmanaged(void) = .empty,126global_names: std.array_hash_map.String(void) = .empty,
127127
128/// This is similar to `global_names`, but contains names which we would128/// This is similar to `global_names`, but contains names which we would
129/// *like* to use, but do not strictly *have* to if they are unavailable.129/// *like* to use, but do not strictly *have* to if they are unavailable.
...@@ -132,11 +132,11 @@ global_names: std.StringArrayHashMapUnmanaged(void) = .empty,...@@ -132,11 +132,11 @@ global_names: std.StringArrayHashMapUnmanaged(void) = .empty,
132/// may be mangled.132/// may be mangled.
133/// This is distinct from `global_names` so we can detect at a type133/// This is distinct from `global_names` so we can detect at a type
134/// declaration whether or not the name is available.134/// declaration whether or not the name is available.
135weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty,135weak_global_names: std.array_hash_map.String(void) = .empty,
136136
137/// Set of identifiers known to refer to typedef declarations.137/// Set of identifiers known to refer to typedef declarations.
138/// Used when parsing macros.138/// Used when parsing macros.
139typedefs: std.StringArrayHashMapUnmanaged(void) = .empty,139typedefs: std.array_hash_map.String(void) = .empty,
140140
141/// The lhs lval of a compound assignment expression.141/// The lhs lval of a compound assignment expression.
142compound_assign_dummy: ?ZigNode = null,142compound_assign_dummy: ?ZigNode = null,
lib/docs/wasm/Walk.zig+9-9
...@@ -10,9 +10,9 @@ const Oom = error{OutOfMemory};...@@ -10,9 +10,9 @@ const Oom = error{OutOfMemory};
1010
11pub const Decl = @import("Decl.zig");11pub const Decl = @import("Decl.zig");
1212
13pub var files: std.StringArrayHashMapUnmanaged(File) = .empty;13pub var files: std.array_hash_map.String(File) = .empty;
14pub var decls: std.ArrayList(Decl) = .empty;14pub var decls: std.ArrayList(Decl) = .empty;
15pub var modules: std.StringArrayHashMapUnmanaged(File.Index) = .empty;15pub var modules: std.array_hash_map.String(File.Index) = .empty;
1616
17file: File.Index,17file: File.Index,
1818
...@@ -42,17 +42,17 @@ pub const Category = union(enum(u8)) {...@@ -42,17 +42,17 @@ pub const Category = union(enum(u8)) {
42pub const File = struct {42pub const File = struct {
43 ast: Ast,43 ast: Ast,
44 /// Maps identifiers to the declarations they point to.44 /// Maps identifiers to the declarations they point to.
45 ident_decls: std.AutoArrayHashMapUnmanaged(Ast.TokenIndex, Ast.Node.Index) = .empty,45 ident_decls: std.array_hash_map.Auto(Ast.TokenIndex, Ast.Node.Index) = .empty,
46 /// Maps field access identifiers to the containing field access node.46 /// Maps field access identifiers to the containing field access node.
47 token_parents: std.AutoArrayHashMapUnmanaged(Ast.TokenIndex, Ast.Node.Index) = .empty,47 token_parents: std.array_hash_map.Auto(Ast.TokenIndex, Ast.Node.Index) = .empty,
48 /// Maps declarations to their global index.48 /// Maps declarations to their global index.
49 node_decls: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, Decl.Index) = .empty,49 node_decls: std.array_hash_map.Auto(Ast.Node.Index, Decl.Index) = .empty,
50 /// Maps function declarations to doctests.50 /// Maps function declarations to doctests.
51 doctests: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, Ast.Node.Index) = .empty,51 doctests: std.array_hash_map.Auto(Ast.Node.Index, Ast.Node.Index) = .empty,
52 /// root node => its namespace scope52 /// root node => its namespace scope
53 /// struct/union/enum/opaque decl node => its namespace scope53 /// struct/union/enum/opaque decl node => its namespace scope
54 /// local var decl node => its local variable scope54 /// local var decl node => its local variable scope
55 scopes: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, *Scope) = .empty,55 scopes: std.array_hash_map.Auto(Ast.Node.Index, *Scope) = .empty,
5656
57 pub fn lookup_token(file: *File, token: Ast.TokenIndex) Decl.Index {57 pub fn lookup_token(file: *File, token: Ast.TokenIndex) Decl.Index {
58 const decl_node = file.ident_decls.get(token) orelse return .none;58 const decl_node = file.ident_decls.get(token) orelse return .none;
...@@ -465,8 +465,8 @@ pub const Scope = struct {...@@ -465,8 +465,8 @@ pub const Scope = struct {
465 const Namespace = struct {465 const Namespace = struct {
466 base: Scope = .{ .tag = .namespace },466 base: Scope = .{ .tag = .namespace },
467 parent: *Scope,467 parent: *Scope,
468 names: std.StringArrayHashMapUnmanaged(Ast.Node.Index) = .empty,468 names: std.array_hash_map.String(Ast.Node.Index) = .empty,
469 doctests: std.StringArrayHashMapUnmanaged(Ast.Node.Index) = .empty,469 doctests: std.array_hash_map.String(Ast.Node.Index) = .empty,
470 decl_index: Decl.Index,470 decl_index: Decl.Index,
471 };471 };
472472
lib/docs/wasm/main.zig+4-4
...@@ -264,7 +264,7 @@ const ErrorIdentifier = packed struct(u64) {...@@ -264,7 +264,7 @@ const ErrorIdentifier = packed struct(u64) {
264};264};
265265
266var string_result: ArrayList(u8) = .empty;266var string_result: ArrayList(u8) = .empty;
267var error_set_result: std.StringArrayHashMapUnmanaged(ErrorIdentifier) = .empty;267var error_set_result: std.array_hash_map.String(ErrorIdentifier) = .empty;
268268
269export fn decl_error_set(decl_index: Decl.Index) Slice(ErrorIdentifier) {269export fn decl_error_set(decl_index: Decl.Index) Slice(ErrorIdentifier) {
270 return Slice(ErrorIdentifier).init(decl_error_set_fallible(decl_index) catch @panic("OOM"));270 return Slice(ErrorIdentifier).init(decl_error_set_fallible(decl_index) catch @panic("OOM"));
...@@ -305,7 +305,7 @@ fn sort_error_set_result() void {...@@ -305,7 +305,7 @@ fn sort_error_set_result() void {
305305
306fn addErrorsFromDecl(306fn addErrorsFromDecl(
307 decl_index: Decl.Index,307 decl_index: Decl.Index,
308 out: *std.StringArrayHashMapUnmanaged(ErrorIdentifier),308 out: *std.array_hash_map.String(ErrorIdentifier),
309) Oom!void {309) Oom!void {
310 switch (decl_index.get().categorize()) {310 switch (decl_index.get().categorize()) {
311 .error_set => |node| try addErrorsFromExpr(decl_index, out, node),311 .error_set => |node| try addErrorsFromExpr(decl_index, out, node),
...@@ -316,7 +316,7 @@ fn addErrorsFromDecl(...@@ -316,7 +316,7 @@ fn addErrorsFromDecl(
316316
317fn addErrorsFromExpr(317fn addErrorsFromExpr(
318 decl_index: Decl.Index,318 decl_index: Decl.Index,
319 out: *std.StringArrayHashMapUnmanaged(ErrorIdentifier),319 out: *std.array_hash_map.String(ErrorIdentifier),
320 node: Ast.Node.Index,320 node: Ast.Node.Index,
321) Oom!void {321) Oom!void {
322 const decl = decl_index.get();322 const decl = decl_index.get();
...@@ -343,7 +343,7 @@ fn addErrorsFromExpr(...@@ -343,7 +343,7 @@ fn addErrorsFromExpr(
343343
344fn addErrorsFromNode(344fn addErrorsFromNode(
345 decl_index: Decl.Index,345 decl_index: Decl.Index,
346 out: *std.StringArrayHashMapUnmanaged(ErrorIdentifier),346 out: *std.array_hash_map.String(ErrorIdentifier),
347 node: Ast.Node.Index,347 node: Ast.Node.Index,
348) Oom!void {348) Oom!void {
349 const decl = decl_index.get();349 const decl = decl_index.get();
lib/fuzzer.zig+3-3
...@@ -340,7 +340,7 @@ const Fuzzer = struct {...@@ -340,7 +340,7 @@ const Fuzzer = struct {
340 quality_buf: []Input.Best,340 quality_buf: []Input.Best,
341 input_buf: []Input.Best.Map,341 input_buf: []Input.Best.Map,
342 },342 },
343 seen_uids: std.ArrayHashMapUnmanaged(Uid, struct {343 seen_uids: std.array_hash_map.Custom(Uid, struct {
344 slices: union {344 slices: union {
345 ints: std.ArrayList([]u64),345 ints: std.ArrayList([]u64),
346 bytes: std.ArrayList(Input.Data.Bytes),346 bytes: std.ArrayList(Input.Data.Bytes),
...@@ -505,7 +505,7 @@ const Fuzzer = struct {...@@ -505,7 +505,7 @@ const Fuzzer = struct {
505 }505 }
506 };506 };
507507
508 pub const UidSlices = std.ArrayHashMapUnmanaged(Uid, struct {508 pub const UidSlices = std.array_hash_map.Custom(Uid, struct {
509 base: u32,509 base: u32,
510 len: u32,510 len: u32,
511 }, Uid.hashmap_ctx, false);511 }, Uid.hashmap_ctx, false);
...@@ -584,7 +584,7 @@ const Fuzzer = struct {...@@ -584,7 +584,7 @@ const Fuzzer = struct {
584 };584 };
585585
586 pub const Builder = struct {586 pub const Builder = struct {
587 uid_slices: std.ArrayHashMapUnmanaged(Uid, union {587 uid_slices: std.array_hash_map.Custom(Uid, union {
588 ints: std.MultiArrayList(struct {588 ints: std.MultiArrayList(struct {
589 value: u64,589 value: u64,
590 order_i: u32,590 order_i: u32,
lib/std/Build.zig+3-3
...@@ -33,7 +33,7 @@ user_input_options: UserInputOptionsMap,...@@ -33,7 +33,7 @@ user_input_options: UserInputOptionsMap,
33available_options_map: std.array_hash_map.String(AvailableOption) = .empty,33available_options_map: std.array_hash_map.String(AvailableOption) = .empty,
34invalid_user_input: bool,34invalid_user_input: bool,
35default_step: *Step,35default_step: *Step,
36top_level_steps: std.StringArrayHashMapUnmanaged(*Step.TopLevel),36top_level_steps: std.array_hash_map.String(*Step.TopLevel),
37/// Path to the directory containing build.zig.37/// Path to the directory containing build.zig.
38root: Cache.Path,38root: Cache.Path,
39debug_log_scopes: []const []const u8 = &.{},39debug_log_scopes: []const []const u8 = &.{},
...@@ -78,11 +78,11 @@ pub const Graph = struct {...@@ -78,11 +78,11 @@ pub const Graph = struct {
78 io: Io,78 io: Io,
79 /// Process lifetime.79 /// Process lifetime.
80 arena: Allocator,80 arena: Allocator,
81 system_integration_options: std.StringArrayHashMapUnmanaged(SystemLibraryMode) = .empty,81 system_integration_options: std.array_hash_map.String(SystemLibraryMode) = .empty,
82 system_package_mode: bool = false,82 system_package_mode: bool = false,
83 zig_exe: []const u8,83 zig_exe: []const u8,
84 environ_map: process.Environ.Map,84 environ_map: process.Environ.Map,
85 needed_lazy_dependencies: std.StringArrayHashMapUnmanaged(void) = .empty,85 needed_lazy_dependencies: std.array_hash_map.String(void) = .empty,
86 /// Information about the native target. Computed before build() is invoked.86 /// Information about the native target. Computed before build() is invoked.
87 host: ResolvedTarget,87 host: ResolvedTarget,
88 dependency_cache: InitializedDepMap = .empty,88 dependency_cache: InitializedDepMap = .empty,
lib/std/Build/Cache.zig+1-1
...@@ -351,7 +351,7 @@ pub const Manifest = struct {...@@ -351,7 +351,7 @@ pub const Manifest = struct {
351 };351 };
352 };352 };
353353
354 pub const Files = std.ArrayHashMapUnmanaged(File, void, FilesContext, false);354 pub const Files = std.array_hash_map.Custom(File, void, FilesContext, false);
355355
356 pub const FilesContext = struct {356 pub const FilesContext = struct {
357 pub fn hash(fc: FilesContext, file: File) u32 {357 pub fn hash(fc: FilesContext, file: File) u32 {
lib/std/Build/Module.zig+3-3
...@@ -12,7 +12,7 @@ root_source_file: ?LazyPath,...@@ -12,7 +12,7 @@ root_source_file: ?LazyPath,
12/// The modules that are mapped into this module's import table.12/// The modules that are mapped into this module's import table.
13/// Use `addImport` rather than modifying this field directly in order to13/// Use `addImport` rather than modifying this field directly in order to
14/// maintain step dependency edges.14/// maintain step dependency edges.
15import_table: std.StringArrayHashMapUnmanaged(*Module),15import_table: std.array_hash_map.String(*Module),
1616
17resolved_target: ?std.Build.ResolvedTarget = null,17resolved_target: ?std.Build.ResolvedTarget = null,
18optimize: ?std.builtin.OptimizeMode = null,18optimize: ?std.builtin.OptimizeMode = null,
...@@ -22,7 +22,7 @@ c_macros: ArrayList([]const u8),...@@ -22,7 +22,7 @@ c_macros: ArrayList([]const u8),
22include_dirs: ArrayList(IncludeDir),22include_dirs: ArrayList(IncludeDir),
23lib_paths: ArrayList(LazyPath),23lib_paths: ArrayList(LazyPath),
24rpaths: ArrayList(RPath),24rpaths: ArrayList(RPath),
25frameworks: std.StringArrayHashMapUnmanaged(LinkFrameworkOptions),25frameworks: std.array_hash_map.String(LinkFrameworkOptions),
26link_objects: ArrayList(LinkObject),26link_objects: ArrayList(LinkObject),
2727
28strip: ?bool,28strip: ?bool,
...@@ -563,7 +563,7 @@ pub fn getGraph(root: *Module) Graph {...@@ -563,7 +563,7 @@ pub fn getGraph(root: *Module) Graph {
563563
564 const arena = root.owner.graph.arena;564 const arena = root.owner.graph.arena;
565565
566 var modules: std.AutoArrayHashMapUnmanaged(*std.Build.Module, []const u8) = .empty;566 var modules: std.array_hash_map.Auto(*std.Build.Module, []const u8) = .empty;
567 var next_idx: usize = 0;567 var next_idx: usize = 0;
568568
569 modules.putNoClobber(arena, root, "root") catch @panic("OOM");569 modules.putNoClobber(arena, root, "root") catch @panic("OOM");
lib/std/Build/Step/Compile.zig+2-2
...@@ -187,7 +187,7 @@ entry: Entry = .default,...@@ -187,7 +187,7 @@ entry: Entry = .default,
187/// List of symbols forced as undefined in the symbol table187/// List of symbols forced as undefined in the symbol table
188/// thus forcing their resolution by the linker.188/// thus forcing their resolution by the linker.
189/// Corresponds to `-u <symbol>` for ELF/MachO and `/include:<symbol>` for COFF/PE.189/// Corresponds to `-u <symbol>` for ELF/MachO and `/include:<symbol>` for COFF/PE.
190force_undefined_symbols: std.StringArrayHashMapUnmanaged(void),190force_undefined_symbols: std.array_hash_map.String(void),
191191
192/// Overrides the default stack size192/// Overrides the default stack size
193stack_size: ?u64 = null,193stack_size: ?u64 = null,
...@@ -759,7 +759,7 @@ pub fn rootModuleTarget(c: *Compile) std.Target {...@@ -759,7 +759,7 @@ pub fn rootModuleTarget(c: *Compile) std.Target {
759pub fn getCompileDependencies(start: *Compile, chase_dynamic: bool) []const *Compile {759pub fn getCompileDependencies(start: *Compile, chase_dynamic: bool) []const *Compile {
760 const arena = start.step.owner.graph.arena;760 const arena = start.step.owner.graph.arena;
761761
762 var compiles: std.AutoArrayHashMapUnmanaged(*Compile, void) = .empty;762 var compiles: std.array_hash_map.Auto(*Compile, void) = .empty;
763 var next_idx: usize = 0;763 var next_idx: usize = 0;
764764
765 compiles.putNoClobber(arena, start, {}) catch @panic("OOM");765 compiles.putNoClobber(arena, start, {}) catch @panic("OOM");
lib/std/Io/Kqueue.zig+1-1
...@@ -40,7 +40,7 @@ const Thread = struct {...@@ -40,7 +40,7 @@ const Thread = struct {
40 steal_ready_search_index: u32,40 steal_ready_search_index: u32,
41 /// For ensuring multiple fibers waiting on the same file descriptor and41 /// For ensuring multiple fibers waiting on the same file descriptor and
42 /// filter use the same kevent.42 /// filter use the same kevent.
43 wait_queues: std.AutoArrayHashMapUnmanaged(WaitQueueKey, *Fiber),43 wait_queues: std.array_hash_map.Auto(WaitQueueKey, *Fiber),
4444
45 const WaitQueueKey = struct {45 const WaitQueueKey = struct {
46 ident: usize,46 ident: usize,
lib/std/debug/Coverage.zig+2-2
...@@ -15,13 +15,13 @@ const assert = std.debug.assert;...@@ -15,13 +15,13 @@ const assert = std.debug.assert;
15/// String memory references the memory-mapped debug information.15/// String memory references the memory-mapped debug information.
16///16///
17/// Protected by `mutex`.17/// Protected by `mutex`.
18directories: std.ArrayHashMapUnmanaged(String, void, String.MapContext, false),18directories: std.array_hash_map.Custom(String, void, String.MapContext, false),
19/// Provides a globally-scoped integer index for files.19/// Provides a globally-scoped integer index for files.
20///20///
21/// String memory references the memory-mapped debug information.21/// String memory references the memory-mapped debug information.
22///22///
23/// Protected by `mutex`.23/// Protected by `mutex`.
24files: std.ArrayHashMapUnmanaged(File, void, File.MapContext, false),24files: std.array_hash_map.Custom(File, void, File.MapContext, false),
25string_bytes: std.ArrayList(u8),25string_bytes: std.ArrayList(u8),
26/// Protects the other fields.26/// Protects the other fields.
27mutex: Io.Mutex,27mutex: Io.Mutex,
lib/std/debug/Dwarf.zig+1-1
...@@ -134,7 +134,7 @@ pub const CompileUnit = struct {...@@ -134,7 +134,7 @@ pub const CompileUnit = struct {
134 files: []FileEntry,134 files: []FileEntry,
135 version: u16,135 version: u16,
136136
137 pub const LineTable = std.AutoArrayHashMapUnmanaged(u64, LineEntry);137 pub const LineTable = std.array_hash_map.Auto(u64, LineEntry);
138138
139 pub const LineEntry = struct {139 pub const LineEntry = struct {
140 line: u32,140 line: u32,
lib/std/debug/MachOFile.zig+5-5
...@@ -4,7 +4,7 @@ strings: []const u8,...@@ -4,7 +4,7 @@ strings: []const u8,
4text_vmaddr: u64,4text_vmaddr: u64,
55
6/// Key is index into `strings` of the file path.6/// Key is index into `strings` of the file path.
7ofiles: std.AutoArrayHashMapUnmanaged(u32, Error!OFile),7ofiles: std.array_hash_map.Auto(u32, Error!OFile),
88
9pub const Error = error{9pub const Error = error{
10 InvalidMachO,10 InvalidMachO,
...@@ -115,7 +115,7 @@ pub fn load(gpa: Allocator, io: Io, path: []const u8, arch: std.Target.Cpu.Arch)...@@ -115,7 +115,7 @@ pub fn load(gpa: Allocator, io: Io, path: []const u8, arch: std.Target.Cpu.Arch)
115 // necessary because we prefer to use STAB ("symbolic debugging table") symbols,115 // necessary because we prefer to use STAB ("symbolic debugging table") symbols,
116 // but they might not be present, so we track normal symbols too.116 // but they might not be present, so we track normal symbols too.
117 // Indices match 1-1 with those of `symbols`.117 // Indices match 1-1 with those of `symbols`.
118 var symbol_names: std.StringArrayHashMapUnmanaged(void) = .empty;118 var symbol_names: std.array_hash_map.String(void) = .empty;
119 defer symbol_names.deinit(gpa);119 defer symbol_names.deinit(gpa);
120 try symbol_names.ensureUnusedCapacity(gpa, symtab.nsyms);120 try symbol_names.ensureUnusedCapacity(gpa, symtab.nsyms);
121121
...@@ -305,7 +305,7 @@ const OFile = struct {...@@ -305,7 +305,7 @@ const OFile = struct {
305 symtab_raw: []align(1) const macho.nlist_64,305 symtab_raw: []align(1) const macho.nlist_64,
306 /// All named symbols in `symtab_raw`. Stored `u32` key is the index into `symtab_raw`. Accessed306 /// All named symbols in `symtab_raw`. Stored `u32` key is the index into `symtab_raw`. Accessed
307 /// through `SymbolAdapter`, so that the symbol name is used as the logical key.307 /// through `SymbolAdapter`, so that the symbol name is used as the logical key.
308 symbols_by_name: std.ArrayHashMapUnmanaged(u32, void, void, true),308 symbols_by_name: std.array_hash_map.Custom(u32, void, void, true),
309309
310 const SymbolAdapter = struct {310 const SymbolAdapter = struct {
311 strtab: []const u8,311 strtab: []const u8,
...@@ -380,7 +380,7 @@ test {...@@ -380,7 +380,7 @@ test {
380380
381fn appendStabSymbol(381fn appendStabSymbol(
382 symbols: *std.ArrayList(Symbol),382 symbols: *std.ArrayList(Symbol),
383 symbol_names: *std.StringArrayHashMapUnmanaged(void),383 symbol_names: *std.array_hash_map.String(void),
384 strings: []const u8,384 strings: []const u8,
385 last_sym: Symbol,385 last_sym: Symbol,
386) void {386) void {
...@@ -476,7 +476,7 @@ fn loadOFile(gpa: Allocator, io: Io, o_file_name: []const u8) !OFile {...@@ -476,7 +476,7 @@ fn loadOFile(gpa: Allocator, io: Io, o_file_name: []const u8) !OFile {
476 const symtab_raw: []align(1) const macho.nlist_64 = @ptrCast(mapped_ofile[symtab_cmd.symoff..][0..n_sym_bytes]);476 const symtab_raw: []align(1) const macho.nlist_64 = @ptrCast(mapped_ofile[symtab_cmd.symoff..][0..n_sym_bytes]);
477477
478 // TODO handle tentative (common) symbols478 // TODO handle tentative (common) symbols
479 var symbols_by_name: std.ArrayHashMapUnmanaged(u32, void, void, true) = .empty;479 var symbols_by_name: std.array_hash_map.Custom(u32, void, void, true) = .empty;
480 defer symbols_by_name.deinit(gpa);480 defer symbols_by_name.deinit(gpa);
481 try symbols_by_name.ensureUnusedCapacity(gpa, @intCast(symtab_raw.len));481 try symbols_by_name.ensureUnusedCapacity(gpa, @intCast(symtab_raw.len));
482 for (symtab_raw, 0..) |sym_raw, sym_index| {482 for (symtab_raw, 0..) |sym_raw, sym_index| {
lib/std/debug/SelfInfo/MachO.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1mutex: Io.Mutex,1mutex: Io.Mutex,
2/// Accessed through `Module.Adapter`.2/// Accessed through `Module.Adapter`.
3modules: std.ArrayHashMapUnmanaged(Module, void, Module.Context, false),3modules: std.array_hash_map.Custom(Module, void, Module.Context, false),
44
5pub const init: SelfInfo = .{5pub const init: SelfInfo = .{
6 .mutex = .init,6 .mutex = .init,
lib/std/json/hashmap.zig+4-4
...@@ -6,20 +6,20 @@ const innerParse = @import("static.zig").innerParse;...@@ -6,20 +6,20 @@ const innerParse = @import("static.zig").innerParse;
6const innerParseFromValue = @import("static.zig").innerParseFromValue;6const innerParseFromValue = @import("static.zig").innerParseFromValue;
7const Value = @import("dynamic.zig").Value;7const Value = @import("dynamic.zig").Value;
88
9/// A thin wrapper around `std.StringArrayHashMapUnmanaged` that implements9/// A thin wrapper around `std.array_hash_map.String` that implements
10/// `jsonParse`, `jsonParseFromValue`, and `jsonStringify`.10/// `jsonParse`, `jsonParseFromValue`, and `jsonStringify`.
11/// This is useful when your JSON schema has an object with arbitrary data keys11/// This is useful when your JSON schema has an object with arbitrary data keys
12/// instead of comptime-known struct field names.12/// instead of comptime-known struct field names.
13pub fn ArrayHashMap(comptime T: type) type {13pub fn ArrayHashMap(comptime T: type) type {
14 return struct {14 return struct {
15 map: std.StringArrayHashMapUnmanaged(T) = .empty,15 map: std.array_hash_map.String(T) = .empty,
1616
17 pub fn deinit(self: *@This(), allocator: Allocator) void {17 pub fn deinit(self: *@This(), allocator: Allocator) void {
18 self.map.deinit(allocator);18 self.map.deinit(allocator);
19 }19 }
2020
21 pub fn jsonParse(allocator: Allocator, source: anytype, options: ParseOptions) !@This() {21 pub fn jsonParse(allocator: Allocator, source: anytype, options: ParseOptions) !@This() {
22 var map: std.StringArrayHashMapUnmanaged(T) = .empty;22 var map: std.array_hash_map.String(T) = .empty;
23 errdefer map.deinit(allocator);23 errdefer map.deinit(allocator);
2424
25 if (.object_begin != try source.next()) return error.UnexpectedToken;25 if (.object_begin != try source.next()) return error.UnexpectedToken;
...@@ -52,7 +52,7 @@ pub fn ArrayHashMap(comptime T: type) type {...@@ -52,7 +52,7 @@ pub fn ArrayHashMap(comptime T: type) type {
52 pub fn jsonParseFromValue(allocator: Allocator, source: Value, options: ParseOptions) !@This() {52 pub fn jsonParseFromValue(allocator: Allocator, source: Value, options: ParseOptions) !@This() {
53 if (source != .object) return error.UnexpectedToken;53 if (source != .object) return error.UnexpectedToken;
5454
55 var map: std.StringArrayHashMapUnmanaged(T) = .empty;55 var map: std.array_hash_map.String(T) = .empty;
56 errdefer map.deinit(allocator);56 errdefer map.deinit(allocator);
5757
58 var it = source.object.iterator();58 var it = source.object.iterator();
lib/std/process/Environ.zig+1-1
...@@ -101,7 +101,7 @@ pub const Map = struct {...@@ -101,7 +101,7 @@ pub const Map = struct {
101 array_hash_map: ArrayHashMap,101 array_hash_map: ArrayHashMap,
102 allocator: Allocator,102 allocator: Allocator,
103103
104 const ArrayHashMap = std.ArrayHashMapUnmanaged([]const u8, []const u8, EnvNameHashContext, false);104 const ArrayHashMap = std.array_hash_map.Custom([]const u8, []const u8, EnvNameHashContext, false);
105105
106 pub const Size = usize;106 pub const Size = usize;
107107
lib/std/process/Preopens.zig+1-1
...@@ -16,7 +16,7 @@ pub const empty: Preopens = switch (native_os) {...@@ -16,7 +16,7 @@ pub const empty: Preopens = switch (native_os) {
1616
17pub const Map = switch (native_os) {17pub const Map = switch (native_os) {
18 // Indexed by file descriptor number.18 // Indexed by file descriptor number.
19 .wasi => std.StringArrayHashMapUnmanaged(void),19 .wasi => std.array_hash_map.String(void),
20 else => void,20 else => void,
21};21};
2222
lib/std/zig/Ast/Render.zig+1-1
...@@ -42,7 +42,7 @@ pub const Fixups = struct {...@@ -42,7 +42,7 @@ pub const Fixups = struct {
42 /// These nodes will be replaced with a different node.42 /// These nodes will be replaced with a different node.
43 replace_nodes_with_node: std.AutoHashMapUnmanaged(Ast.Node.Index, Ast.Node.Index) = .empty,43 replace_nodes_with_node: std.AutoHashMapUnmanaged(Ast.Node.Index, Ast.Node.Index) = .empty,
44 /// Change all identifier names matching the key to be value instead.44 /// Change all identifier names matching the key to be value instead.
45 rename_identifiers: std.StringArrayHashMapUnmanaged([]const u8) = .empty,45 rename_identifiers: std.array_hash_map.String([]const u8) = .empty,
4646
47 /// All `@import` builtin calls which refer to a file path will be prefixed47 /// All `@import` builtin calls which refer to a file path will be prefixed
48 /// with this path.48 /// with this path.
lib/std/zig/AstGen.zig+5-5
...@@ -52,7 +52,7 @@ within_fn: bool = false,...@@ -52,7 +52,7 @@ within_fn: bool = false,
52fn_ret_ty: Zir.Inst.Ref = .none,52fn_ret_ty: Zir.Inst.Ref = .none,
53/// Maps string table indexes to the first `@import` ZIR instruction53/// Maps string table indexes to the first `@import` ZIR instruction
54/// that uses this string as the operand.54/// that uses this string as the operand.
55imports: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, Ast.TokenIndex) = .empty,55imports: std.array_hash_map.Auto(Zir.NullTerminatedString, Ast.TokenIndex) = .empty,
56/// Used for temporary storage when building payloads.56/// Used for temporary storage when building payloads.
57scratch: std.ArrayList(u32) = .empty,57scratch: std.ArrayList(u32) = .empty,
58/// Whenever a `ref` instruction is needed, it is created and saved in this58/// Whenever a `ref` instruction is needed, it is created and saved in this
...@@ -11163,7 +11163,7 @@ const Scope = struct {...@@ -11163,7 +11163,7 @@ const Scope = struct {
11163 declaring_gz: ?*GenZir,11163 declaring_gz: ?*GenZir,
1116411164
11165 /// Set of captures used by this namespace.11165 /// Set of captures used by this namespace.
11166 captures: std.AutoArrayHashMapUnmanaged(Zir.Inst.Capture, Zir.NullTerminatedString) = .empty,11166 captures: std.array_hash_map.Auto(Zir.Inst.Capture, Zir.NullTerminatedString) = .empty,
1116711167
11168 fn deinit(self: *Namespace, gpa: Allocator) void {11168 fn deinit(self: *Namespace, gpa: Allocator) void {
11169 self.decls.deinit(gpa);11169 self.decls.deinit(gpa);
...@@ -12856,9 +12856,9 @@ fn scanContainer(...@@ -12856,9 +12856,9 @@ fn scanContainer(
12856 var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, astgen.gpa);12856 var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, astgen.gpa);
12857 const bfa = bfa_state.allocator();12857 const bfa = bfa_state.allocator();
1285812858
12859 var names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;12859 var names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
12860 var test_names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;12860 var test_names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
12861 var decltest_names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;12861 var decltest_names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
12862 defer {12862 defer {
12863 names.deinit(bfa);12863 names.deinit(bfa);
12864 test_names.deinit(bfa);12864 test_names.deinit(bfa);
lib/std/zig/llvm/Builder.zig+21-21
...@@ -21,25 +21,25 @@ data_layout: String,...@@ -21,25 +21,25 @@ data_layout: String,
21target_triple: String,21target_triple: String,
22module_asm: std.ArrayList(u8),22module_asm: std.ArrayList(u8),
2323
24string_map: std.AutoArrayHashMapUnmanaged(void, void),24string_map: std.array_hash_map.Auto(void, void),
25string_indices: std.ArrayList(u32),25string_indices: std.ArrayList(u32),
26string_bytes: std.ArrayList(u8),26string_bytes: std.ArrayList(u8),
2727
28types: std.AutoArrayHashMapUnmanaged(String, Type),28types: std.array_hash_map.Auto(String, Type),
29next_unnamed_type: String,29next_unnamed_type: String,
30next_unique_type_id: std.AutoHashMapUnmanaged(String, u32),30next_unique_type_id: std.AutoHashMapUnmanaged(String, u32),
31type_map: std.AutoArrayHashMapUnmanaged(void, void),31type_map: std.array_hash_map.Auto(void, void),
32type_items: std.ArrayList(Type.Item),32type_items: std.ArrayList(Type.Item),
33type_extra: std.ArrayList(u32),33type_extra: std.ArrayList(u32),
3434
35attributes: std.AutoArrayHashMapUnmanaged(Attribute.Storage, void),35attributes: std.array_hash_map.Auto(Attribute.Storage, void),
36attributes_map: std.AutoArrayHashMapUnmanaged(void, void),36attributes_map: std.array_hash_map.Auto(void, void),
37attributes_indices: std.ArrayList(u32),37attributes_indices: std.ArrayList(u32),
38attributes_extra: std.ArrayList(u32),38attributes_extra: std.ArrayList(u32),
3939
40function_attributes_set: std.AutoArrayHashMapUnmanaged(FunctionAttributes, void),40function_attributes_set: std.array_hash_map.Auto(FunctionAttributes, void),
4141
42globals: std.AutoArrayHashMapUnmanaged(StrtabString, Global),42globals: std.array_hash_map.Auto(StrtabString, Global),
43next_unnamed_global: StrtabString,43next_unnamed_global: StrtabString,
44next_replaced_global: StrtabString,44next_replaced_global: StrtabString,
45next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32),45next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32),
...@@ -47,28 +47,28 @@ aliases: std.ArrayList(Alias),...@@ -47,28 +47,28 @@ aliases: std.ArrayList(Alias),
47variables: std.ArrayList(Variable),47variables: std.ArrayList(Variable),
48functions: std.ArrayList(Function),48functions: std.ArrayList(Function),
4949
50strtab_string_map: std.AutoArrayHashMapUnmanaged(void, void),50strtab_string_map: std.array_hash_map.Auto(void, void),
51strtab_string_indices: std.ArrayList(u32),51strtab_string_indices: std.ArrayList(u32),
52strtab_string_bytes: std.ArrayList(u8),52strtab_string_bytes: std.ArrayList(u8),
5353
54constant_map: std.AutoArrayHashMapUnmanaged(void, void),54constant_map: std.array_hash_map.Auto(void, void),
55constant_items: std.MultiArrayList(Constant.Item),55constant_items: std.MultiArrayList(Constant.Item),
56constant_extra: std.ArrayList(u32),56constant_extra: std.ArrayList(u32),
57constant_limbs: std.ArrayList(std.math.big.Limb),57constant_limbs: std.ArrayList(std.math.big.Limb),
5858
59alignment_forward_references: std.ArrayList(Alignment),59alignment_forward_references: std.ArrayList(Alignment),
6060
61metadata_map: std.AutoArrayHashMapUnmanaged(void, void),61metadata_map: std.array_hash_map.Auto(void, void),
62metadata_items: std.MultiArrayList(Metadata.Item),62metadata_items: std.MultiArrayList(Metadata.Item),
63metadata_extra: std.ArrayList(u32),63metadata_extra: std.ArrayList(u32),
64metadata_limbs: std.ArrayList(std.math.big.Limb),64metadata_limbs: std.ArrayList(std.math.big.Limb),
65metadata_forward_references: std.ArrayList(Metadata.Optional),65metadata_forward_references: std.ArrayList(Metadata.Optional),
66metadata_named: std.AutoArrayHashMapUnmanaged(String, struct {66metadata_named: std.array_hash_map.Auto(String, struct {
67 len: u32,67 len: u32,
68 index: Metadata.Item.ExtraIndex,68 index: Metadata.Item.ExtraIndex,
69}),69}),
7070
71metadata_string_map: std.AutoArrayHashMapUnmanaged(void, void),71metadata_string_map: std.array_hash_map.Auto(void, void),
72metadata_string_indices: std.ArrayList(u32),72metadata_string_indices: std.ArrayList(u32),
73metadata_string_bytes: std.ArrayList(u8),73metadata_string_bytes: std.ArrayList(u8),
7474
...@@ -1633,7 +1633,7 @@ pub const FunctionAttributes = enum(u32) {...@@ -1633,7 +1633,7 @@ pub const FunctionAttributes = enum(u32) {
1633 pub const Wip = struct {1633 pub const Wip = struct {
1634 maps: Maps = .empty,1634 maps: Maps = .empty,
16351635
1636 const Map = std.AutoArrayHashMapUnmanaged(Attribute.Kind, Attribute.Index);1636 const Map = std.array_hash_map.Auto(Attribute.Kind, Attribute.Index);
1637 const Maps = std.ArrayList(Map);1637 const Maps = std.ArrayList(Map);
16381638
1639 pub fn deinit(self: *Wip, builder: *const Builder) void {1639 pub fn deinit(self: *Wip, builder: *const Builder) void {
...@@ -5235,8 +5235,8 @@ pub const WipFunction = struct {...@@ -5235,8 +5235,8 @@ pub const WipFunction = struct {
5235 instructions: std.MultiArrayList(Instruction),5235 instructions: std.MultiArrayList(Instruction),
5236 names: std.ArrayList(String),5236 names: std.ArrayList(String),
5237 strip: bool,5237 strip: bool,
5238 debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation),5238 debug_locations: std.array_hash_map.Auto(Instruction.Index, DebugLocation),
5239 debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void),5239 debug_values: std.array_hash_map.Auto(Instruction.Index, void),
5240 extra: std.ArrayList(u32),5240 extra: std.ArrayList(u32),
52415241
5242 pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 };5242 pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 };
...@@ -8451,7 +8451,7 @@ pub const Metadata = packed struct(u32) {...@@ -8451,7 +8451,7 @@ pub const Metadata = packed struct(u32) {
8451 const Formatter = struct {8451 const Formatter = struct {
8452 builder: *Builder,8452 builder: *Builder,
8453 need_comma: bool,8453 need_comma: bool,
8454 map: std.AutoArrayHashMapUnmanaged(union(enum) {8454 map: std.array_hash_map.Auto(union(enum) {
8455 metadata: Metadata,8455 metadata: Metadata,
8456 debug_location: DebugLocation.Location,8456 debug_location: DebugLocation.Location,
8457 }, void) = .empty,8457 }, void) = .empty,
...@@ -9791,7 +9791,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -9791,7 +9791,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
9791 }9791 }
9792 }9792 }
97939793
9794 var attribute_groups: std.AutoArrayHashMapUnmanaged(Attributes, void) = .empty;9794 var attribute_groups: std.array_hash_map.Auto(Attributes, void) = .empty;
9795 defer attribute_groups.deinit(self.gpa);9795 defer attribute_groups.deinit(self.gpa);
97969796
9797 for (0.., self.functions.items) |function_i, function| {9797 for (0.., self.functions.items) |function_i, function| {
...@@ -13507,7 +13507,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13507,7 +13507,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13507 try type_block.end();13507 try type_block.end();
13508 }13508 }
1350913509
13510 var attributes_set: std.AutoArrayHashMapUnmanaged(struct {13510 var attributes_set: std.array_hash_map.Auto(struct {
13511 attributes: Attributes,13511 attributes: Attributes,
13512 index: u32,13512 index: u32,
13513 }, void) = .{};13513 }, void) = .{};
...@@ -13743,7 +13743,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13743,7 +13743,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13743 try paramattr_block.end();13743 try paramattr_block.end();
13744 }13744 }
1374513745
13746 var globals: std.AutoArrayHashMapUnmanaged(Global.Index, void) = .empty;13746 var globals: std.array_hash_map.Auto(Global.Index, void) = .empty;
13747 defer globals.deinit(self.gpa);13747 defer globals.deinit(self.gpa);
13748 try globals.ensureUnusedCapacity(13748 try globals.ensureUnusedCapacity(
13749 self.gpa,13749 self.gpa,
...@@ -13784,7 +13784,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13784,7 +13784,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
1378413784
13785 const ConstantAdapter = struct {13785 const ConstantAdapter = struct {
13786 builder: *const Builder,13786 builder: *const Builder,
13787 globals: *const std.AutoArrayHashMapUnmanaged(Global.Index, void),13787 globals: *const std.array_hash_map.Auto(Global.Index, void),
1378813788
13789 pub fn get(adapter: @This(), param: anytype) switch (@TypeOf(param)) {13789 pub fn get(adapter: @This(), param: anytype) switch (@TypeOf(param)) {
13790 Constant => u32,13790 Constant => u32,
...@@ -13815,7 +13815,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13815,7 +13815,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
1381513815
13816 // Globals13816 // Globals
13817 {13817 {
13818 var section_map: std.AutoArrayHashMapUnmanaged(String, void) = .empty;13818 var section_map: std.array_hash_map.Auto(String, void) = .empty;
13819 defer section_map.deinit(self.gpa);13819 defer section_map.deinit(self.gpa);
13820 try section_map.ensureUnusedCapacity(self.gpa, globals.count());13820 try section_map.ensureUnusedCapacity(self.gpa, globals.count());
1382113821
src/Compilation.zig+19-19
...@@ -87,7 +87,7 @@ link_inputs: []const link.Input,...@@ -87,7 +87,7 @@ link_inputs: []const link.Input,
87framework_dirs: []const []const u8,87framework_dirs: []const []const u8,
88/// These are only for DLLs dependencies fulfilled by the `.def` files shipped88/// These are only for DLLs dependencies fulfilled by the `.def` files shipped
89/// with Zig. Static libraries are provided as `link.Input` values.89/// with Zig. Static libraries are provided as `link.Input` values.
90windows_libs: std.StringArrayHashMapUnmanaged(void),90windows_libs: std.array_hash_map.String(void),
91/// The number of items in `windows_libs` which we have already built. All items at or after this91/// The number of items in `windows_libs` which we have already built. All items at or after this
92/// index will be built in `performAllTheWork`.92/// index will be built in `performAllTheWork`.
93windows_libs_num_done: u32,93windows_libs_num_done: u32,
...@@ -101,10 +101,10 @@ native_system_include_paths: []const []const u8,...@@ -101,10 +101,10 @@ native_system_include_paths: []const []const u8,
101/// List of symbols forced as undefined in the symbol table101/// List of symbols forced as undefined in the symbol table
102/// thus forcing their resolution by the linker.102/// thus forcing their resolution by the linker.
103/// Corresponds to `-u <symbol>` for ELF/MachO and `/include:<symbol>` for COFF/PE.103/// Corresponds to `-u <symbol>` for ELF/MachO and `/include:<symbol>` for COFF/PE.
104force_undefined_symbols: std.StringArrayHashMapUnmanaged(void),104force_undefined_symbols: std.array_hash_map.String(void),
105105
106c_object_table: std.AutoArrayHashMapUnmanaged(*CObject, void) = .empty,106c_object_table: std.array_hash_map.Auto(*CObject, void) = .empty,
107win32_resource_table: if (dev.env.supports(.win32_resource)) std.AutoArrayHashMapUnmanaged(*Win32Resource, void) else struct {107win32_resource_table: if (dev.env.supports(.win32_resource)) std.array_hash_map.Auto(*Win32Resource, void) else struct {
108 pub fn keys(_: @This()) [0]void {108 pub fn keys(_: @This()) [0]void {
109 return .{};109 return .{};
110 }110 }
...@@ -145,11 +145,11 @@ win32_resource_work_queue: if (dev.env.supports(.win32_resource)) std.Deque(*Win...@@ -145,11 +145,11 @@ win32_resource_work_queue: if (dev.env.supports(.win32_resource)) std.Deque(*Win
145145
146/// The ErrorMsg memory is owned by the `CObject`, using Compilation's general purpose allocator.146/// The ErrorMsg memory is owned by the `CObject`, using Compilation's general purpose allocator.
147/// This data is accessed by multiple threads and is protected by `mutex`.147/// This data is accessed by multiple threads and is protected by `mutex`.
148failed_c_objects: std.AutoArrayHashMapUnmanaged(*CObject, *CObject.Diag.Bundle) = .empty,148failed_c_objects: std.array_hash_map.Auto(*CObject, *CObject.Diag.Bundle) = .empty,
149149
150/// The ErrorBundle memory is owned by the `Win32Resource`, using Compilation's general purpose allocator.150/// The ErrorBundle memory is owned by the `Win32Resource`, using Compilation's general purpose allocator.
151/// This data is accessed by multiple threads and is protected by `mutex`.151/// This data is accessed by multiple threads and is protected by `mutex`.
152failed_win32_resources: if (dev.env.supports(.win32_resource)) std.AutoArrayHashMapUnmanaged(*Win32Resource, ErrorBundle) else struct {152failed_win32_resources: if (dev.env.supports(.win32_resource)) std.array_hash_map.Auto(*Win32Resource, ErrorBundle) else struct {
153 pub fn values(_: @This()) [0]void {153 pub fn values(_: @This()) [0]void {
154 return .{};154 return .{};
155 }155 }
...@@ -157,7 +157,7 @@ failed_win32_resources: if (dev.env.supports(.win32_resource)) std.AutoArrayHash...@@ -157,7 +157,7 @@ failed_win32_resources: if (dev.env.supports(.win32_resource)) std.AutoArrayHash
157} = .{},157} = .{},
158158
159/// Miscellaneous things that can fail.159/// Miscellaneous things that can fail.
160misc_failures: std.AutoArrayHashMapUnmanaged(MiscTask, MiscError) = .empty,160misc_failures: std.array_hash_map.Auto(MiscTask, MiscError) = .empty,
161161
162/// When this is `true` it means invoking clang as a sub-process is expected to inherit162/// When this is `true` it means invoking clang as a sub-process is expected to inherit
163/// stdin, stdout, stderr, and if it returns non success, to forward the exit code.163/// stdin, stdout, stderr, and if it returns non success, to forward the exit code.
...@@ -865,7 +865,7 @@ pub const TimeReport = struct {...@@ -865,7 +865,7 @@ pub const TimeReport = struct {
865 /// a function) all generic instances of this function. It also includes time spent analyzing865 /// a function) all generic instances of this function. It also includes time spent analyzing
866 /// function bodies if this is a function (generic or otherwise).866 /// function bodies if this is a function (generic or otherwise).
867 /// An entry not existing means the declaration has not been analyzed (so far).867 /// An entry not existing means the declaration has not been analyzed (so far).
868 decl_sema_info: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, struct {868 decl_sema_info: std.array_hash_map.Auto(InternPool.TrackedInst.Index, struct {
869 ns: u64,869 ns: u64,
870 count: u32,870 count: u32,
871 }),871 }),
...@@ -875,14 +875,14 @@ pub const TimeReport = struct {...@@ -875,14 +875,14 @@ pub const TimeReport = struct {
875 /// instances, both of this function itself and of its parent namespace.875 /// instances, both of this function itself and of its parent namespace.
876 /// An entry not existing means the declaration has not been codegenned (so far).876 /// An entry not existing means the declaration has not been codegenned (so far).
877 /// Every key in `decl_codegen_ns` is also in `decl_sema_ns`.877 /// Every key in `decl_codegen_ns` is also in `decl_sema_ns`.
878 decl_codegen_ns: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, u64),878 decl_codegen_ns: std.array_hash_map.Auto(InternPool.TrackedInst.Index, u64),
879879
880 /// Key is a ZIR `declaration` instruction which is anything other than a `comptime` decl; value880 /// Key is a ZIR `declaration` instruction which is anything other than a `comptime` decl; value
881 /// is the number of nanoseconds spent linking it into the binary. As above, this is the total881 /// is the number of nanoseconds spent linking it into the binary. As above, this is the total
882 /// across all generic instances.882 /// across all generic instances.
883 /// An entry not existing means the declaration has not been linked (so far).883 /// An entry not existing means the declaration has not been linked (so far).
884 /// Every key in `decl_link_ns` is also in `decl_sema_ns`.884 /// Every key in `decl_link_ns` is also in `decl_sema_ns`.
885 decl_link_ns: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, u64),885 decl_link_ns: std.array_hash_map.Auto(InternPool.TrackedInst.Index, u64),
886886
887 pub fn deinit(tr: *TimeReport, gpa: Allocator) void {887 pub fn deinit(tr: *TimeReport, gpa: Allocator) void {
888 tr.stats = undefined;888 tr.stats = undefined;
...@@ -1068,8 +1068,8 @@ pub const CObject = struct {...@@ -1068,8 +1068,8 @@ pub const CObject = struct {
1068 }1068 }
10691069
1070 pub const Bundle = struct {1070 pub const Bundle = struct {
1071 file_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty,1071 file_names: std.array_hash_map.Auto(u32, []const u8) = .empty,
1072 category_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty,1072 category_names: std.array_hash_map.Auto(u32, []const u8) = .empty,
1073 diags: []Diag = &.{},1073 diags: []Diag = &.{},
10741074
1075 pub fn destroy(bundle: *Bundle, gpa: Allocator) void {1075 pub fn destroy(bundle: *Bundle, gpa: Allocator) void {
...@@ -1122,13 +1122,13 @@ pub const CObject = struct {...@@ -1122,13 +1122,13 @@ pub const CObject = struct {
1122 var bc = std.zig.llvm.BitcodeReader.init(gpa, .{ .reader = &file_reader.interface });1122 var bc = std.zig.llvm.BitcodeReader.init(gpa, .{ .reader = &file_reader.interface });
1123 defer bc.deinit();1123 defer bc.deinit();
11241124
1125 var file_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty;1125 var file_names: std.array_hash_map.Auto(u32, []const u8) = .empty;
1126 errdefer {1126 errdefer {
1127 for (file_names.values()) |file_name| gpa.free(file_name);1127 for (file_names.values()) |file_name| gpa.free(file_name);
1128 file_names.deinit(gpa);1128 file_names.deinit(gpa);
1129 }1129 }
11301130
1131 var category_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty;1131 var category_names: std.array_hash_map.Auto(u32, []const u8) = .empty;
1132 errdefer {1132 errdefer {
1133 for (category_names.values()) |category_name| gpa.free(category_name);1133 for (category_names.values()) |category_name| gpa.free(category_name);
1134 category_names.deinit(gpa);1134 category_names.deinit(gpa);
...@@ -1604,7 +1604,7 @@ pub const CreateOptions = struct {...@@ -1604,7 +1604,7 @@ pub const CreateOptions = struct {
1604 /// implementations still do.1604 /// implementations still do.
1605 lib_directories: []const Cache.Directory = &.{},1605 lib_directories: []const Cache.Directory = &.{},
1606 rpath_list: []const []const u8 = &[0][]const u8{},1606 rpath_list: []const []const u8 = &[0][]const u8{},
1607 symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty,1607 symbol_wrap_set: std.array_hash_map.String(void) = .empty,
1608 c_source_files: []const CSourceFile = &.{},1608 c_source_files: []const CSourceFile = &.{},
1609 rc_source_files: []const RcSourceFile = &.{},1609 rc_source_files: []const RcSourceFile = &.{},
1610 manifest_file: ?[]const u8 = null,1610 manifest_file: ?[]const u8 = null,
...@@ -1683,7 +1683,7 @@ pub const CreateOptions = struct {...@@ -1683,7 +1683,7 @@ pub const CreateOptions = struct {
1683 skip_linker_dependencies: bool = false,1683 skip_linker_dependencies: bool = false,
1684 hash_style: link.File.Lld.Elf.HashStyle = .both,1684 hash_style: link.File.Lld.Elf.HashStyle = .both,
1685 entry: Entry = .default,1685 entry: Entry = .default,
1686 force_undefined_symbols: std.StringArrayHashMapUnmanaged(void) = .empty,1686 force_undefined_symbols: std.array_hash_map.String(void) = .empty,
1687 stack_size: ?u64 = null,1687 stack_size: ?u64 = null,
1688 image_base: ?u64 = null,1688 image_base: ?u64 = null,
1689 version: ?std.SemanticVersion = null,1689 version: ?std.SemanticVersion = null,
...@@ -4064,7 +4064,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {...@@ -4064,7 +4064,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {
4064 }4064 }
4065 }4065 }
4066 if (zcu.skip_analysis_this_update) break :zcu_errors;4066 if (zcu.skip_analysis_this_update) break :zcu_errors;
4067 var sorted_failed_analysis: std.AutoArrayHashMapUnmanaged(InternPool.AnalUnit, *Zcu.ErrorMsg).DataList.Slice = s: {4067 var sorted_failed_analysis: std.array_hash_map.Auto(InternPool.AnalUnit, *Zcu.ErrorMsg).DataList.Slice = s: {
4068 const SortOrder = struct {4068 const SortOrder = struct {
4069 zcu: *Zcu,4069 zcu: *Zcu,
4070 errors: []const *Zcu.ErrorMsg,4070 errors: []const *Zcu.ErrorMsg,
...@@ -4360,7 +4360,7 @@ pub fn addModuleErrorMsg(...@@ -4360,7 +4360,7 @@ pub fn addModuleErrorMsg(
43604360
4361 // De-duplicate error notes. The main use case in mind for this is4361 // De-duplicate error notes. The main use case in mind for this is
4362 // too many "note: called from here" notes when eval branch quota is reached.4362 // too many "note: called from here" notes when eval branch quota is reached.
4363 var notes: std.ArrayHashMapUnmanaged(ErrorBundle.ErrorMessage, void, ErrorNoteHashContext, true) = .empty;4363 var notes: std.array_hash_map.Custom(ErrorBundle.ErrorMessage, void, ErrorNoteHashContext, true) = .empty;
4364 defer notes.deinit(gpa);4364 defer notes.deinit(gpa);
43654365
4366 var last_note_loc: ?std.zig.Loc = null;4366 var last_note_loc: ?std.zig.Loc = null;
...@@ -4831,7 +4831,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {...@@ -4831,7 +4831,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
4831 var buffer: [1024]u8 = undefined;4831 var buffer: [1024]u8 = undefined;
4832 var tar_file_writer = tar_file.writer(io, &buffer);4832 var tar_file_writer = tar_file.writer(io, &buffer);
48334833
4834 var seen_table: std.AutoArrayHashMapUnmanaged(*Package.Module, []const u8) = .empty;4834 var seen_table: std.array_hash_map.Auto(*Package.Module, []const u8) = .empty;
4835 defer seen_table.deinit(comp.gpa);4835 defer seen_table.deinit(comp.gpa);
48364836
4837 try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name);4837 try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name);
src/InternPool.zig+13-13
...@@ -41,22 +41,22 @@ tid_shift_32: if (single_threaded) u0 else std.math.Log2Int(u32),...@@ -41,22 +41,22 @@ tid_shift_32: if (single_threaded) u0 else std.math.Log2Int(u32),
41/// * For a `func`, this is the source of the full function signature.41/// * For a `func`, this is the source of the full function signature.
42/// These are also invalidated if tracking fails for this instruction.42/// These are also invalidated if tracking fails for this instruction.
43/// Value is index into `dep_entries` of the first dependency on this hash.43/// Value is index into `dep_entries` of the first dependency on this hash.
44src_hash_deps: std.AutoArrayHashMapUnmanaged(TrackedInst.Index, DepEntry.Index),44src_hash_deps: std.array_hash_map.Auto(TrackedInst.Index, DepEntry.Index),
45/// Dependencies on the value of a Nav.45/// Dependencies on the value of a Nav.
46/// Value is index into `dep_entries` of the first dependency on this Nav value.46/// Value is index into `dep_entries` of the first dependency on this Nav value.
47nav_val_deps: std.AutoArrayHashMapUnmanaged(Nav.Index, DepEntry.Index),47nav_val_deps: std.array_hash_map.Auto(Nav.Index, DepEntry.Index),
48/// Dependencies on the type of a Nav.48/// Dependencies on the type of a Nav.
49/// Value is index into `dep_entries` of the first dependency on this Nav value.49/// Value is index into `dep_entries` of the first dependency on this Nav value.
50nav_ty_deps: std.AutoArrayHashMapUnmanaged(Nav.Index, DepEntry.Index),50nav_ty_deps: std.array_hash_map.Auto(Nav.Index, DepEntry.Index),
51/// Dependencies on a function's inferred error set. Key is the function body, not the IES.51/// Dependencies on a function's inferred error set. Key is the function body, not the IES.
52/// Value is index into `dep_entries` of the first dependency on this function's IES.52/// Value is index into `dep_entries` of the first dependency on this function's IES.
53func_ies_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),53func_ies_deps: std.array_hash_map.Auto(Index, DepEntry.Index),
54/// Dependencies on the resolved layout of a `struct`, `union`, or `enum` type.54/// Dependencies on the resolved layout of a `struct`, `union`, or `enum` type.
55/// Value is index into `dep_entries` of the first dependency on this type's layout.55/// Value is index into `dep_entries` of the first dependency on this type's layout.
56type_layout_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),56type_layout_deps: std.array_hash_map.Auto(Index, DepEntry.Index),
57/// Dependencies on the resolved default field values of a `struct` type.57/// Dependencies on the resolved default field values of a `struct` type.
58/// Value is index into `dep_entries` of the first dependency on this type's inits.58/// Value is index into `dep_entries` of the first dependency on this type's inits.
59struct_defaults_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),59struct_defaults_deps: std.array_hash_map.Auto(Index, DepEntry.Index),
60/// Dependencies on a Zig or ZON source file. Triggered by `@import`.60/// Dependencies on a Zig or ZON source file. Triggered by `@import`.
61/// * For ZON source files, the dependency is invalidated if the file changes at all. The `@import`61/// * For ZON source files, the dependency is invalidated if the file changes at all. The `@import`
62/// must be re-analyzed to return the new data structure.62/// must be re-analyzed to return the new data structure.
...@@ -64,18 +64,18 @@ struct_defaults_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),...@@ -64,18 +64,18 @@ struct_defaults_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),
64/// (which can only happen because the `.main_struct_inst` got lost). The `@import` must be64/// (which can only happen because the `.main_struct_inst` got lost). The `@import` must be
65/// re-analyzed to return the new type.65/// re-analyzed to return the new type.
66/// Value is index into `dep_entries` of the first dependency on this Zig/ZON file.66/// Value is index into `dep_entries` of the first dependency on this Zig/ZON file.
67source_file_deps: std.AutoArrayHashMapUnmanaged(FileIndex, DepEntry.Index),67source_file_deps: std.array_hash_map.Auto(FileIndex, DepEntry.Index),
68/// Dependencies on an embedded file.68/// Dependencies on an embedded file.
69/// Introduced by `@embedFile`; invalidated when the file changes.69/// Introduced by `@embedFile`; invalidated when the file changes.
70/// Value is index into `dep_entries` of the first dependency on this `Zcu.EmbedFile`.70/// Value is index into `dep_entries` of the first dependency on this `Zcu.EmbedFile`.
71embed_file_deps: std.AutoArrayHashMapUnmanaged(Zcu.EmbedFile.Index, DepEntry.Index),71embed_file_deps: std.array_hash_map.Auto(Zcu.EmbedFile.Index, DepEntry.Index),
72/// Dependencies on the full set of names in a ZIR namespace.72/// Dependencies on the full set of names in a ZIR namespace.
73/// Key refers to a `struct_decl`, `union_decl`, etc.73/// Key refers to a `struct_decl`, `union_decl`, etc.
74/// Value is index into `dep_entries` of the first dependency on this namespace.74/// Value is index into `dep_entries` of the first dependency on this namespace.
75namespace_deps: std.AutoArrayHashMapUnmanaged(TrackedInst.Index, DepEntry.Index),75namespace_deps: std.array_hash_map.Auto(TrackedInst.Index, DepEntry.Index),
76/// Dependencies on the (non-)existence of some name in a namespace.76/// Dependencies on the (non-)existence of some name in a namespace.
77/// Value is index into `dep_entries` of the first dependency on this name.77/// Value is index into `dep_entries` of the first dependency on this name.
78namespace_name_deps: std.AutoArrayHashMapUnmanaged(NamespaceNameKey, DepEntry.Index),78namespace_name_deps: std.array_hash_map.Auto(NamespaceNameKey, DepEntry.Index),
79// Dependencies on the value of fields memoized on `Zcu` (`panic_messages` etc).79// Dependencies on the value of fields memoized on `Zcu` (`panic_messages` etc).
80// If set, these are indices into `dep_entries` of the first dependency on this state.80// If set, these are indices into `dep_entries` of the first dependency on this state.
81memoized_state_main_deps: DepEntry.Index.Optional,81memoized_state_main_deps: DepEntry.Index.Optional,
...@@ -86,7 +86,7 @@ memoized_state_assembly_deps: DepEntry.Index.Optional,...@@ -86,7 +86,7 @@ memoized_state_assembly_deps: DepEntry.Index.Optional,
86/// Given a `Depender`, points to an entry in `dep_entries` whose `depender`86/// Given a `Depender`, points to an entry in `dep_entries` whose `depender`
87/// matches. The `next_dependee` field can be used to iterate all such entries87/// matches. The `next_dependee` field can be used to iterate all such entries
88/// and remove them from the corresponding lists.88/// and remove them from the corresponding lists.
89first_dependency: std.AutoArrayHashMapUnmanaged(AnalUnit, DepEntry.Index),89first_dependency: std.array_hash_map.Auto(AnalUnit, DepEntry.Index),
9090
91/// Stores dependency information. The hashmaps declared above are used to look91/// Stores dependency information. The hashmaps declared above are used to look
92/// up entries in this list as required. This is not stored in `extra` so that92/// up entries in this list as required. This is not stored in `extra` so that
...@@ -1587,7 +1587,7 @@ fn getIndexMask(ip: *const InternPool, comptime BackingInt: type) u32 {...@@ -1587,7 +1587,7 @@ fn getIndexMask(ip: *const InternPool, comptime BackingInt: type) u32 {
1587 return @as(u32, std.math.maxInt(BackingInt)) >> ip.tid_width;1587 return @as(u32, std.math.maxInt(BackingInt)) >> ip.tid_width;
1588}1588}
15891589
1590const FieldMap = std.ArrayHashMapUnmanaged(void, void, std.array_hash_map.AutoContext(void), false);1590const FieldMap = std.array_hash_map.Custom(void, void, std.array_hash_map.AutoContext(void), false);
15911591
1592/// An index into `maps` which might be `none`.1592/// An index into `maps` which might be `none`.
1593pub const OptionalMapIndex = enum(u32) {1593pub const OptionalMapIndex = enum(u32) {
...@@ -11039,7 +11039,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator,...@@ -11039,7 +11039,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator,
11039 defer arena_allocator.deinit();11039 defer arena_allocator.deinit();
11040 const arena = arena_allocator.allocator();11040 const arena = arena_allocator.allocator();
1104111041
11042 var instances: std.AutoArrayHashMapUnmanaged(Index, std.ArrayList(Index)) = .empty;11042 var instances: std.array_hash_map.Auto(Index, std.ArrayList(Index)) = .empty;
11043 for (ip.locals, 0..) |*local, tid| {11043 for (ip.locals, 0..) |*local, tid| {
11044 const items = local.shared.items.view().slice();11044 const items = local.shared.items.view().slice();
11045 const extra_list = local.shared.extra;11045 const extra_list = local.shared.extra;
src/Package/Fetch.zig+5-5
...@@ -162,9 +162,9 @@ pub const JobQueue = struct {...@@ -162,9 +162,9 @@ pub const JobQueue = struct {
162 /// Both non-lazy and lazy dependencies are always fetched.162 /// Both non-lazy and lazy dependencies are always fetched.
163 all,163 all,
164 };164 };
165 pub const Table = std.AutoArrayHashMapUnmanaged(Package.Hash, *Fetch);165 pub const Table = std.array_hash_map.Auto(Package.Hash, *Fetch);
166 pub const UnlazySet = std.AutoArrayHashMapUnmanaged(Package.Hash, void);166 pub const UnlazySet = std.array_hash_map.Auto(Package.Hash, void);
167 pub const ForkSet = std.ArrayHashMapUnmanaged(Fork, void, Fork.Context, false);167 pub const ForkSet = std.array_hash_map.Custom(Fork, void, Fork.Context, false);
168168
169 pub const Fork = struct {169 pub const Fork = struct {
170 path: Cache.Path,170 path: Cache.Path,
...@@ -1725,7 +1725,7 @@ fn computeHash(f: *Fetch, pkg_path: Cache.Path, filter: Filter) RunError!Compute...@@ -1725,7 +1725,7 @@ fn computeHash(f: *Fetch, pkg_path: Cache.Path, filter: Filter) RunError!Compute
17251725
1726 // Track directories which had any files deleted from them so that empty directories1726 // Track directories which had any files deleted from them so that empty directories
1727 // can be deleted.1727 // can be deleted.
1728 var sus_dirs: std.StringArrayHashMapUnmanaged(void) = .empty;1728 var sus_dirs: std.array_hash_map.String(void) = .empty;
1729 defer sus_dirs.deinit(gpa);1729 defer sus_dirs.deinit(gpa);
17301730
1731 var walker = try root_dir.walk(gpa);1731 var walker = try root_dir.walk(gpa);
...@@ -2002,7 +2002,7 @@ fn normalizePath(bytes: []u8) void {...@@ -2002,7 +2002,7 @@ fn normalizePath(bytes: []u8) void {
2002}2002}
20032003
2004const Filter = struct {2004const Filter = struct {
2005 include_paths: std.StringArrayHashMapUnmanaged(void) = .empty,2005 include_paths: std.array_hash_map.String(void) = .empty,
20062006
2007 /// sub_path is relative to the package root.2007 /// sub_path is relative to the package root.
2008 pub fn includePath(self: *const Filter, sub_path: []const u8) bool {2008 pub fn includePath(self: *const Filter, sub_path: []const u8) bool {
src/Package/Manifest.zig+4-4
...@@ -42,9 +42,9 @@ name: []const u8,...@@ -42,9 +42,9 @@ name: []const u8,
42id: u32,42id: u32,
43version: std.SemanticVersion,43version: std.SemanticVersion,
44version_node: Ast.Node.Index,44version_node: Ast.Node.Index,
45dependencies: std.StringArrayHashMapUnmanaged(Dependency),45dependencies: std.array_hash_map.String(Dependency),
46dependencies_node: Ast.Node.OptionalIndex,46dependencies_node: Ast.Node.OptionalIndex,
47paths: std.StringArrayHashMapUnmanaged(void),47paths: std.array_hash_map.String(void),
48minimum_zig_version: ?std.SemanticVersion,48minimum_zig_version: ?std.SemanticVersion,
4949
50errors: []ErrorMessage,50errors: []ErrorMessage,
...@@ -144,9 +144,9 @@ const Parse = struct {...@@ -144,9 +144,9 @@ const Parse = struct {
144 id: u32,144 id: u32,
145 version: std.SemanticVersion,145 version: std.SemanticVersion,
146 version_node: Ast.Node.Index,146 version_node: Ast.Node.Index,
147 dependencies: std.StringArrayHashMapUnmanaged(Dependency),147 dependencies: std.array_hash_map.String(Dependency),
148 dependencies_node: Ast.Node.OptionalIndex,148 dependencies_node: Ast.Node.OptionalIndex,
149 paths: std.StringArrayHashMapUnmanaged(void),149 paths: std.array_hash_map.String(void),
150 allow_missing_paths_field: bool,150 allow_missing_paths_field: bool,
151 minimum_zig_version: ?std.SemanticVersion,151 minimum_zig_version: ?std.SemanticVersion,
152152
src/Package/Module.zig+2-2
...@@ -35,11 +35,11 @@ cc_argv: []const []const u8,...@@ -35,11 +35,11 @@ cc_argv: []const []const u8,
35structured_cfg: bool,35structured_cfg: bool,
36no_builtin: bool,36no_builtin: bool,
3737
38pub const Deps = std.StringArrayHashMapUnmanaged(*Module);38pub const Deps = std.array_hash_map.String(*Module);
3939
40pub const Tree = struct {40pub const Tree = struct {
41 /// Each `Package` exposes a `Module` with build.zig as its root source file.41 /// Each `Package` exposes a `Module` with build.zig as its root source file.
42 build_module_table: std.AutoArrayHashMapUnmanaged(MultiHashHexDigest, *Module),42 build_module_table: std.array_hash_map.Auto(MultiHashHexDigest, *Module),
43};43};
4444
45pub const CreateOptions = struct {45pub const CreateOptions = struct {
src/Sema.zig+6-6
...@@ -88,7 +88,7 @@ err: ?*Zcu.ErrorMsg = null,...@@ -88,7 +88,7 @@ err: ?*Zcu.ErrorMsg = null,
8888
89/// The temporary arena is used for the memory of the `InferredAlloc` values89/// The temporary arena is used for the memory of the `InferredAlloc` values
90/// here so the values can be dropped without any cleanup.90/// here so the values can be dropped without any cleanup.
91unresolved_inferred_allocs: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InferredAlloc) = .empty,91unresolved_inferred_allocs: std.array_hash_map.Auto(Air.Inst.Index, InferredAlloc) = .empty,
9292
93/// Links every pointer derived from a base `alloc` back to that `alloc`. Used93/// Links every pointer derived from a base `alloc` back to that `alloc`. Used
94/// to detect comptime-known `const`s.94/// to detect comptime-known `const`s.
...@@ -119,13 +119,13 @@ exports: std.ArrayList(Zcu.Export) = .empty,...@@ -119,13 +119,13 @@ exports: std.ArrayList(Zcu.Export) = .empty,
119/// All references registered so far by this `Sema`. This is a temporary duplicate119/// All references registered so far by this `Sema`. This is a temporary duplicate
120/// of data stored in `Zcu.all_references`. It exists to avoid adding references to120/// of data stored in `Zcu.all_references`. It exists to avoid adding references to
121/// a given `AnalUnit` multiple times.121/// a given `AnalUnit` multiple times.
122references: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,122references: std.array_hash_map.Auto(AnalUnit, void) = .empty,
123type_references: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,123type_references: std.array_hash_map.Auto(InternPool.Index, void) = .empty,
124124
125/// All dependencies registered so far by this `Sema`. This is a temporary duplicate125/// All dependencies registered so far by this `Sema`. This is a temporary duplicate
126/// of the main dependency data. It exists to avoid adding dependencies to a given126/// of the main dependency data. It exists to avoid adding dependencies to a given
127/// `AnalUnit` multiple times.127/// `AnalUnit` multiple times.
128dependencies: std.AutoArrayHashMapUnmanaged(InternPool.Dependee, void) = .empty,128dependencies: std.array_hash_map.Auto(InternPool.Dependee, void) = .empty,
129129
130/// Whether memoization of this call is permitted. Operations with side effects global130/// Whether memoization of this call is permitted. Operations with side effects global
131/// to the `Sema`, such as `@setEvalBranchQuota`, set this to `false`. It is observed131/// to the `Sema`, such as `@setEvalBranchQuota`, set this to `false`. It is observed
...@@ -212,11 +212,11 @@ pub const InferredErrorSet = struct {...@@ -212,11 +212,11 @@ pub const InferredErrorSet = struct {
212 /// are returned from any dependent functions.212 /// are returned from any dependent functions.
213 errors: NameMap = .{},213 errors: NameMap = .{},
214 /// Other inferred error sets which this inferred error set should include.214 /// Other inferred error sets which this inferred error set should include.
215 inferred_error_sets: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,215 inferred_error_sets: std.array_hash_map.Auto(InternPool.Index, void) = .empty,
216 /// The regular error set created by resolving this inferred error set.216 /// The regular error set created by resolving this inferred error set.
217 resolved: InternPool.Index = .none,217 resolved: InternPool.Index = .none,
218218
219 pub const NameMap = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, void);219 pub const NameMap = std.array_hash_map.Auto(InternPool.NullTerminatedString, void);
220220
221 pub fn addErrorSet(221 pub fn addErrorSet(
222 self: *InferredErrorSet,222 self: *InferredErrorSet,
src/Type.zig+3-3
...@@ -3340,7 +3340,7 @@ pub fn assertHasLayout(ty: Type, zcu: *const Zcu) void {...@@ -3340,7 +3340,7 @@ pub fn assertHasLayout(ty: Type, zcu: *const Zcu) void {
3340}3340}
33413341
3342/// Recursively walks the type and marks for each subtype how many times it has been seen3342/// Recursively walks the type and marks for each subtype how many times it has been seen
3343fn collectSubtypes(ty: Type, pt: Zcu.PerThread, visited: *std.AutoArrayHashMapUnmanaged(Type, u16)) error{OutOfMemory}!void {3343fn collectSubtypes(ty: Type, pt: Zcu.PerThread, visited: *std.array_hash_map.Auto(Type, u16)) error{OutOfMemory}!void {
3344 const zcu = pt.zcu;3344 const zcu = pt.zcu;
3345 const ip = &zcu.intern_pool;3345 const ip = &zcu.intern_pool;
33463346
...@@ -3455,8 +3455,8 @@ fn shouldDedupeType(ty: Type, ctx: *Comparison, pt: Zcu.PerThread) error{OutOfMe...@@ -3455,8 +3455,8 @@ fn shouldDedupeType(ty: Type, ctx: *Comparison, pt: Zcu.PerThread) error{OutOfMe
3455/// the subtype length and number of occurences. Placeholders are then found by3455/// the subtype length and number of occurences. Placeholders are then found by
3456/// iterating `type_dedupe_cache` which caches the inline/placeholder decisions.3456/// iterating `type_dedupe_cache` which caches the inline/placeholder decisions.
3457pub const Comparison = struct {3457pub const Comparison = struct {
3458 type_occurrences: std.AutoArrayHashMapUnmanaged(Type, u16),3458 type_occurrences: std.array_hash_map.Auto(Type, u16),
3459 type_dedupe_cache: std.AutoArrayHashMapUnmanaged(Type, DedupeEntry),3459 type_dedupe_cache: std.array_hash_map.Auto(Type, DedupeEntry),
3460 placeholder_index: u8,3460 placeholder_index: u8,
34613461
3462 pub const Placeholder = struct {3462 pub const Placeholder = struct {
src/Zcu.zig+37-37
...@@ -97,20 +97,20 @@ free_exports: std.ArrayList(Export.Index) = .empty,...@@ -97,20 +97,20 @@ free_exports: std.ArrayList(Export.Index) = .empty,
97/// Maps from an `AnalUnit` which performs a single export, to the index into `all_exports` of97/// Maps from an `AnalUnit` which performs a single export, to the index into `all_exports` of
98/// the export it performs. Note that the key is not the `Decl` being exported, but the `AnalUnit`98/// the export it performs. Note that the key is not the `Decl` being exported, but the `AnalUnit`
99/// whose analysis triggered the export.99/// whose analysis triggered the export.
100single_exports: std.AutoArrayHashMapUnmanaged(AnalUnit, Export.Index) = .empty,100single_exports: std.array_hash_map.Auto(AnalUnit, Export.Index) = .empty,
101/// Like `single_exports`, but for `AnalUnit`s which perform multiple exports.101/// Like `single_exports`, but for `AnalUnit`s which perform multiple exports.
102/// The exports are `all_exports.items[index..][0..len]`.102/// The exports are `all_exports.items[index..][0..len]`.
103multi_exports: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct {103multi_exports: std.array_hash_map.Auto(AnalUnit, extern struct {
104 index: u32,104 index: u32,
105 len: u32,105 len: u32,
106}) = .{},106}) = .{},
107107
108/// Key is the digest returned by `Builtin.hash`; value is the corresponding module.108/// Key is the digest returned by `Builtin.hash`; value is the corresponding module.
109builtin_modules: std.AutoArrayHashMapUnmanaged(Cache.BinDigest, *Package.Module) = .empty,109builtin_modules: std.array_hash_map.Auto(Cache.BinDigest, *Package.Module) = .empty,
110110
111/// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones.111/// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones.
112/// Modules whose root file is not a Zig or ZON file have the value `.none`.112/// Modules whose root file is not a Zig or ZON file have the value `.none`.
113module_roots: std.AutoArrayHashMapUnmanaged(*Package.Module, File.Index.Optional) = .empty,113module_roots: std.array_hash_map.Auto(*Package.Module, File.Index.Optional) = .empty,
114114
115/// The set of all the Zig source files in the Zig Compilation Unit. Tracked in115/// The set of all the Zig source files in the Zig Compilation Unit. Tracked in
116/// order to iterate over it and check which source files have been modified on116/// order to iterate over it and check which source files have been modified on
...@@ -125,7 +125,7 @@ module_roots: std.AutoArrayHashMapUnmanaged(*Package.Module, File.Index.Optional...@@ -125,7 +125,7 @@ module_roots: std.AutoArrayHashMapUnmanaged(*Package.Module, File.Index.Optional
125///125///
126/// Not serialized. This state is reconstructed during the first call to126/// Not serialized. This state is reconstructed during the first call to
127/// `Compilation.update` of the process for a given `Compilation`.127/// `Compilation.update` of the process for a given `Compilation`.
128import_table: std.ArrayHashMapUnmanaged(128import_table: std.array_hash_map.Custom(
129 File.Index,129 File.Index,
130 void,130 void,
131 struct {131 struct {
...@@ -141,7 +141,7 @@ import_table: std.ArrayHashMapUnmanaged(...@@ -141,7 +141,7 @@ import_table: std.ArrayHashMapUnmanaged(
141/// update removes an import, or if a module specified on the CLI is never imported.141/// update removes an import, or if a module specified on the CLI is never imported.
142/// Reconstructed on every update, after AstGen and before Sema.142/// Reconstructed on every update, after AstGen and before Sema.
143/// Value is why the file is alive.143/// Value is why the file is alive.
144alive_files: std.AutoArrayHashMapUnmanaged(File.Index, File.Reference) = .empty,144alive_files: std.array_hash_map.Auto(File.Index, File.Reference) = .empty,
145145
146/// If this is populated, a "file exists in multiple modules" error should be emitted.146/// If this is populated, a "file exists in multiple modules" error should be emitted.
147/// This causes file errors to not be shown, because we don't really know which files147/// This causes file errors to not be shown, because we don't really know which files
...@@ -162,7 +162,7 @@ multi_module_err: ?struct {...@@ -162,7 +162,7 @@ multi_module_err: ?struct {
162/// on the `Compilation.Path` of the `EmbedFile`.162/// on the `Compilation.Path` of the `EmbedFile`.
163///163///
164/// This table owns all of the `*EmbedFile` memory, which is allocated into gpa.164/// This table owns all of the `*EmbedFile` memory, which is allocated into gpa.
165embed_table: std.ArrayHashMapUnmanaged(165embed_table: std.array_hash_map.Custom(
166 *EmbedFile,166 *EmbedFile,
167 void,167 void,
168 struct {168 struct {
...@@ -179,27 +179,27 @@ intern_pool: InternPool = .empty,...@@ -179,27 +179,27 @@ intern_pool: InternPool = .empty,
179179
180/// Value explains why this `AnalUnit` is being analyzed. It is `null` for the topmost analysis180/// Value explains why this `AnalUnit` is being analyzed. It is `null` for the topmost analysis
181/// (index 0), and non-`null` for all others.181/// (index 0), and non-`null` for all others.
182analysis_in_progress: std.AutoArrayHashMapUnmanaged(AnalUnit, ?*const DependencyReason) = .empty,182analysis_in_progress: std.array_hash_map.Auto(AnalUnit, ?*const DependencyReason) = .empty,
183/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.183/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.
184failed_analysis: std.AutoArrayHashMapUnmanaged(AnalUnit, *ErrorMsg) = .empty,184failed_analysis: std.array_hash_map.Auto(AnalUnit, *ErrorMsg) = .empty,
185/// This `AnalUnit` failed semantic analysis because it required analysis of another `AnalUnit` which itself failed.185/// This `AnalUnit` failed semantic analysis because it required analysis of another `AnalUnit` which itself failed.
186transitive_failed_analysis: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,186transitive_failed_analysis: std.array_hash_map.Auto(AnalUnit, void) = .empty,
187/// This `Nav` succeeded analysis, but failed codegen.187/// This `Nav` succeeded analysis, but failed codegen.
188/// This may be a simple "value" `Nav`, or it may be a function.188/// This may be a simple "value" `Nav`, or it may be a function.
189/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.189/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.
190/// While multiple threads are active (most of the time!), this is guarded by `zcu.comp.mutex`, as190/// While multiple threads are active (most of the time!), this is guarded by `zcu.comp.mutex`, as
191/// codegen and linking run on a separate thread.191/// codegen and linking run on a separate thread.
192failed_codegen: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, *ErrorMsg) = .empty,192failed_codegen: std.array_hash_map.Auto(InternPool.Nav.Index, *ErrorMsg) = .empty,
193failed_types: std.AutoArrayHashMapUnmanaged(InternPool.Index, *ErrorMsg) = .empty,193failed_types: std.array_hash_map.Auto(InternPool.Index, *ErrorMsg) = .empty,
194194
195/// Key is an `AnalUnit` which is in `dependency_loop_nodes`. For each dependency loop, exactly one195/// Key is an `AnalUnit` which is in `dependency_loop_nodes`. For each dependency loop, exactly one
196/// unit in the loop is in this map, though the choice is arbitrary and not necessarily reproducible196/// unit in the loop is in this map, though the choice is arbitrary and not necessarily reproducible
197/// between compilations. So, instead of (for instance) defining where the dependency loop "starts",197/// between compilations. So, instead of (for instance) defining where the dependency loop "starts",
198/// this map simply exists to allow easily iterating all dependency loops exactly once.198/// this map simply exists to allow easily iterating all dependency loops exactly once.
199dependency_loops: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,199dependency_loops: std.array_hash_map.Auto(AnalUnit, void) = .empty,
200/// Key is an `AnalUnit`, value is the `AnalUnit` which the key references and why it does so.200/// Key is an `AnalUnit`, value is the `AnalUnit` which the key references and why it does so.
201/// All units in here form loops. To iterate loops, see `dependency_loops`.201/// All units in here form loops. To iterate loops, see `dependency_loops`.
202dependency_loop_nodes: std.AutoArrayHashMapUnmanaged(AnalUnit, struct {202dependency_loop_nodes: std.array_hash_map.Auto(AnalUnit, struct {
203 unit: AnalUnit,203 unit: AnalUnit,
204 reason: DependencyReason,204 reason: DependencyReason,
205}) = .empty,205}) = .empty,
...@@ -207,7 +207,7 @@ dependency_loop_nodes: std.AutoArrayHashMapUnmanaged(AnalUnit, struct {...@@ -207,7 +207,7 @@ dependency_loop_nodes: std.AutoArrayHashMapUnmanaged(AnalUnit, struct {
207/// Keep track of `@compileLog`s per `AnalUnit`.207/// Keep track of `@compileLog`s per `AnalUnit`.
208/// We track the source location of the first `@compileLog` call, and all logged lines as a linked list.208/// We track the source location of the first `@compileLog` call, and all logged lines as a linked list.
209/// The list is singly linked, but we do track its tail for fast appends (optimizing many logs in one unit).209/// The list is singly linked, but we do track its tail for fast appends (optimizing many logs in one unit).
210compile_logs: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct {210compile_logs: std.array_hash_map.Auto(AnalUnit, extern struct {
211 base_node_inst: InternPool.TrackedInst.Index,211 base_node_inst: InternPool.TrackedInst.Index,
212 node_offset: Ast.Node.Offset,212 node_offset: Ast.Node.Offset,
213 first_line: CompileLogLine.Index,213 first_line: CompileLogLine.Index,
...@@ -228,7 +228,7 @@ free_compile_log_lines: std.ArrayList(CompileLogLine.Index) = .empty,...@@ -228,7 +228,7 @@ free_compile_log_lines: std.ArrayList(CompileLogLine.Index) = .empty,
228/// We just store a `[]u8` instead of a full `*ErrorMsg`, because the source228/// We just store a `[]u8` instead of a full `*ErrorMsg`, because the source
229/// location is always the entire file. The `[]u8` memory is owned by the map229/// location is always the entire file. The `[]u8` memory is owned by the map
230/// and allocated into `gpa`.230/// and allocated into `gpa`.
231failed_files: std.AutoArrayHashMapUnmanaged(File.Index, ?[]u8) = .empty,231failed_files: std.array_hash_map.Auto(File.Index, ?[]u8) = .empty,
232/// AstGen is not aware of modules, and so cannot determine whether an import232/// AstGen is not aware of modules, and so cannot determine whether an import
233/// string makes sense. That is the job of a traversal after AstGen.233/// string makes sense. That is the job of a traversal after AstGen.
234///234///
...@@ -256,10 +256,10 @@ failed_imports: std.ArrayList(struct {...@@ -256,10 +256,10 @@ failed_imports: std.ArrayList(struct {
256 import_token: Ast.TokenIndex,256 import_token: Ast.TokenIndex,
257 kind: enum { file_outside_module_root, illegal_zig_import },257 kind: enum { file_outside_module_root, illegal_zig_import },
258}) = .empty,258}) = .empty,
259failed_exports: std.AutoArrayHashMapUnmanaged(Export.Index, *ErrorMsg) = .empty,259failed_exports: std.array_hash_map.Auto(Export.Index, *ErrorMsg) = .empty,
260/// If analysis failed due to a cimport error, the corresponding Clang errors260/// If analysis failed due to a cimport error, the corresponding Clang errors
261/// are stored here.261/// are stored here.
262cimport_errors: std.AutoArrayHashMapUnmanaged(AnalUnit, std.zig.ErrorBundle) = .empty,262cimport_errors: std.array_hash_map.Auto(AnalUnit, std.zig.ErrorBundle) = .empty,
263263
264/// Maximum amount of distinct error values, set by --error-limit264/// Maximum amount of distinct error values, set by --error-limit
265error_limit: ErrorInt,265error_limit: ErrorInt,
...@@ -271,19 +271,19 @@ outdated_lock: if (std.debug.runtime_safety) std.Io.RwLock else void = if (std.d...@@ -271,19 +271,19 @@ outdated_lock: if (std.debug.runtime_safety) std.Io.RwLock else void = if (std.d
271/// Value is the number of PO dependencies of this AnalUnit.271/// Value is the number of PO dependencies of this AnalUnit.
272/// This value will decrease as we perform semantic analysis to learn what is outdated.272/// This value will decrease as we perform semantic analysis to learn what is outdated.
273/// If any of these PO deps is outdated, this value will be moved to `outdated`.273/// If any of these PO deps is outdated, this value will be moved to `outdated`.
274potentially_outdated: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,274potentially_outdated: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
275/// Value is the number of PO dependencies of this AnalUnit.275/// Value is the number of PO dependencies of this AnalUnit.
276/// Once this value drops to 0, the AnalUnit is a candidate for re-analysis.276/// Once this value drops to 0, the AnalUnit is a candidate for re-analysis.
277outdated: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,277outdated: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
278/// This is the set of all `AnalUnit`s in `outdated` whose PO dependency count is 0.278/// This is the set of all `AnalUnit`s in `outdated` whose PO dependency count is 0.
279/// Such `AnalUnit`s are ready for immediate re-analysis.279/// Such `AnalUnit`s are ready for immediate re-analysis.
280/// See `findOutdatedToAnalyze` for details.280/// See `findOutdatedToAnalyze` for details.
281outdated_ready: struct {281outdated_ready: struct {
282 /// These are separate from other units because it allows `findOutdatedToAnalyze` to prioritize282 /// These are separate from other units because it allows `findOutdatedToAnalyze` to prioritize
283 /// functions, which is useful because it means they will be sent to codegen more quickly.283 /// functions, which is useful because it means they will be sent to codegen more quickly.
284 funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),284 funcs: std.array_hash_map.Auto(InternPool.Index, void),
285 /// Does not contain `.func` units.285 /// Does not contain `.func` units.
286 other: std.AutoArrayHashMapUnmanaged(AnalUnit, void),286 other: std.array_hash_map.Auto(AnalUnit, void),
287} = .{ .funcs = .empty, .other = .empty },287} = .{ .funcs = .empty, .other = .empty },
288/// This contains a list of AnalUnit whose analysis or codegen failed, but the288/// This contains a list of AnalUnit whose analysis or codegen failed, but the
289/// failure was something like running out of disk space, and trying again may289/// failure was something like running out of disk space, and trying again may
...@@ -298,23 +298,23 @@ analysis_roots_len: usize = 0,...@@ -298,23 +298,23 @@ analysis_roots_len: usize = 0,
298/// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and298/// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and
299/// reset to `null` when any semantic analysis occurs (since this invalidates the data).299/// reset to `null` when any semantic analysis occurs (since this invalidates the data).
300/// Allocated into `gpa`.300/// Allocated into `gpa`.
301resolved_references: ?std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) = null,301resolved_references: ?std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) = null,
302302
303/// If `true`, then semantic analysis must not occur on this update due to AstGen errors.303/// If `true`, then semantic analysis must not occur on this update due to AstGen errors.
304/// Essentially the entire pipeline after AstGen, including Sema, codegen, and link, is skipped.304/// Essentially the entire pipeline after AstGen, including Sema, codegen, and link, is skipped.
305/// Reset to `false` at the start of each update in `Compilation.update`.305/// Reset to `false` at the start of each update in `Compilation.update`.
306skip_analysis_this_update: bool = false,306skip_analysis_this_update: bool = false,
307307
308test_functions: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,308test_functions: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
309309
310global_assembly: std.AutoArrayHashMapUnmanaged(AnalUnit, []u8) = .empty,310global_assembly: std.array_hash_map.Auto(AnalUnit, []u8) = .empty,
311311
312/// Key is the `AnalUnit` *performing* the reference. This representation allows312/// Key is the `AnalUnit` *performing* the reference. This representation allows
313/// incremental updates to quickly delete references caused by a specific `AnalUnit`.313/// incremental updates to quickly delete references caused by a specific `AnalUnit`.
314/// Value is index into `all_references` of the first reference triggered by the unit.314/// Value is index into `all_references` of the first reference triggered by the unit.
315/// The `next` field on the `Reference` forms a linked list of all references315/// The `next` field on the `Reference` forms a linked list of all references
316/// triggered by the key `AnalUnit`.316/// triggered by the key `AnalUnit`.
317reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,317reference_table: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
318all_references: std.ArrayList(Reference) = .empty,318all_references: std.ArrayList(Reference) = .empty,
319/// Freelist of indices in `all_references`.319/// Freelist of indices in `all_references`.
320free_references: std.ArrayList(u32) = .empty,320free_references: std.ArrayList(u32) = .empty,
...@@ -327,7 +327,7 @@ free_inline_reference_frames: std.ArrayList(InlineReferenceFrame.Index) = .empty...@@ -327,7 +327,7 @@ free_inline_reference_frames: std.ArrayList(InlineReferenceFrame.Index) = .empty
327/// Value is index into `all_type_reference` of the first reference triggered by the unit.327/// Value is index into `all_type_reference` of the first reference triggered by the unit.
328/// The `next` field on the `TypeReference` forms a linked list of all type references328/// The `next` field on the `TypeReference` forms a linked list of all type references
329/// triggered by the key `AnalUnit`.329/// triggered by the key `AnalUnit`.
330type_reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,330type_reference_table: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
331all_type_references: std.ArrayList(TypeReference) = .empty,331all_type_references: std.ArrayList(TypeReference) = .empty,
332/// Freelist of indices in `all_type_references`.332/// Freelist of indices in `all_type_references`.
333free_type_references: std.ArrayList(u32) = .empty,333free_type_references: std.ArrayList(u32) = .empty,
...@@ -355,12 +355,12 @@ pub const DependencyReason = struct {...@@ -355,12 +355,12 @@ pub const DependencyReason = struct {
355pub const IncrementalDebugState = struct {355pub const IncrementalDebugState = struct {
356 /// All container types in the ZCU, even dead ones.356 /// All container types in the ZCU, even dead ones.
357 /// Value is the generation the type was created on.357 /// Value is the generation the type was created on.
358 types: std.AutoArrayHashMapUnmanaged(InternPool.Index, u32),358 types: std.array_hash_map.Auto(InternPool.Index, u32),
359 /// All `Nav`s in the ZCU, even dead ones.359 /// All `Nav`s in the ZCU, even dead ones.
360 /// Value is the generation the `Nav` was created on.360 /// Value is the generation the `Nav` was created on.
361 navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, u32),361 navs: std.array_hash_map.Auto(InternPool.Nav.Index, u32),
362 /// All `AnalUnit`s in the ZCU, even dead ones.362 /// All `AnalUnit`s in the ZCU, even dead ones.
363 units: std.AutoArrayHashMapUnmanaged(AnalUnit, UnitInfo),363 units: std.array_hash_map.Auto(AnalUnit, UnitInfo),
364364
365 pub const init: IncrementalDebugState = .{365 pub const init: IncrementalDebugState = .{
366 .types = .empty,366 .types = .empty,
...@@ -681,7 +681,7 @@ pub const SimplePanicId = enum {...@@ -681,7 +681,7 @@ pub const SimplePanicId = enum {
681 }681 }
682};682};
683683
684pub const GlobalErrorSet = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, void);684pub const GlobalErrorSet = std.array_hash_map.Auto(InternPool.NullTerminatedString, void);
685685
686pub const CImportError = struct {686pub const CImportError = struct {
687 offset: u32,687 offset: u32,
...@@ -840,9 +840,9 @@ pub const Namespace = struct {...@@ -840,9 +840,9 @@ pub const Namespace = struct {
840 /// Will be a struct, enum, union, or opaque.840 /// Will be a struct, enum, union, or opaque.
841 owner_type: InternPool.Index,841 owner_type: InternPool.Index,
842 /// Members of the namespace which are marked `pub`.842 /// Members of the namespace which are marked `pub`.
843 pub_decls: std.ArrayHashMapUnmanaged(InternPool.Nav.Index, void, NavNameContext, true) = .empty,843 pub_decls: std.array_hash_map.Custom(InternPool.Nav.Index, void, NavNameContext, true) = .empty,
844 /// Members of the namespace which are *not* marked `pub`.844 /// Members of the namespace which are *not* marked `pub`.
845 priv_decls: std.ArrayHashMapUnmanaged(InternPool.Nav.Index, void, NavNameContext, true) = .empty,845 priv_decls: std.array_hash_map.Custom(InternPool.Nav.Index, void, NavNameContext, true) = .empty,
846 /// All `comptime` declarations in this namespace. We store these purely so that incremental846 /// All `comptime` declarations in this namespace. We store these purely so that incremental
847 /// compilation can re-use the existing `ComptimeUnit`s when a namespace changes.847 /// compilation can re-use the existing `ComptimeUnit`s when a namespace changes.
848 comptime_decls: std.ArrayList(InternPool.ComptimeUnit.Id) = .empty,848 comptime_decls: std.ArrayList(InternPool.ComptimeUnit.Id) = .empty,
...@@ -4188,13 +4188,13 @@ pub const ResolvedReference = struct {...@@ -4188,13 +4188,13 @@ pub const ResolvedReference = struct {
4188/// If an `AnalUnit` is not in the returned map, it is unreferenced.4188/// If an `AnalUnit` is not in the returned map, it is unreferenced.
4189/// The returned hashmap is owned by the `Zcu`, so should not be freed by the caller.4189/// The returned hashmap is owned by the `Zcu`, so should not be freed by the caller.
4190/// This hashmap is cached, so repeated calls to this function are cheap.4190/// This hashmap is cached, so repeated calls to this function are cheap.
4191pub fn resolveReferences(zcu: *Zcu) Allocator.Error!*const std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) {4191pub fn resolveReferences(zcu: *Zcu) Allocator.Error!*const std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) {
4192 if (zcu.resolved_references == null) {4192 if (zcu.resolved_references == null) {
4193 zcu.resolved_references = try zcu.resolveReferencesInner();4193 zcu.resolved_references = try zcu.resolveReferencesInner();
4194 }4194 }
4195 return &zcu.resolved_references.?;4195 return &zcu.resolved_references.?;
4196}4196}
4197fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) {4197fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) {
4198 const trace = tracy.trace(@src());4198 const trace = tracy.trace(@src());
4199 defer trace.end();4199 defer trace.end();
42004200
...@@ -4202,8 +4202,8 @@ fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanag...@@ -4202,8 +4202,8 @@ fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanag
4202 const comp = zcu.comp;4202 const comp = zcu.comp;
4203 const ip = &zcu.intern_pool;4203 const ip = &zcu.intern_pool;
42044204
4205 var units: std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) = .empty;4205 var units: std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) = .empty;
4206 var types: std.AutoArrayHashMapUnmanaged(InternPool.Index, ?ResolvedReference) = .empty;4206 var types: std.array_hash_map.Auto(InternPool.Index, ?ResolvedReference) = .empty;
4207 defer {4207 defer {
4208 units.deinit(gpa);4208 units.deinit(gpa);
4209 types.deinit(gpa);4209 types.deinit(gpa);
src/Zcu/PerThread.zig+6-6
...@@ -787,7 +787,7 @@ const UpdatedFile = struct {...@@ -787,7 +787,7 @@ const UpdatedFile = struct {
787 inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index),787 inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index),
788};788};
789789
790fn cleanupUpdatedFiles(gpa: Allocator, updated_files: *std.AutoArrayHashMapUnmanaged(Zcu.File.Index, UpdatedFile)) void {790fn cleanupUpdatedFiles(gpa: Allocator, updated_files: *std.array_hash_map.Auto(Zcu.File.Index, UpdatedFile)) void {
791 for (updated_files.values()) |*elem| elem.inst_map.deinit(gpa);791 for (updated_files.values()) |*elem| elem.inst_map.deinit(gpa);
792 updated_files.deinit(gpa);792 updated_files.deinit(gpa);
793}793}
...@@ -805,7 +805,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {...@@ -805,7 +805,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {
805805
806 // We need to visit every updated File for every TrackedInst in InternPool.806 // We need to visit every updated File for every TrackedInst in InternPool.
807 // This only includes Zig files; ZON files are omitted.807 // This only includes Zig files; ZON files are omitted.
808 var updated_files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, UpdatedFile) = .empty;808 var updated_files: std.array_hash_map.Auto(Zcu.File.Index, UpdatedFile) = .empty;
809 defer cleanupUpdatedFiles(gpa, &updated_files);809 defer cleanupUpdatedFiles(gpa, &updated_files);
810810
811 for (zcu.import_table.keys()) |file_index| {811 for (zcu.import_table.keys()) |file_index| {
...@@ -907,7 +907,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {...@@ -907,7 +907,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {
907 if (!has_namespace) continue;907 if (!has_namespace) continue;
908908
909 // Value is whether the declaration is `pub`.909 // Value is whether the declaration is `pub`.
910 var old_names: std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, bool) = .empty;910 var old_names: std.array_hash_map.Auto(InternPool.NullTerminatedString, bool) = .empty;
911 defer old_names.deinit(zcu.gpa);911 defer old_names.deinit(zcu.gpa);
912 for (old_zir.typeDecls(old_inst)) |decl_inst| {912 for (old_zir.typeDecls(old_inst)) |decl_inst| {
913 const old_decl = old_zir.getDeclaration(decl_inst);913 const old_decl = old_zir.getDeclaration(decl_inst);
...@@ -3568,8 +3568,8 @@ pub fn processExports(pt: Zcu.PerThread) !void {...@@ -3568,8 +3568,8 @@ pub fn processExports(pt: Zcu.PerThread) !void {
3568 }3568 }
35693569
3570 // First, construct a mapping of every exported value and Nav to the indices of all its different exports.3570 // First, construct a mapping of every exported value and Nav to the indices of all its different exports.
3571 var nav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, std.ArrayList(Zcu.Export.Index)) = .empty;3571 var nav_exports: std.array_hash_map.Auto(InternPool.Nav.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
3572 var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty;3572 var uav_exports: std.array_hash_map.Auto(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
3573 defer {3573 defer {
3574 for (nav_exports.values()) |*exports| {3574 for (nav_exports.values()) |*exports| {
3575 exports.deinit(gpa);3575 exports.deinit(gpa);
...@@ -3665,7 +3665,7 @@ pub fn processExports(pt: Zcu.PerThread) !void {...@@ -3665,7 +3665,7 @@ pub fn processExports(pt: Zcu.PerThread) !void {
3665 }3665 }
3666}3666}
36673667
3668const SymbolExports = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, Zcu.Export.Index);3668const SymbolExports = std.array_hash_map.Auto(InternPool.NullTerminatedString, Zcu.Export.Index);
36693669
3670fn processExportsInner(3670fn processExportsInner(
3671 pt: Zcu.PerThread,3671 pt: Zcu.PerThread,
src/codegen/aarch64/Select.zig+6-6
...@@ -4,12 +4,12 @@ air: Air,...@@ -4,12 +4,12 @@ air: Air,
4nav_index: InternPool.Nav.Index,4nav_index: InternPool.Nav.Index,
55
6// Blocks6// Blocks
7def_order: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, void),7def_order: std.array_hash_map.Auto(Air.Inst.Index, void),
8blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Block),8blocks: std.array_hash_map.Auto(Air.Inst.Index, Block),
9loops: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Loop),9loops: std.array_hash_map.Auto(Air.Inst.Index, Loop),
10active_loops: std.ArrayList(Loop.Index),10active_loops: std.ArrayList(Loop.Index),
11loop_live: struct {11loop_live: struct {
12 set: std.AutoArrayHashMapUnmanaged(struct { Loop.Index, Air.Inst.Index }, void),12 set: std.array_hash_map.Auto(struct { Loop.Index, Air.Inst.Index }, void),
13 list: std.ArrayList(Air.Inst.Index),13 list: std.ArrayList(Air.Inst.Index),
14},14},
15dom_start: u32,15dom_start: u32,
...@@ -11225,7 +11225,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {...@@ -11225,7 +11225,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
11225 defer std.debug.unlockStderr();11225 defer std.debug.unlockStderr();
11226 const stderr = &locked_stderr.file_writer.interface;11226 const stderr = &locked_stderr.file_writer.interface;
1122711227
11228 var reverse_live_values: std.AutoArrayHashMapUnmanaged(Value.Index, std.ArrayList(Air.Inst.Index)) = .empty;11228 var reverse_live_values: std.array_hash_map.Auto(Value.Index, std.ArrayList(Air.Inst.Index)) = .empty;
11229 defer {11229 defer {
11230 for (reverse_live_values.values()) |*list| list.deinit(gpa);11230 for (reverse_live_values.values()) |*list| list.deinit(gpa);
11231 reverse_live_values.deinit(gpa);11231 reverse_live_values.deinit(gpa);
...@@ -11254,7 +11254,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {...@@ -11254,7 +11254,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
11254 };11254 };
11255 }11255 }
1125611256
11257 var roots: std.AutoArrayHashMapUnmanaged(Value.Index, u32) = .empty;11257 var roots: std.array_hash_map.Auto(Value.Index, u32) = .empty;
11258 defer roots.deinit(gpa);11258 defer roots.deinit(gpa);
11259 {11259 {
11260 try roots.ensureTotalCapacity(gpa, isel.values.items.len);11260 try roots.ensureTotalCapacity(gpa, isel.values.items.len);
src/codegen/c.zig+11-11
...@@ -59,14 +59,14 @@ pub const Mir = struct {...@@ -59,14 +59,14 @@ pub const Mir = struct {
59 /// Key is the value of the UAV; value is the UAV's alignment, or59 /// Key is the value of the UAV; value is the UAV's alignment, or
60 /// `.none` for natural alignment. The specified alignment is never60 /// `.none` for natural alignment. The specified alignment is never
61 /// less than the natural alignment.61 /// less than the natural alignment.
62 need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),62 need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
63 ctype_deps: CType.Dependencies,63 ctype_deps: CType.Dependencies,
64 /// Key is an enum type for which we need a generated `@tagName` function.64 /// Key is an enum type for which we need a generated `@tagName` function.
65 need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),65 need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
66 /// Key is a function Nav for which we need a generated `zig_never_tail` wrapper.66 /// Key is a function Nav for which we need a generated `zig_never_tail` wrapper.
67 need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),67 need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
68 /// Key is a function Nav for which we need a generated `zig_never_inline` wrapper.68 /// Key is a function Nav for which we need a generated `zig_never_inline` wrapper.
69 need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),69 need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
7070
71 pub fn deinit(mir: *Mir, gpa: Allocator) void {71 pub fn deinit(mir: *Mir, gpa: Allocator) void {
72 gpa.free(mir.fwd_decl);72 gpa.free(mir.fwd_decl);
...@@ -164,8 +164,8 @@ const LocalType = struct {...@@ -164,8 +164,8 @@ const LocalType = struct {
164};164};
165165
166const LocalIndex = u16;166const LocalIndex = u16;
167const LocalsList = std.AutoArrayHashMapUnmanaged(LocalIndex, void);167const LocalsList = std.array_hash_map.Auto(LocalIndex, void);
168const LocalsMap = std.AutoArrayHashMapUnmanaged(LocalType, LocalsList);168const LocalsMap = std.array_hash_map.Auto(LocalType, LocalsList);
169169
170const ValueRenderLocation = enum {170const ValueRenderLocation = enum {
171 initializer,171 initializer,
...@@ -391,11 +391,11 @@ pub const Function = struct {...@@ -391,11 +391,11 @@ pub const Function = struct {
391 code: Writer.Allocating,391 code: Writer.Allocating,
392 indent_counter: usize,392 indent_counter: usize,
393 /// Key is an enum type for which we need a generated `@tagName` function.393 /// Key is an enum type for which we need a generated `@tagName` function.
394 need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),394 need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
395 /// Key is a function Nav for which we need a generated `zig_never_tail` wrapper.395 /// Key is a function Nav for which we need a generated `zig_never_tail` wrapper.
396 need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),396 need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
397 /// Key is a function Nav for which we need a generated `zig_never_inline` wrapper.397 /// Key is a function Nav for which we need a generated `zig_never_inline` wrapper.
398 need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),398 need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
399 func_index: InternPool.Index,399 func_index: InternPool.Index,
400 /// All the locals, to be emitted at the top of the function.400 /// All the locals, to be emitted at the top of the function.
401 locals: std.ArrayList(LocalType) = .empty,401 locals: std.ArrayList(LocalType) = .empty,
...@@ -407,7 +407,7 @@ pub const Function = struct {...@@ -407,7 +407,7 @@ pub const Function = struct {
407 /// of variable declarations at the top of a function, sorted descending407 /// of variable declarations at the top of a function, sorted descending
408 /// by type alignment.408 /// by type alignment.
409 /// The value is whether the alloc needs to be emitted in the header.409 /// The value is whether the alloc needs to be emitted in the header.
410 allocs: std.AutoArrayHashMapUnmanaged(LocalIndex, bool) = .empty,410 allocs: std.array_hash_map.Auto(LocalIndex, bool) = .empty,
411 /// Maps from `loop_switch_br` instructions to the allocated local used411 /// Maps from `loop_switch_br` instructions to the allocated local used
412 /// for the switch cond. Dispatches should set this local to the new cond.412 /// for the switch cond. Dispatches should set this local to the new cond.
413 loop_switch_conds: std.AutoHashMapUnmanaged(Air.Inst.Index, LocalIndex) = .empty,413 loop_switch_conds: std.AutoHashMapUnmanaged(Air.Inst.Index, LocalIndex) = .empty,
...@@ -643,7 +643,7 @@ pub const DeclGen = struct {...@@ -643,7 +643,7 @@ pub const DeclGen = struct {
643 /// Key is the value of the UAV; value is the UAV's alignment, or643 /// Key is the value of the UAV; value is the UAV's alignment, or
644 /// `.none` for natural alignment. The specified alignment is never644 /// `.none` for natural alignment. The specified alignment is never
645 /// less than the natural alignment.645 /// less than the natural alignment.
646 uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),646 uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
647647
648 fn fail(dg: *DeclGen, comptime format: []const u8, args: anytype) Error {648 fn fail(dg: *DeclGen, comptime format: []const u8, args: anytype) Error {
649 @branchHint(.cold);649 @branchHint(.cold);
src/codegen/c/type.zig+6-6
...@@ -572,30 +572,30 @@ pub const CType = union(enum) {...@@ -572,30 +572,30 @@ pub const CType = union(enum) {
572 pub const Dependencies = struct {572 pub const Dependencies = struct {
573 /// Key is any Zig type which corresponds to a C `struct`, `union`, or `typedef`. That C573 /// Key is any Zig type which corresponds to a C `struct`, `union`, or `typedef`. That C
574 /// type must be declared and complete.574 /// type must be declared and complete.
575 type: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),575 type: std.array_hash_map.Auto(InternPool.Index, void),
576576
577 /// Key is a Zig type which is the *payload* of an error union. The C `struct` type577 /// Key is a Zig type which is the *payload* of an error union. The C `struct` type
578 /// corresponding to such an error union must be declared and complete.578 /// corresponding to such an error union must be declared and complete.
579 ///579 ///
580 /// These are separate from `type` to avoid redundant types for every different error set580 /// These are separate from `type` to avoid redundant types for every different error set
581 /// used with the same payload type---for instance a different C type for every `E!void`.581 /// used with the same payload type---for instance a different C type for every `E!void`.
582 errunion_type: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),582 errunion_type: std.array_hash_map.Auto(InternPool.Index, void),
583583
584 /// Like `type`, but the type does not necessarily need to be completed yet: a forward584 /// Like `type`, but the type does not necessarily need to be completed yet: a forward
585 /// declaration is sufficient.585 /// declaration is sufficient.
586 type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),586 type_fwd: std.array_hash_map.Auto(InternPool.Index, void),
587587
588 /// Like `errunion_type`, but the type does not necessarily need to be completed yet: a588 /// Like `errunion_type`, but the type does not necessarily need to be completed yet: a
589 /// forward declaration is sufficient.589 /// forward declaration is sufficient.
590 errunion_type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),590 errunion_type_fwd: std.array_hash_map.Auto(InternPool.Index, void),
591591
592 /// Key is a Zig type; value is a bitmask of alignments. For every bit which is set, an592 /// Key is a Zig type; value is a bitmask of alignments. For every bit which is set, an
593 /// aligned typedef is required. For instance, if bit 3 is set, the C type 'aligned__8_foo'593 /// aligned typedef is required. For instance, if bit 3 is set, the C type 'aligned__8_foo'
594 /// must be declared through `typedef` (but not necessarily completed yet).594 /// must be declared through `typedef` (but not necessarily completed yet).
595 aligned_type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, u64),595 aligned_type_fwd: std.array_hash_map.Auto(InternPool.Index, u64),
596596
597 /// Key specifies a big-int type whose C `struct` must be declared and complete.597 /// Key specifies a big-int type whose C `struct` must be declared and complete.
598 bigint: std.AutoArrayHashMapUnmanaged(BigInt, void),598 bigint: std.array_hash_map.Auto(BigInt, void),
599599
600 pub const empty: Dependencies = .{600 pub const empty: Dependencies = .{
601 .type = .empty,601 .type = .empty,
src/codegen/llvm/FuncGen.zig+1-1
...@@ -2513,7 +2513,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {...@@ -2513,7 +2513,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
2513 var llvm_param_i: usize = 0;2513 var llvm_param_i: usize = 0;
2514 var total_i: usize = 0;2514 var total_i: usize = 0;
25152515
2516 var name_map: std.StringArrayHashMapUnmanaged(u16) = .empty;2516 var name_map: std.array_hash_map.String(u16) = .empty;
2517 try name_map.ensureUnusedCapacity(arena, max_param_count);2517 try name_map.ensureUnusedCapacity(arena, max_param_count);
25182518
2519 var it = unwrapped_asm.iterateOutputs();2519 var it = unwrapped_asm.iterateOutputs();
src/codegen/riscv64/CodeGen.zig+4-4
...@@ -112,7 +112,7 @@ const_tracking: ConstTrackingMap = .{},...@@ -112,7 +112,7 @@ const_tracking: ConstTrackingMap = .{},
112inst_tracking: InstTrackingMap = .{},112inst_tracking: InstTrackingMap = .{},
113113
114frame_allocs: std.MultiArrayList(FrameAlloc) = .{},114frame_allocs: std.MultiArrayList(FrameAlloc) = .{},
115free_frame_indices: std.AutoArrayHashMapUnmanaged(FrameIndex, void) = .empty,115free_frame_indices: std.array_hash_map.Auto(FrameIndex, void) = .empty,
116frame_locs: std.MultiArrayList(Mir.FrameLoc) = .{},116frame_locs: std.MultiArrayList(Mir.FrameLoc) = .{},
117117
118loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {118loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
...@@ -338,7 +338,7 @@ const MCValue = union(enum) {...@@ -338,7 +338,7 @@ const MCValue = union(enum) {
338};338};
339339
340const Branch = struct {340const Branch = struct {
341 inst_table: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, MCValue) = .empty,341 inst_table: std.array_hash_map.Auto(Air.Inst.Index, MCValue) = .empty,
342342
343 fn deinit(func: *Branch, gpa: Allocator) void {343 fn deinit(func: *Branch, gpa: Allocator) void {
344 func.inst_table.deinit(gpa);344 func.inst_table.deinit(gpa);
...@@ -346,8 +346,8 @@ const Branch = struct {...@@ -346,8 +346,8 @@ const Branch = struct {
346 }346 }
347};347};
348348
349const InstTrackingMap = std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InstTracking);349const InstTrackingMap = std.array_hash_map.Auto(Air.Inst.Index, InstTracking);
350const ConstTrackingMap = std.AutoArrayHashMapUnmanaged(InternPool.Index, InstTracking);350const ConstTrackingMap = std.array_hash_map.Auto(InternPool.Index, InstTracking);
351351
352const InstTracking = struct {352const InstTracking = struct {
353 long: MCValue,353 long: MCValue,
src/codegen/sparc64/CodeGen.zig+1-1
...@@ -200,7 +200,7 @@ const MCValue = union(enum) {...@@ -200,7 +200,7 @@ const MCValue = union(enum) {
200};200};
201201
202const Branch = struct {202const Branch = struct {
203 inst_table: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, MCValue) = .empty,203 inst_table: std.array_hash_map.Auto(Air.Inst.Index, MCValue) = .empty,
204204
205 fn deinit(self: *Branch, gpa: Allocator) void {205 fn deinit(self: *Branch, gpa: Allocator) void {
206 self.inst_table.deinit(gpa);206 self.inst_table.deinit(gpa);
src/codegen/spirv/Assembler.zig+2-2
...@@ -35,8 +35,8 @@ inst: struct {...@@ -35,8 +35,8 @@ inst: struct {
35 return null;35 return null;
36 }36 }
37} = .{},37} = .{},
38value_map: std.StringArrayHashMapUnmanaged(AsmValue) = .{},38value_map: std.array_hash_map.String(AsmValue) = .{},
39inst_map: std.StringArrayHashMapUnmanaged(void) = .empty,39inst_map: std.array_hash_map.String(void) = .empty,
4040
41const Operand = union(enum) {41const Operand = union(enum) {
42 /// Any 'simple' 32-bit value. This could be a mask or42 /// Any 'simple' 32-bit value. This could be a mask or
src/codegen/spirv/Module.zig+5-5
...@@ -28,7 +28,7 @@ uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass...@@ -28,7 +28,7 @@ uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass
28intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,28intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
29decls: std.ArrayList(Decl) = .empty,29decls: std.ArrayList(Decl) = .empty,
30decl_deps: std.ArrayList(Decl.Index) = .empty,30decl_deps: std.ArrayList(Decl.Index) = .empty,
31entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,31entry_points: std.array_hash_map.Auto(Id, EntryPoint) = .empty,
32/// This map serves a dual purpose:32/// This map serves a dual purpose:
33/// - It keeps track of pointers that are currently being emitted, so that we can tell33/// - It keeps track of pointers that are currently being emitted, so that we can tell
34/// if they are recursive and need an OpTypeForwardPointer.34/// if they are recursive and need an OpTypeForwardPointer.
...@@ -58,18 +58,18 @@ cache: struct {...@@ -58,18 +58,18 @@ cache: struct {
58 float_types: std.AutoHashMapUnmanaged(std.lang.Type.Float, Id) = .empty,58 float_types: std.AutoHashMapUnmanaged(std.lang.Type.Float, Id) = .empty,
59 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,59 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,
60 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,60 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,
61 struct_types: std.ArrayHashMapUnmanaged(StructType, Id, StructType.HashContext, true) = .empty,61 struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty,
62 fn_types: std.ArrayHashMapUnmanaged(FnType, Id, FnType.HashContext, true) = .empty,62 fn_types: std.array_hash_map.Custom(FnType, Id, FnType.HashContext, true) = .empty,
6363
64 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,64 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,
65 extensions: std.StringHashMapUnmanaged(void) = .empty,65 extensions: std.StringHashMapUnmanaged(void) = .empty,
66 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,66 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,
67 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,67 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,
68 builtins: std.AutoHashMapUnmanaged(struct { spec.BuiltIn, spec.StorageClass }, Decl.Index) = .empty,68 builtins: std.AutoHashMapUnmanaged(struct { spec.BuiltIn, spec.StorageClass }, Decl.Index) = .empty,
69 strings: std.StringArrayHashMapUnmanaged(Id) = .empty,69 strings: std.array_hash_map.String(Id) = .empty,
7070
71 bool_const: [2]?Id = .{ null, null },71 bool_const: [2]?Id = .{ null, null },
72 constants: std.ArrayHashMapUnmanaged(Constant, Id, Constant.HashContext, true) = .empty,72 constants: std.array_hash_map.Custom(Constant, Id, Constant.HashContext, true) = .empty,
7373
74 spirv_types: std.AutoHashMapUnmanaged(InternPool.Index, Id) = .empty,74 spirv_types: std.AutoHashMapUnmanaged(InternPool.Index, Id) = .empty,
75} = .{},75} = .{},
src/codegen/wasm/CodeGen.zig+5-5
...@@ -141,7 +141,7 @@ branches: std.ArrayList(Branch) = .empty,...@@ -141,7 +141,7 @@ branches: std.ArrayList(Branch) = .empty,
141/// Table to save `WValue`'s generated by an `Air.Inst`141/// Table to save `WValue`'s generated by an `Air.Inst`
142// values: ValueTable,142// values: ValueTable,
143/// Mapping from Air.Inst.Index to block ids143/// Mapping from Air.Inst.Index to block ids
144blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, struct {144blocks: std.array_hash_map.Auto(Air.Inst.Index, struct {
145 label: u32,145 label: u32,
146 value: WValue,146 value: WValue,
147}) = .{},147}) = .{},
...@@ -171,12 +171,12 @@ mir_extra: std.ArrayList(u32),...@@ -171,12 +171,12 @@ mir_extra: std.ArrayList(u32),
171mir_locals: std.ArrayList(std.wasm.Valtype),171mir_locals: std.ArrayList(std.wasm.Valtype),
172/// Set of all UAVs referenced by this function. Key is the UAV value, value is the alignment.172/// Set of all UAVs referenced by this function. Key is the UAV value, value is the alignment.
173/// `.none` means naturally aligned. An explicit alignment is never less than the natural alignment.173/// `.none` means naturally aligned. An explicit alignment is never less than the natural alignment.
174mir_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),174mir_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
175/// Set of all functions whose address this function has taken and which therefore might be called175/// Set of all functions whose address this function has taken and which therefore might be called
176/// via a `call_indirect` function.176/// via a `call_indirect` function.
177mir_indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),177mir_indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void),
178/// Set of all function types used by this function. These must be interned by the linker.178/// Set of all function types used by this function. These must be interned by the linker.
179mir_func_tys: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),179mir_func_tys: std.array_hash_map.Auto(InternPool.Index, void),
180/// The number of `error_name_table_ref` instructions emitted.180/// The number of `error_name_table_ref` instructions emitted.
181error_name_table_ref_count: u32,181error_name_table_ref_count: u32,
182/// When a function is executing, we store the the current stack pointer's value within this local.182/// When a function is executing, we store the the current stack pointer's value within this local.
...@@ -322,7 +322,7 @@ const WValue = union(enum) {...@@ -322,7 +322,7 @@ const WValue = union(enum) {
322};322};
323323
324/// Hashmap to store generated `WValue` for each `Air.Inst.Ref`324/// Hashmap to store generated `WValue` for each `Air.Inst.Ref`
325const ValueTable = std.AutoArrayHashMapUnmanaged(Air.Inst.Ref, WValue);325const ValueTable = std.array_hash_map.Auto(Air.Inst.Ref, WValue);
326326
327const bookkeeping_init = if (std.debug.runtime_safety) @as(usize, 0) else {};327const bookkeeping_init = if (std.debug.runtime_safety) @as(usize, 0) else {};
328328
src/codegen/wasm/Mir.zig+3-3
...@@ -26,11 +26,11 @@ prologue: Prologue,...@@ -26,11 +26,11 @@ prologue: Prologue,
2626
27/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.27/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.
28/// Value is the explicit alignment if greater than natural alignment, `.none` otherwise.28/// Value is the explicit alignment if greater than natural alignment, `.none` otherwise.
29uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),29uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
30/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.30/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.
31indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),31indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void),
32/// Not directly used by `Emit`, but the linker needs this to ensure these types are interned.32/// Not directly used by `Emit`, but the linker needs this to ensure these types are interned.
33func_tys: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),33func_tys: std.array_hash_map.Auto(InternPool.Index, void),
34/// Not directly used by `Emit`, but the linker needs this to add it to its own refcount.34/// Not directly used by `Emit`, but the linker needs this to add it to its own refcount.
35error_name_table_ref_count: u32,35error_name_table_ref_count: u32,
3636
src/codegen/x86_64/CodeGen.zig+3-3
...@@ -140,7 +140,7 @@ register_manager: RegisterManager = .{},...@@ -140,7 +140,7 @@ register_manager: RegisterManager = .{},
140scope_generation: u32 = 0,140scope_generation: u32 = 0,
141141
142frame_allocs: std.MultiArrayList(FrameAlloc) = .empty,142frame_allocs: std.MultiArrayList(FrameAlloc) = .empty,
143free_frame_indices: std.AutoArrayHashMapUnmanaged(FrameIndex, void) = .empty,143free_frame_indices: std.array_hash_map.Auto(FrameIndex, void) = .empty,
144frame_locs: std.MultiArrayList(Mir.FrameLoc) = .empty,144frame_locs: std.MultiArrayList(Mir.FrameLoc) = .empty,
145145
146loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {146loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
...@@ -569,8 +569,8 @@ pub const MCValue = union(enum) {...@@ -569,8 +569,8 @@ pub const MCValue = union(enum) {
569 }569 }
570};570};
571571
572const InstTrackingMap = std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InstTracking);572const InstTrackingMap = std.array_hash_map.Auto(Air.Inst.Index, InstTracking);
573const ConstTrackingMap = std.AutoArrayHashMapUnmanaged(InternPool.Index, InstTracking);573const ConstTrackingMap = std.array_hash_map.Auto(InternPool.Index, InstTracking);
574const InstTracking = struct {574const InstTracking = struct {
575 long: MCValue,575 long: MCValue,
576 short: MCValue,576 short: MCValue,
src/libs/mingw/implib.zig+1-1
...@@ -245,7 +245,7 @@ pub fn getMembers(...@@ -245,7 +245,7 @@ pub fn getMembers(
245 };245 };
246 var renames: std.ArrayList(DeferredExport) = .empty;246 var renames: std.ArrayList(DeferredExport) = .empty;
247 defer renames.deinit(allocator);247 defer renames.deinit(allocator);
248 var regular_imports: std.StringArrayHashMapUnmanaged([]const u8) = .empty;248 var regular_imports: std.array_hash_map.String([]const u8) = .empty;
249 defer regular_imports.deinit(allocator);249 defer regular_imports.deinit(allocator);
250250
251 for (module_def.exports.items) |*e| {251 for (module_def.exports.items) |*e| {
src/link.zig+1-1
...@@ -471,7 +471,7 @@ pub const File = struct {...@@ -471,7 +471,7 @@ pub const File = struct {
471 /// wrapper for a system function. The wrapper function should be called471 /// wrapper for a system function. The wrapper function should be called
472 /// __wrap_symbol. If it wishes to call the system function, it should call472 /// __wrap_symbol. If it wishes to call the system function, it should call
473 /// __real_symbol.473 /// __real_symbol.
474 symbol_wrap_set: std.StringArrayHashMapUnmanaged(void),474 symbol_wrap_set: std.array_hash_map.String(void),
475475
476 compatibility_version: ?std.SemanticVersion,476 compatibility_version: ?std.SemanticVersion,
477477
src/link/C.zig+26-26
...@@ -44,10 +44,10 @@ type_dependencies: std.ArrayList(link.ConstPool.Index),...@@ -44,10 +44,10 @@ type_dependencies: std.ArrayList(link.ConstPool.Index),
44align_dependency_masks: std.ArrayList(u64),44align_dependency_masks: std.ArrayList(u64),
4545
46/// All NAVs, regardless of whether they are functions or simple constants, are put in this map.46/// All NAVs, regardless of whether they are functions or simple constants, are put in this map.
47navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, RenderedDecl),47navs: std.array_hash_map.Auto(InternPool.Nav.Index, RenderedDecl),
48/// All UAVs which may be referenced are in this map. The UAV alignment is not included in the48/// All UAVs which may be referenced are in this map. The UAV alignment is not included in the
49/// rendered C code stored here, because we don't know the alignment a UAV needs until `flush`.49/// rendered C code stored here, because we don't know the alignment a UAV needs until `flush`.
50uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, RenderedDecl),50uavs: std.array_hash_map.Auto(InternPool.Index, RenderedDecl),
51/// Contains all types which are needed by some other rendered code. Does not contain any constants51/// Contains all types which are needed by some other rendered code. Does not contain any constants
52/// other than types.52/// other than types.
53type_pool: link.ConstPool,53type_pool: link.ConstPool,
...@@ -59,10 +59,10 @@ types: std.ArrayList(RenderedType),...@@ -59,10 +59,10 @@ types: std.ArrayList(RenderedType),
59/// The set of big int types required by *any* generated code so far. These are always safe to emit,59/// The set of big int types required by *any* generated code so far. These are always safe to emit,
60/// so they do not participate in the dependency graph traversal in `flush`. Therefore, redundant60/// so they do not participate in the dependency graph traversal in `flush`. Therefore, redundant
61/// big-int types may be emitted under incremental compilation.61/// big-int types may be emitted under incremental compilation.
62bigint_types: std.AutoArrayHashMapUnmanaged(codegen.CType.BigInt, void),62bigint_types: std.array_hash_map.Auto(codegen.CType.BigInt, void),
6363
64exported_navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, String),64exported_navs: std.array_hash_map.Auto(InternPool.Nav.Index, String),
65exported_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, String),65exported_uavs: std.array_hash_map.Auto(InternPool.Index, String),
6666
67/// A reference into `string_bytes`.67/// A reference into `string_bytes`.
68const String = extern struct {68const String = extern struct {
...@@ -133,10 +133,10 @@ const RenderedDecl = struct {...@@ -133,10 +133,10 @@ const RenderedDecl = struct {
133 fwd_decl: String,133 fwd_decl: String,
134 code: String,134 code: String,
135 ctype_deps: CTypeDependencies,135 ctype_deps: CTypeDependencies,
136 need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),136 need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
137 need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),137 need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
138 need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),138 need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
139 need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),139 need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
140140
141 const init: RenderedDecl = .{141 const init: RenderedDecl = .{
142 .fwd_decl = .empty,142 .fwd_decl = .empty,
...@@ -746,7 +746,7 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog...@@ -746,7 +746,7 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog
746 // incremental updates which is invalid C (due to e.g. types changing). Machine code backends746 // incremental updates which is invalid C (due to e.g. types changing). Machine code backends
747 // don't have this problem because there are, of course, no type checking performed when you747 // don't have this problem because there are, of course, no type checking performed when you
748 // *execute* a binary!748 // *execute* a binary!
749 var need_navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;749 var need_navs: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty;
750 defer need_navs.deinit(gpa);750 defer need_navs.deinit(gpa);
751 {751 {
752 const unit_references = try zcu.resolveReferences();752 const unit_references = try zcu.resolveReferences();
...@@ -774,23 +774,23 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog...@@ -774,23 +774,23 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog
774 //774 //
775 // At the same time, we will discover the set of lazy functions which are referenced.775 // At the same time, we will discover the set of lazy functions which are referenced.
776776
777 var need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment) = .empty;777 var need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment) = .empty;
778 defer need_uavs.deinit(gpa);778 defer need_uavs.deinit(gpa);
779779
780 var need_types: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void) = .empty;780 var need_types: std.array_hash_map.Auto(link.ConstPool.Index, void) = .empty;
781 defer need_types.deinit(gpa);781 defer need_types.deinit(gpa);
782 var need_errunion_types: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void) = .empty;782 var need_errunion_types: std.array_hash_map.Auto(link.ConstPool.Index, void) = .empty;
783 defer need_errunion_types.deinit(gpa);783 defer need_errunion_types.deinit(gpa);
784 var need_aligned_types: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64) = .empty;784 var need_aligned_types: std.array_hash_map.Auto(link.ConstPool.Index, u64) = .empty;
785 defer need_aligned_types.deinit(gpa);785 defer need_aligned_types.deinit(gpa);
786786
787 var need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty;787 var need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void) = .empty;
788 defer need_tag_name_funcs.deinit(gpa);788 defer need_tag_name_funcs.deinit(gpa);
789789
790 var need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;790 var need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty;
791 defer need_never_tail_funcs.deinit(gpa);791 defer need_never_tail_funcs.deinit(gpa);
792792
793 var need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;793 var need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty;
794 defer need_never_inline_funcs.deinit(gpa);794 defer need_never_inline_funcs.deinit(gpa);
795795
796 // As mentioned above, we need this type for error names.796 // As mentioned above, we need this type for error names.
...@@ -1284,9 +1284,9 @@ pub fn deleteExport(...@@ -1284,9 +1284,9 @@ pub fn deleteExport(
12841284
1285fn mergeNeededCTypes(1285fn mergeNeededCTypes(
1286 c: *C,1286 c: *C,
1287 need_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),1287 need_types: *std.array_hash_map.Auto(link.ConstPool.Index, void),
1288 need_errunion_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),1288 need_errunion_types: *std.array_hash_map.Auto(link.ConstPool.Index, void),
1289 need_aligned_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64),1289 need_aligned_types: *std.array_hash_map.Auto(link.ConstPool.Index, u64),
1290 deps: *const CTypeDependencies,1290 deps: *const CTypeDependencies,
1291) Allocator.Error!void {1291) Allocator.Error!void {
1292 const gpa = c.base.comp.gpa;1292 const gpa = c.base.comp.gpa;
...@@ -1312,8 +1312,8 @@ fn mergeNeededCTypes(...@@ -1312,8 +1312,8 @@ fn mergeNeededCTypes(
13121312
1313fn mergeNeededUavs(1313fn mergeNeededUavs(
1314 zcu: *const Zcu,1314 zcu: *const Zcu,
1315 global: *std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),1315 global: *std.array_hash_map.Auto(InternPool.Index, Alignment),
1316 new: *const std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),1316 new: *const std.array_hash_map.Auto(InternPool.Index, Alignment),
1317) Allocator.Error!void {1317) Allocator.Error!void {
1318 const gpa = zcu.comp.gpa;1318 const gpa = zcu.comp.gpa;
13191319
...@@ -1422,12 +1422,12 @@ const FlushTypes = struct {...@@ -1422,12 +1422,12 @@ const FlushTypes = struct {
1422 c: *C,1422 c: *C,
1423 f: *Flush,1423 f: *Flush,
14241424
1425 aligned_types: *const std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64),1425 aligned_types: *const std.array_hash_map.Auto(link.ConstPool.Index, u64),
1426 aligned_type_strings: []const []const u8,1426 aligned_type_strings: []const []const u8,
14271427
1428 status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, bool),1428 status: std.array_hash_map.Auto(link.ConstPool.Index, bool),
1429 errunion_status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, bool),1429 errunion_status: std.array_hash_map.Auto(link.ConstPool.Index, bool),
1430 aligned_status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),1430 aligned_status: std.array_hash_map.Auto(link.ConstPool.Index, void),
14311431
1432 fn processDeps(ft: *FlushTypes, deps: *const CTypeDependencies) void {1432 fn processDeps(ft: *FlushTypes, deps: *const CTypeDependencies) void {
1433 const resolved = deps.get(ft.c);1433 const resolved = deps.get(ft.c);
src/link/Coff.zig+8-8
...@@ -30,18 +30,18 @@ strings: std.HashMapUnmanaged(...@@ -30,18 +30,18 @@ strings: std.HashMapUnmanaged(
30),30),
31string_bytes: std.ArrayList(u8),31string_bytes: std.ArrayList(u8),
32image_section_table: std.ArrayList(Symbol.Index),32image_section_table: std.ArrayList(Symbol.Index),
33pseudo_section_table: std.AutoArrayHashMapUnmanaged(String, Symbol.Index),33pseudo_section_table: std.array_hash_map.Auto(String, Symbol.Index),
34object_section_table: std.AutoArrayHashMapUnmanaged(String, Symbol.Index),34object_section_table: std.array_hash_map.Auto(String, Symbol.Index),
35symbol_table: std.ArrayList(Symbol),35symbol_table: std.ArrayList(Symbol),
36globals: std.AutoArrayHashMapUnmanaged(GlobalName, Symbol.Index),36globals: std.array_hash_map.Auto(GlobalName, Symbol.Index),
37global_pending_index: u32,37global_pending_index: u32,
38navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, Symbol.Index),38navs: std.array_hash_map.Auto(InternPool.Nav.Index, Symbol.Index),
39uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Symbol.Index),39uavs: std.array_hash_map.Auto(InternPool.Index, Symbol.Index),
40lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {40lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {
41 map: std.AutoArrayHashMapUnmanaged(InternPool.Index, Symbol.Index),41 map: std.array_hash_map.Auto(InternPool.Index, Symbol.Index),
42 pending_index: u32,42 pending_index: u32,
43}),43}),
44pending_uavs: std.AutoArrayHashMapUnmanaged(Node.UavMapIndex, struct {44pending_uavs: std.array_hash_map.Auto(Node.UavMapIndex, struct {
45 alignment: InternPool.Alignment,45 alignment: InternPool.Alignment,
46}),46}),
47relocs: std.ArrayList(Reloc),47relocs: std.ArrayList(Reloc),
...@@ -272,7 +272,7 @@ pub const Node = union(enum) {...@@ -272,7 +272,7 @@ pub const Node = union(enum) {
272272
273pub const ImportTable = struct {273pub const ImportTable = struct {
274 ni: MappedFile.Node.Index,274 ni: MappedFile.Node.Index,
275 entries: std.AutoArrayHashMapUnmanaged(void, Entry),275 entries: std.array_hash_map.Auto(void, Entry),
276276
277 pub const Entry = struct {277 pub const Entry = struct {
278 import_lookup_table_ni: MappedFile.Node.Index,278 import_lookup_table_ni: MappedFile.Node.Index,
src/link/ConstPool.zig+3-3
...@@ -15,10 +15,10 @@...@@ -15,10 +15,10 @@
15/// * ensure that any `get` call is eventually followed by a `flushPending` call15/// * ensure that any `get` call is eventually followed by a `flushPending` call
16const ConstPool = @This();16const ConstPool = @This();
1717
18values: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),18values: std.array_hash_map.Auto(InternPool.Index, void),
19pending: std.ArrayList(Index),19pending: std.ArrayList(Index),
20complete_containers: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),20complete_containers: std.array_hash_map.Auto(InternPool.Index, void),
21container_deps: std.AutoArrayHashMapUnmanaged(InternPool.Index, ContainerDepEntry.Index),21container_deps: std.array_hash_map.Auto(InternPool.Index, ContainerDepEntry.Index),
22container_dep_entries: std.ArrayList(ContainerDepEntry),22container_dep_entries: std.ArrayList(ContainerDepEntry),
2323
24pub const empty: ConstPool = .{24pub const empty: ConstPool = .{
src/link/Dwarf.zig+6-6
...@@ -27,11 +27,11 @@ address_size: AddressSize,...@@ -27,11 +27,11 @@ address_size: AddressSize,
2727
28const_pool: link.ConstPool,28const_pool: link.ConstPool,
2929
30mods: std.AutoArrayHashMapUnmanaged(*Module, ModInfo),30mods: std.array_hash_map.Auto(*Module, ModInfo),
31/// Indices are `link.ConstPool.Index`.31/// Indices are `link.ConstPool.Index`.
32values: std.ArrayList(struct { Unit.Index, Entry.Index }),32values: std.ArrayList(struct { Unit.Index, Entry.Index }),
33navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, Entry.Index),33navs: std.array_hash_map.Auto(InternPool.Nav.Index, Entry.Index),
34decls: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, Entry.Index),34decls: std.array_hash_map.Auto(InternPool.TrackedInst.Index, Entry.Index),
3535
36debug_abbrev: DebugAbbrev,36debug_abbrev: DebugAbbrev,
37debug_aranges: DebugAranges,37debug_aranges: DebugAranges,
...@@ -69,8 +69,8 @@ pub const AddressSize = enum(u8) {...@@ -69,8 +69,8 @@ pub const AddressSize = enum(u8) {
6969
70const ModInfo = struct {70const ModInfo = struct {
71 root_dir_path: Entry.Index,71 root_dir_path: Entry.Index,
72 dirs: std.AutoArrayHashMapUnmanaged(Unit.Index, void),72 dirs: std.array_hash_map.Auto(Unit.Index, void),
73 files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void),73 files: std.array_hash_map.Auto(Zcu.File.Index, void),
7474
75 fn deinit(mod_info: *ModInfo, gpa: Allocator) void {75 fn deinit(mod_info: *ModInfo, gpa: Allocator) void {
76 mod_info.dirs.deinit(gpa);76 mod_info.dirs.deinit(gpa);
...@@ -236,7 +236,7 @@ const DebugRngLists = struct {...@@ -236,7 +236,7 @@ const DebugRngLists = struct {
236236
237const StringSection = struct {237const StringSection = struct {
238 contents: std.ArrayList(u8),238 contents: std.ArrayList(u8),
239 map: std.AutoArrayHashMapUnmanaged(void, void),239 map: std.array_hash_map.Auto(void, void),
240 section: Section,240 section: Section,
241241
242 const unit: Unit.Index = @enumFromInt(0);242 const unit: Unit.Index = @enumFromInt(0);
src/link/Elf.zig+5-5
...@@ -2,7 +2,7 @@ pub const Atom = @import("Elf/Atom.zig");...@@ -2,7 +2,7 @@ pub const Atom = @import("Elf/Atom.zig");
22
3base: link.File,3base: link.File,
4zig_object: ?*ZigObject,4zig_object: ?*ZigObject,
5rpath_table: std.StringArrayHashMapUnmanaged(void),5rpath_table: std.array_hash_map.String(void),
6image_base: u64,6image_base: u64,
7z_nodelete: bool,7z_nodelete: bool,
8z_notext: bool,8z_notext: bool,
...@@ -30,7 +30,7 @@ file_handles: std.ArrayList(File.Handle) = .empty,...@@ -30,7 +30,7 @@ file_handles: std.ArrayList(File.Handle) = .empty,
30zig_object_index: ?File.Index = null,30zig_object_index: ?File.Index = null,
31linker_defined_index: ?File.Index = null,31linker_defined_index: ?File.Index = null,
32objects: std.ArrayList(File.Index) = .empty,32objects: std.ArrayList(File.Index) = .empty,
33shared_objects: std.StringArrayHashMapUnmanaged(File.Index) = .empty,33shared_objects: std.array_hash_map.String(File.Index) = .empty,
3434
35/// List of all output sections and their associated metadata.35/// List of all output sections and their associated metadata.
36sections: std.MultiArrayList(Section) = .{},36sections: std.MultiArrayList(Section) = .{},
...@@ -249,7 +249,7 @@ pub fn createEmpty(...@@ -249,7 +249,7 @@ pub fn createEmpty(
249 const is_dyn_lib = output_mode == .Lib and link_mode == .dynamic;249 const is_dyn_lib = output_mode == .Lib and link_mode == .dynamic;
250 const default_sym_version: elf.Versym = if (is_dyn_lib or comp.config.rdynamic) .GLOBAL else .LOCAL;250 const default_sym_version: elf.Versym = if (is_dyn_lib or comp.config.rdynamic) .GLOBAL else .LOCAL;
251251
252 var rpath_table: std.StringArrayHashMapUnmanaged(void) = .empty;252 var rpath_table: std.array_hash_map.String(void) = .empty;
253 try rpath_table.entries.resize(arena, options.rpath_list.len);253 try rpath_table.entries.resize(arena, options.rpath_list.len);
254 @memcpy(rpath_table.entries.items(.key), options.rpath_list);254 @memcpy(rpath_table.entries.items(.key), options.rpath_list);
255 try rpath_table.reIndex(arena);255 try rpath_table.reIndex(arena);
...@@ -1112,7 +1112,7 @@ fn parseDso(...@@ -1112,7 +1112,7 @@ fn parseDso(
1112 io: Io,1112 io: Io,
1113 diags: *Diags,1113 diags: *Diags,
1114 dso: link.Input.Dso,1114 dso: link.Input.Dso,
1115 shared_objects: *std.StringArrayHashMapUnmanaged(File.Index),1115 shared_objects: *std.array_hash_map.String(File.Index),
1116 files: *std.MultiArrayList(File.Entry),1116 files: *std.MultiArrayList(File.Entry),
1117 target: *const std.Target,1117 target: *const std.Target,
1118) !void {1118) !void {
...@@ -4153,7 +4153,7 @@ pub const Ref = struct {...@@ -4153,7 +4153,7 @@ pub const Ref = struct {
4153pub const SymbolResolver = struct {4153pub const SymbolResolver = struct {
4154 keys: std.ArrayList(Key) = .empty,4154 keys: std.ArrayList(Key) = .empty,
4155 values: std.ArrayList(Ref) = .empty,4155 values: std.ArrayList(Ref) = .empty,
4156 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,4156 table: std.array_hash_map.Auto(void, void) = .empty,
41574157
4158 const Result = struct {4158 const Result = struct {
4159 found_existing: bool,4159 found_existing: bool,
src/link/Elf/AtomList.zig+1-1
...@@ -3,7 +3,7 @@ size: u64 = 0,...@@ -3,7 +3,7 @@ size: u64 = 0,
3alignment: Atom.Alignment = .@"1",3alignment: Atom.Alignment = .@"1",
4output_section_index: u32 = 0,4output_section_index: u32 = 0,
5// atoms: std.ArrayList(Elf.Ref) = .empty,5// atoms: std.ArrayList(Elf.Ref) = .empty,
6atoms: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,6atoms: std.array_hash_map.Auto(Elf.Ref, void) = .empty,
77
8dirty: bool = true,8dirty: bool = true,
99
src/link/Elf/Thunk.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1value: i64 = 0,1value: i64 = 0,
2output_section_index: u32 = 0,2output_section_index: u32 = 0,
3symbols: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,3symbols: std.array_hash_map.Auto(Elf.Ref, void) = .empty,
4output_symtab_ctx: Elf.SymtabCtx = .{},4output_symtab_ctx: Elf.SymtabCtx = .{},
55
6pub fn deinit(thunk: *Thunk, allocator: Allocator) void {6pub fn deinit(thunk: *Thunk, allocator: Allocator) void {
src/link/Elf/ZigObject.zig+4-4
...@@ -2408,10 +2408,10 @@ const TlsVariable = struct {...@@ -2408,10 +2408,10 @@ const TlsVariable = struct {
2408};2408};
24092409
2410const AtomList = std.ArrayList(Atom.Index);2410const AtomList = std.ArrayList(Atom.Index);
2411const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);2411const NavTable = std.array_hash_map.Auto(InternPool.Nav.Index, AvMetadata);
2412const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);2412const UavTable = std.array_hash_map.Auto(InternPool.Index, AvMetadata);
2413const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);2413const LazySymbolTable = std.array_hash_map.Auto(InternPool.Index, LazySymbolMetadata);
2414const TlsTable = std.AutoArrayHashMapUnmanaged(Atom.Index, void);2414const TlsTable = std.array_hash_map.Auto(Atom.Index, void);
24152415
2416const x86_64 = struct {2416const x86_64 = struct {
2417 fn writeTrampolineCode(source_addr: i64, target_addr: i64, buf: *[max_trampoline_len]u8) ![]u8 {2417 fn writeTrampolineCode(source_addr: i64, target_addr: i64, buf: *[max_trampoline_len]u8) ![]u8 {
src/link/Elf2.zig+4-4
...@@ -112,7 +112,7 @@ plt_first_symbol_reloc: SymbolReloc.Index,...@@ -112,7 +112,7 @@ plt_first_symbol_reloc: SymbolReloc.Index,
112/// The `.dynamic` section contains zero or more symbol relocations starting at this index.112/// The `.dynamic` section contains zero or more symbol relocations starting at this index.
113dynamic_first_symbol_reloc: SymbolReloc.Index,113dynamic_first_symbol_reloc: SymbolReloc.Index,
114114
115needed: std.AutoArrayHashMapUnmanaged(String(.dynstr), void),115needed: std.array_hash_map.Auto(String(.dynstr), void),
116inputs: std.ArrayList(struct {116inputs: std.ArrayList(struct {
117 path: std.Build.Cache.Path,117 path: std.Build.Cache.Path,
118 member: ?[]const u8,118 member: ?[]const u8,
...@@ -120,21 +120,21 @@ inputs: std.ArrayList(struct {...@@ -120,21 +120,21 @@ inputs: std.ArrayList(struct {
120}),120}),
121input_sections: std.ArrayList(InputSection),121input_sections: std.ArrayList(InputSection),
122input_section_pending_index: u32,122input_section_pending_index: u32,
123navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, struct {123navs: std.array_hash_map.Auto(InternPool.Nav.Index, struct {
124 lsi: Symbol.LocalIndex,124 lsi: Symbol.LocalIndex,
125 /// The start index of the contiguous sequence of symbol relocations in this NAV.125 /// The start index of the contiguous sequence of symbol relocations in this NAV.
126 first_symbol_reloc: SymbolReloc.Index,126 first_symbol_reloc: SymbolReloc.Index,
127 /// The start index of the contiguous sequence of GOT relocations in this NAV.127 /// The start index of the contiguous sequence of GOT relocations in this NAV.
128 first_got_reloc: GotReloc.Index,128 first_got_reloc: GotReloc.Index,
129}),129}),
130uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, struct {130uavs: std.array_hash_map.Auto(InternPool.Index, struct {
131 lsi: Symbol.LocalIndex,131 lsi: Symbol.LocalIndex,
132 /// The start index of the contiguous sequence of symbol relocations in this UAV.132 /// The start index of the contiguous sequence of symbol relocations in this UAV.
133 first_symbol_reloc: SymbolReloc.Index,133 first_symbol_reloc: SymbolReloc.Index,
134 // No `first_got_reloc` field because a UAV never contains GOT relocations.134 // No `first_got_reloc` field because a UAV never contains GOT relocations.
135}),135}),
136lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {136lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {
137 map: std.AutoArrayHashMapUnmanaged(InternPool.Index, struct {137 map: std.array_hash_map.Auto(InternPool.Index, struct {
138 lsi: Symbol.LocalIndex,138 lsi: Symbol.LocalIndex,
139 /// The start index of the contiguous sequence of symbol relocations in this lazy code/data.139 /// The start index of the contiguous sequence of symbol relocations in this lazy code/data.
140 first_symbol_reloc: SymbolReloc.Index,140 first_symbol_reloc: SymbolReloc.Index,
src/link/MachO.zig+4-4
...@@ -28,9 +28,9 @@ sections: std.MultiArrayList(Section) = .{},...@@ -28,9 +28,9 @@ sections: std.MultiArrayList(Section) = .{},
28resolver: SymbolResolver = .{},28resolver: SymbolResolver = .{},
29/// This table will be populated after `scanRelocs` has run.29/// This table will be populated after `scanRelocs` has run.
30/// Key is symbol index.30/// Key is symbol index.
31undefs: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, UndefRefs) = .empty,31undefs: std.array_hash_map.Auto(SymbolResolver.Index, UndefRefs) = .empty,
32undefs_mutex: std.Io.Mutex = .init,32undefs_mutex: std.Io.Mutex = .init,
33dupes: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, std.ArrayList(File.Index)) = .empty,33dupes: std.array_hash_map.Auto(SymbolResolver.Index, std.ArrayList(File.Index)) = .empty,
34dupes_mutex: std.Io.Mutex = .init,34dupes_mutex: std.Io.Mutex = .init,
3535
36dyld_info_cmd: macho.dyld_info_command = .{},36dyld_info_cmd: macho.dyld_info_command = .{},
...@@ -4102,7 +4102,7 @@ const Section = struct {...@@ -4102,7 +4102,7 @@ const Section = struct {
4102};4102};
41034103
4104pub const LiteralPool = struct {4104pub const LiteralPool = struct {
4105 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,4105 table: std.array_hash_map.Auto(void, void) = .empty,
4106 keys: std.ArrayList(Key) = .empty,4106 keys: std.ArrayList(Key) = .empty,
4107 values: std.ArrayList(MachO.Ref) = .empty,4107 values: std.ArrayList(MachO.Ref) = .empty,
4108 data: std.ArrayList(u8) = .empty,4108 data: std.ArrayList(u8) = .empty,
...@@ -4541,7 +4541,7 @@ pub const Ref = struct {...@@ -4541,7 +4541,7 @@ pub const Ref = struct {
4541pub const SymbolResolver = struct {4541pub const SymbolResolver = struct {
4542 keys: std.ArrayList(Key) = .empty,4542 keys: std.ArrayList(Key) = .empty,
4543 values: std.ArrayList(Ref) = .empty,4543 values: std.ArrayList(Ref) = .empty,
4544 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,4544 table: std.array_hash_map.Auto(void, void) = .empty,
45454545
4546 const Result = struct {4546 const Result = struct {
4547 found_existing: bool,4547 found_existing: bool,
src/link/MachO/Dylib.zig+1-1
...@@ -14,7 +14,7 @@ symbols: std.ArrayList(Symbol) = .empty,...@@ -14,7 +14,7 @@ symbols: std.ArrayList(Symbol) = .empty,
14symbols_extra: std.ArrayList(u32) = .empty,14symbols_extra: std.ArrayList(u32) = .empty,
15globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,15globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,
16dependents: std.ArrayList(Id) = .empty,16dependents: std.ArrayList(Id) = .empty,
17rpaths: std.StringArrayHashMapUnmanaged(void) = .empty,17rpaths: std.array_hash_map.String(void) = .empty,
18umbrella: File.Index,18umbrella: File.Index,
19platform: ?MachO.Platform = null,19platform: ?MachO.Platform = null,
2020
src/link/MachO/Thunk.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1value: u64 = 0,1value: u64 = 0,
2out_n_sect: u8 = 0,2out_n_sect: u8 = 0,
3symbols: std.AutoArrayHashMapUnmanaged(MachO.Ref, void) = .empty,3symbols: std.array_hash_map.Auto(MachO.Ref, void) = .empty,
4output_symtab_ctx: MachO.SymtabCtx = .{},4output_symtab_ctx: MachO.SymtabCtx = .{},
55
6pub fn deinit(thunk: *Thunk, allocator: Allocator) void {6pub fn deinit(thunk: *Thunk, allocator: Allocator) void {
src/link/MachO/ZigObject.zig+4-4
...@@ -1750,11 +1750,11 @@ const TlvInitializer = struct {...@@ -1750,11 +1750,11 @@ const TlvInitializer = struct {
1750 }1750 }
1751};1751};
17521752
1753const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);1753const NavTable = std.array_hash_map.Auto(InternPool.Nav.Index, AvMetadata);
1754const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);1754const UavTable = std.array_hash_map.Auto(InternPool.Index, AvMetadata);
1755const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);1755const LazySymbolTable = std.array_hash_map.Auto(InternPool.Index, LazySymbolMetadata);
1756const RelocationTable = std.ArrayList(std.ArrayList(Relocation));1756const RelocationTable = std.ArrayList(std.ArrayList(Relocation));
1757const TlvInitializerTable = std.AutoArrayHashMapUnmanaged(Atom.Index, TlvInitializer);1757const TlvInitializerTable = std.array_hash_map.Auto(Atom.Index, TlvInitializer);
17581758
1759const x86_64 = struct {1759const x86_64 = struct {
1760 fn writeTrampolineCode(source_addr: u64, target_addr: u64, buf: *[max_trampoline_len]u8) ![]u8 {1760 fn writeTrampolineCode(source_addr: u64, target_addr: u64, buf: *[max_trampoline_len]u8) ![]u8 {
src/link/SpirV/lower_invocation_globals.zig+7-7
...@@ -23,14 +23,14 @@ const ModuleInfo = struct {...@@ -23,14 +23,14 @@ const ModuleInfo = struct {
23 /// The set of (result-id's of) invocation globals that are accessed23 /// The set of (result-id's of) invocation globals that are accessed
24 /// in this function, or after resolution, that are accessed in this24 /// in this function, or after resolution, that are accessed in this
25 /// function or any of it's callees.25 /// function or any of it's callees.
26 invocation_globals: std.AutoArrayHashMapUnmanaged(ResultId, void),26 invocation_globals: std.array_hash_map.Auto(ResultId, void),
27 };27 };
2828
29 /// Information about a particular invocation global29 /// Information about a particular invocation global
30 const InvocationGlobal = struct {30 const InvocationGlobal = struct {
31 /// The list of invocation globals that this invocation global31 /// The list of invocation globals that this invocation global
32 /// depends on.32 /// depends on.
33 dependencies: std.AutoArrayHashMapUnmanaged(ResultId, void),33 dependencies: std.array_hash_map.Auto(ResultId, void),
34 /// The invocation global's type34 /// The invocation global's type
35 ty: ResultId,35 ty: ResultId,
36 /// Initializer function. May be `none`.36 /// Initializer function. May be `none`.
...@@ -39,13 +39,13 @@ const ModuleInfo = struct {...@@ -39,13 +39,13 @@ const ModuleInfo = struct {
39 };39 };
4040
41 /// Maps function result-id -> Fn information structure.41 /// Maps function result-id -> Fn information structure.
42 functions: std.AutoArrayHashMapUnmanaged(ResultId, Fn),42 functions: std.array_hash_map.Auto(ResultId, Fn),
43 /// Set of OpFunction result-ids in this module.43 /// Set of OpFunction result-ids in this module.
44 entry_points: std.AutoArrayHashMapUnmanaged(ResultId, void),44 entry_points: std.array_hash_map.Auto(ResultId, void),
45 /// For each function, a list of function result-ids that it calls.45 /// For each function, a list of function result-ids that it calls.
46 callee_store: []const ResultId,46 callee_store: []const ResultId,
47 /// Maps each invocation global result-id to a type-id.47 /// Maps each invocation global result-id to a type-id.
48 invocation_globals: std.AutoArrayHashMapUnmanaged(ResultId, InvocationGlobal),48 invocation_globals: std.array_hash_map.Auto(ResultId, InvocationGlobal),
4949
50 /// Fetch the list of callees per function. Guaranteed to contain only unique IDs.50 /// Fetch the list of callees per function. Guaranteed to contain only unique IDs.
51 fn callees(self: ModuleInfo, fn_id: ResultId) []const ResultId {51 fn callees(self: ModuleInfo, fn_id: ResultId) []const ResultId {
...@@ -342,9 +342,9 @@ const ModuleBuilder = struct {...@@ -342,9 +342,9 @@ const ModuleBuilder = struct {
342 entry_point_new_id_base: u32,342 entry_point_new_id_base: u32,
343 /// A set of all function types in the new program. SPIR-V mandates that these are unique,343 /// A set of all function types in the new program. SPIR-V mandates that these are unique,
344 /// and until a general type deduplication pass is programmed, we just handle it here via this.344 /// and until a general type deduplication pass is programmed, we just handle it here via this.
345 function_types: std.ArrayHashMapUnmanaged(FunctionType, ResultId, FunctionType.Context, true) = .empty,345 function_types: std.array_hash_map.Custom(FunctionType, ResultId, FunctionType.Context, true) = .empty,
346 /// Maps functions to new information required for creating the module346 /// Maps functions to new information required for creating the module
347 function_new_info: std.AutoArrayHashMapUnmanaged(ResultId, FunctionNewInfo) = .empty,347 function_new_info: std.array_hash_map.Auto(ResultId, FunctionNewInfo) = .empty,
348 /// Offset of the functions section in the new binary.348 /// Offset of the functions section in the new binary.
349 new_functions_section: ?usize,349 new_functions_section: ?usize,
350350
src/link/Wasm.zig+32-32
...@@ -80,27 +80,27 @@ name: []const u8,...@@ -80,27 +80,27 @@ name: []const u8,
80/// List of relocatable files to be linked into the final binary.80/// List of relocatable files to be linked into the final binary.
81objects: std.ArrayList(Object) = .empty,81objects: std.ArrayList(Object) = .empty,
8282
83func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,83func_types: std.array_hash_map.Auto(FunctionType, void) = .empty,
84/// Provides a mapping of both imports and provided functions to symbol name.84/// Provides a mapping of both imports and provided functions to symbol name.
85/// Local functions may be unnamed.85/// Local functions may be unnamed.
86/// Key is symbol name, however the `FunctionImport` may have an name override for the import name.86/// Key is symbol name, however the `FunctionImport` may have an name override for the import name.
87object_function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImport) = .empty,87object_function_imports: std.array_hash_map.Auto(String, FunctionImport) = .empty,
88/// All functions for all objects.88/// All functions for all objects.
89object_functions: std.ArrayList(ObjectFunction) = .empty,89object_functions: std.ArrayList(ObjectFunction) = .empty,
9090
91/// Provides a mapping of both imports and provided globals to symbol name.91/// Provides a mapping of both imports and provided globals to symbol name.
92/// Local globals may be unnamed.92/// Local globals may be unnamed.
93object_global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImport) = .empty,93object_global_imports: std.array_hash_map.Auto(String, GlobalImport) = .empty,
94/// All globals for all objects.94/// All globals for all objects.
95object_globals: std.ArrayList(ObjectGlobal) = .empty,95object_globals: std.ArrayList(ObjectGlobal) = .empty,
9696
97/// All table imports for all objects.97/// All table imports for all objects.
98object_table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport) = .empty,98object_table_imports: std.array_hash_map.Auto(String, TableImport) = .empty,
99/// All parsed table sections for all objects.99/// All parsed table sections for all objects.
100object_tables: std.ArrayList(Table) = .empty,100object_tables: std.ArrayList(Table) = .empty,
101101
102/// All memory imports for all objects.102/// All memory imports for all objects.
103object_memory_imports: std.AutoArrayHashMapUnmanaged(String, MemoryImport) = .empty,103object_memory_imports: std.array_hash_map.Auto(String, MemoryImport) = .empty,
104/// All parsed memory sections for all objects.104/// All parsed memory sections for all objects.
105object_memories: std.ArrayList(ObjectMemory) = .empty,105object_memories: std.ArrayList(ObjectMemory) = .empty,
106106
...@@ -119,15 +119,15 @@ object_data_segments: std.ArrayList(ObjectDataSegment) = .empty,...@@ -119,15 +119,15 @@ object_data_segments: std.ArrayList(ObjectDataSegment) = .empty,
119/// Each segment has many data symbols, which correspond logically to global119/// Each segment has many data symbols, which correspond logically to global
120/// constants.120/// constants.
121object_datas: std.ArrayList(ObjectData) = .empty,121object_datas: std.ArrayList(ObjectData) = .empty,
122object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty,122object_data_imports: std.array_hash_map.Auto(String, ObjectDataImport) = .empty,
123/// Non-synthetic section that can essentially be mem-cpy'd into place after performing relocations.123/// Non-synthetic section that can essentially be mem-cpy'd into place after performing relocations.
124object_custom_segments: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, CustomSegment) = .empty,124object_custom_segments: std.array_hash_map.Auto(ObjectSectionIndex, CustomSegment) = .empty,
125125
126/// All comdat information for all objects.126/// All comdat information for all objects.
127object_comdats: std.ArrayList(Comdat) = .empty,127object_comdats: std.ArrayList(Comdat) = .empty,
128/// A table that maps the relocations to be performed where the key represents128/// A table that maps the relocations to be performed where the key represents
129/// the section (across all objects) that the slice of relocations applies to.129/// the section (across all objects) that the slice of relocations applies to.
130object_relocations_table: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, ObjectRelocation.Slice) = .empty,130object_relocations_table: std.array_hash_map.Auto(ObjectSectionIndex, ObjectRelocation.Slice) = .empty,
131/// Incremented across all objects in order to enable calculation of `ObjectSectionIndex` values.131/// Incremented across all objects in order to enable calculation of `ObjectSectionIndex` values.
132object_total_sections: u32 = 0,132object_total_sections: u32 = 0,
133/// All comdat symbols from all objects concatenated.133/// All comdat symbols from all objects concatenated.
...@@ -150,7 +150,7 @@ nav_fixups: std.ArrayList(NavFixup) = .empty,...@@ -150,7 +150,7 @@ nav_fixups: std.ArrayList(NavFixup) = .empty,
150func_table_fixups: std.ArrayList(FuncTableFixup) = .empty,150func_table_fixups: std.ArrayList(FuncTableFixup) = .empty,
151/// Symbols to be emitted into an object file. Remains empty when not emitting151/// Symbols to be emitted into an object file. Remains empty when not emitting
152/// an object file.152/// an object file.
153symbol_table: std.AutoArrayHashMapUnmanaged(String, void) = .empty,153symbol_table: std.array_hash_map.Auto(String, void) = .empty,
154154
155/// When importing objects from the host environment, a name must be supplied.155/// When importing objects from the host environment, a name must be supplied.
156/// LLVM uses "env" by default when none is given.156/// LLVM uses "env" by default when none is given.
...@@ -174,24 +174,24 @@ preloaded_strings: PreloadedStrings,...@@ -174,24 +174,24 @@ preloaded_strings: PreloadedStrings,
174174
175/// This field is used when emitting an object; `navs_exe` used otherwise.175/// This field is used when emitting an object; `navs_exe` used otherwise.
176/// Does not include externs since that data lives elsewhere.176/// Does not include externs since that data lives elsewhere.
177navs_obj: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, ZcuDataObj) = .empty,177navs_obj: std.array_hash_map.Auto(InternPool.Nav.Index, ZcuDataObj) = .empty,
178/// This field is unused when emitting an object; `navs_obj` used otherwise.178/// This field is unused when emitting an object; `navs_obj` used otherwise.
179/// Does not include externs since that data lives elsewhere.179/// Does not include externs since that data lives elsewhere.
180navs_exe: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, ZcuDataExe) = .empty,180navs_exe: std.array_hash_map.Auto(InternPool.Nav.Index, ZcuDataExe) = .empty,
181/// Tracks all InternPool values referenced by codegen. Needed for outputting181/// Tracks all InternPool values referenced by codegen. Needed for outputting
182/// the data segment. This one does not track ref count because object files182/// the data segment. This one does not track ref count because object files
183/// require using max LEB encoding for these references anyway.183/// require using max LEB encoding for these references anyway.
184uavs_obj: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuDataObj) = .empty,184uavs_obj: std.array_hash_map.Auto(InternPool.Index, ZcuDataObj) = .empty,
185/// Tracks ref count to optimize LEB encodings for UAV references.185/// Tracks ref count to optimize LEB encodings for UAV references.
186uavs_exe: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuDataExe) = .empty,186uavs_exe: std.array_hash_map.Auto(InternPool.Index, ZcuDataExe) = .empty,
187/// Sparse table of uavs that need to be emitted with greater alignment than187/// Sparse table of uavs that need to be emitted with greater alignment than
188/// the default for the type.188/// the default for the type.
189overaligned_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment) = .empty,189overaligned_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment) = .empty,
190/// When the key is an enum type, this represents a `@tagName` function.190/// When the key is an enum type, this represents a `@tagName` function.
191zcu_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuFunc) = .empty,191zcu_funcs: std.array_hash_map.Auto(InternPool.Index, ZcuFunc) = .empty,
192nav_exports: std.AutoArrayHashMapUnmanaged(NavExport, Zcu.Export.Index) = .empty,192nav_exports: std.array_hash_map.Auto(NavExport, Zcu.Export.Index) = .empty,
193uav_exports: std.AutoArrayHashMapUnmanaged(UavExport, Zcu.Export.Index) = .empty,193uav_exports: std.array_hash_map.Auto(UavExport, Zcu.Export.Index) = .empty,
194imports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,194imports: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
195195
196dwarf: ?Dwarf = null,196dwarf: ?Dwarf = null,
197197
...@@ -200,19 +200,19 @@ flush_buffer: Flush = .{},...@@ -200,19 +200,19 @@ flush_buffer: Flush = .{},
200/// Empty until `prelink`. There it is populated based on object files.200/// Empty until `prelink`. There it is populated based on object files.
201/// Next, it is copied into `Flush.missing_exports` just before `flush`201/// Next, it is copied into `Flush.missing_exports` just before `flush`
202/// and that data is used during `flush`.202/// and that data is used during `flush`.
203missing_exports: std.AutoArrayHashMapUnmanaged(String, void) = .empty,203missing_exports: std.array_hash_map.Auto(String, void) = .empty,
204entry_resolution: FunctionImport.Resolution = .unresolved,204entry_resolution: FunctionImport.Resolution = .unresolved,
205205
206/// Empty when outputting an object.206/// Empty when outputting an object.
207function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,207function_exports: std.array_hash_map.Auto(String, FunctionIndex) = .empty,
208hidden_function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,208hidden_function_exports: std.array_hash_map.Auto(String, FunctionIndex) = .empty,
209global_exports: std.ArrayList(GlobalExport) = .empty,209global_exports: std.ArrayList(GlobalExport) = .empty,
210/// Tracks the value at the end of prelink.210/// Tracks the value at the end of prelink.
211global_exports_len: u32 = 0,211global_exports_len: u32 = 0,
212212
213/// Ordered list of non-import functions that will appear in the final binary.213/// Ordered list of non-import functions that will appear in the final binary.
214/// Empty until prelink.214/// Empty until prelink.
215functions: std.AutoArrayHashMapUnmanaged(FunctionImport.Resolution, void) = .empty,215functions: std.array_hash_map.Auto(FunctionImport.Resolution, void) = .empty,
216/// Tracks the value at the end of prelink, at which point `functions`216/// Tracks the value at the end of prelink, at which point `functions`
217/// contains only object file functions, and nothing from the Zcu yet.217/// contains only object file functions, and nothing from the Zcu yet.
218functions_end_prelink: u32 = 0,218functions_end_prelink: u32 = 0,
...@@ -230,7 +230,7 @@ data_imports_len_prelink: u32 = 0,...@@ -230,7 +230,7 @@ data_imports_len_prelink: u32 = 0,
230/// `flush` gets a copy of this table, and then Zcu exports are applied to230/// `flush` gets a copy of this table, and then Zcu exports are applied to
231/// remove elements from the table, and the remainder are either undefined231/// remove elements from the table, and the remainder are either undefined
232/// symbol errors, or import section entries depending on the output mode.232/// symbol errors, or import section entries depending on the output mode.
233function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImportId) = .empty,233function_imports: std.array_hash_map.Auto(String, FunctionImportId) = .empty,
234234
235/// At the end of prelink, this is populated with data symbols needed by235/// At the end of prelink, this is populated with data symbols needed by
236/// objects.236/// objects.
...@@ -243,29 +243,29 @@ function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImportId) = .emp...@@ -243,29 +243,29 @@ function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImportId) = .emp
243/// `flush` gets a copy of this table, and then Zcu exports are applied to243/// `flush` gets a copy of this table, and then Zcu exports are applied to
244/// remove elements from the table, and the remainder are either undefined244/// remove elements from the table, and the remainder are either undefined
245/// symbol errors, or symbol table entries depending on the output mode.245/// symbol errors, or symbol table entries depending on the output mode.
246data_imports: std.AutoArrayHashMapUnmanaged(String, DataImportId) = .empty,246data_imports: std.array_hash_map.Auto(String, DataImportId) = .empty,
247/// Set of data symbols that will appear in the final binary. Used to populate247/// Set of data symbols that will appear in the final binary. Used to populate
248/// `Flush.data_segments` before sorting.248/// `Flush.data_segments` before sorting.
249data_segments: std.AutoArrayHashMapUnmanaged(DataSegmentId, void) = .empty,249data_segments: std.array_hash_map.Auto(DataSegmentId, void) = .empty,
250250
251/// Ordered list of non-import globals that will appear in the final binary.251/// Ordered list of non-import globals that will appear in the final binary.
252/// Empty until prelink.252/// Empty until prelink.
253globals: std.AutoArrayHashMapUnmanaged(GlobalImport.Resolution, void) = .empty,253globals: std.array_hash_map.Auto(GlobalImport.Resolution, void) = .empty,
254/// Tracks the value at the end of prelink, at which point `globals`254/// Tracks the value at the end of prelink, at which point `globals`
255/// contains only object file globals, and nothing from the Zcu yet.255/// contains only object file globals, and nothing from the Zcu yet.
256globals_end_prelink: u32 = 0,256globals_end_prelink: u32 = 0,
257global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImportId) = .empty,257global_imports: std.array_hash_map.Auto(String, GlobalImportId) = .empty,
258258
259/// Ordered list of non-import tables that will appear in the final binary.259/// Ordered list of non-import tables that will appear in the final binary.
260/// Empty until prelink.260/// Empty until prelink.
261tables: std.AutoArrayHashMapUnmanaged(TableImport.Resolution, void) = .empty,261tables: std.array_hash_map.Auto(TableImport.Resolution, void) = .empty,
262table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport.Index) = .empty,262table_imports: std.array_hash_map.Auto(String, TableImport.Index) = .empty,
263263
264/// All functions that have had their address taken and therefore might be264/// All functions that have had their address taken and therefore might be
265/// called via a `call_indirect` function.265/// called via a `call_indirect` function.
266zcu_indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,266zcu_indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
267object_indirect_function_import_set: std.AutoArrayHashMapUnmanaged(String, void) = .empty,267object_indirect_function_import_set: std.array_hash_map.Auto(String, void) = .empty,
268object_indirect_function_set: std.AutoArrayHashMapUnmanaged(ObjectFunctionIndex, void) = .empty,268object_indirect_function_set: std.array_hash_map.Auto(ObjectFunctionIndex, void) = .empty,
269269
270error_name_table_ref_count: u32 = 0,270error_name_table_ref_count: u32 = 0,
271tag_name_table_ref_count: u32 = 0,271tag_name_table_ref_count: u32 = 0,
src/link/Wasm/Archive.zig+1-1
...@@ -12,7 +12,7 @@ toc: Toc,...@@ -12,7 +12,7 @@ toc: Toc,
1212
13/// Key points into `LazyArchive` `file_contents`.13/// Key points into `LazyArchive` `file_contents`.
14/// Value is allocated with gpa.14/// Value is allocated with gpa.
15const Toc = std.StringArrayHashMapUnmanaged(std.ArrayList(u32));15const Toc = std.array_hash_map.String(std.ArrayList(u32));
1616
17const ARMAG = std.elf.ARMAG;17const ARMAG = std.elf.ARMAG;
18const ARFMAG = std.elf.ARFMAG;18const ARFMAG = std.elf.ARFMAG;
src/link/Wasm/Flush.zig+7-7
...@@ -24,22 +24,22 @@ const ArrayList = std.ArrayList;...@@ -24,22 +24,22 @@ const ArrayList = std.ArrayList;
24/// Ordered list of data segments that will appear in the final binary.24/// Ordered list of data segments that will appear in the final binary.
25/// When sorted, to-be-merged segments will be made adjacent.25/// When sorted, to-be-merged segments will be made adjacent.
26/// Values are virtual address.26/// Values are virtual address.
27data_segments: std.AutoArrayHashMapUnmanaged(Wasm.DataSegmentId, u32) = .empty,27data_segments: std.array_hash_map.Auto(Wasm.DataSegmentId, u32) = .empty,
28/// Each time a `data_segment` offset equals zero it indicates a new group, and28/// Each time a `data_segment` offset equals zero it indicates a new group, and
29/// the next element in this array will contain the total merged segment size.29/// the next element in this array will contain the total merged segment size.
30/// Value is the virtual memory address of the end of the segment.30/// Value is the virtual memory address of the end of the segment.
31data_segment_groups: ArrayList(DataSegmentGroup) = .empty,31data_segment_groups: ArrayList(DataSegmentGroup) = .empty,
3232
33binary_bytes: ArrayList(u8) = .empty,33binary_bytes: ArrayList(u8) = .empty,
34missing_exports: std.AutoArrayHashMapUnmanaged(String, void) = .empty,34missing_exports: std.array_hash_map.Auto(String, void) = .empty,
35function_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.FunctionImportId) = .empty,35function_imports: std.array_hash_map.Auto(String, Wasm.FunctionImportId) = .empty,
36global_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.GlobalImportId) = .empty,36global_imports: std.array_hash_map.Auto(String, Wasm.GlobalImportId) = .empty,
37data_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.DataImportId) = .empty,37data_imports: std.array_hash_map.Auto(String, Wasm.DataImportId) = .empty,
3838
39indirect_function_table: std.AutoArrayHashMapUnmanaged(Wasm.OutputFunctionIndex, void) = .empty,39indirect_function_table: std.array_hash_map.Auto(Wasm.OutputFunctionIndex, void) = .empty,
4040
41/// A subset of the full interned function type list created only during flush.41/// A subset of the full interned function type list created only during flush.
42func_types: std.AutoArrayHashMapUnmanaged(Wasm.FunctionType.Index, void) = .empty,42func_types: std.array_hash_map.Auto(Wasm.FunctionType.Index, void) = .empty,
4343
44/// For debug purposes only.44/// For debug purposes only.
45memory_layout_finished: bool = false,45memory_layout_finished: bool = false,
src/main.zig+7-7
...@@ -987,7 +987,7 @@ fn buildOutputType(...@@ -987,7 +987,7 @@ fn buildOutputType(
987 var test_no_exec = false;987 var test_no_exec = false;
988 var test_execve = false;988 var test_execve = false;
989 var entry: Compilation.CreateOptions.Entry = .default;989 var entry: Compilation.CreateOptions.Entry = .default;
990 var force_undefined_symbols: std.StringArrayHashMapUnmanaged(void) = .empty;990 var force_undefined_symbols: std.array_hash_map.String(void) = .empty;
991 var stack_size: ?u64 = null;991 var stack_size: ?u64 = null;
992 var image_base: ?u64 = null;992 var image_base: ?u64 = null;
993 var link_eh_frame_hdr = false;993 var link_eh_frame_hdr = false;
...@@ -1024,7 +1024,7 @@ fn buildOutputType(...@@ -1024,7 +1024,7 @@ fn buildOutputType(
1024 // These are before resolving sysroot.1024 // These are before resolving sysroot.
1025 var extra_cflags: std.ArrayList([]const u8) = .empty;1025 var extra_cflags: std.ArrayList([]const u8) = .empty;
1026 var extra_rcflags: std.ArrayList([]const u8) = .empty;1026 var extra_rcflags: std.ArrayList([]const u8) = .empty;
1027 var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;1027 var symbol_wrap_set: std.array_hash_map.String(void) = .empty;
1028 var rc_includes: std.zig.RcIncludes = .any;1028 var rc_includes: std.zig.RcIncludes = .any;
1029 var manifest_file: ?[]const u8 = null;1029 var manifest_file: ?[]const u8 = null;
1030 var linker_export_symbol_names: std.ArrayList([]const u8) = .empty;1030 var linker_export_symbol_names: std.ArrayList([]const u8) = .empty;
...@@ -3592,7 +3592,7 @@ fn buildOutputType(...@@ -3592,7 +3592,7 @@ fn buildOutputType(
3592 defer file_system_inputs.deinit(gpa);3592 defer file_system_inputs.deinit(gpa);
35933593
3594 // Deduplicate rpath entries3594 // Deduplicate rpath entries
3595 var rpath_dedup = std.StringArrayHashMapUnmanaged(void){};3595 var rpath_dedup = std.array_hash_map.String(void){};
3596 for (create_module.rpath_list.items) |rpath| {3596 for (create_module.rpath_list.items) |rpath| {
3597 try rpath_dedup.put(arena, rpath, {});3597 try rpath_dedup.put(arena, rpath, {});
3598 }3598 }
...@@ -3896,7 +3896,7 @@ fn buildOutputType(...@@ -3896,7 +3896,7 @@ fn buildOutputType(
38963896
3897const CreateModule = struct {3897const CreateModule = struct {
3898 dirs: Compilation.Directories,3898 dirs: Compilation.Directories,
3899 modules: std.StringArrayHashMapUnmanaged(CliModule),3899 modules: std.array_hash_map.String(CliModule),
3900 opts: Compilation.Config.Options,3900 opts: Compilation.Config.Options,
3901 dynamic_linker: ?[]const u8,3901 dynamic_linker: ?[]const u8,
3902 object_format: ?[]const u8,3902 object_format: ?[]const u8,
...@@ -3908,7 +3908,7 @@ const CreateModule = struct {...@@ -3908,7 +3908,7 @@ const CreateModule = struct {
3908 /// link_libcpp, and then the libraries are filtered into3908 /// link_libcpp, and then the libraries are filtered into
3909 /// `unresolved_link_inputs` and `windows_libs`.3909 /// `unresolved_link_inputs` and `windows_libs`.
3910 cli_link_inputs: std.ArrayList(link.UnresolvedInput),3910 cli_link_inputs: std.ArrayList(link.UnresolvedInput),
3911 windows_libs: std.StringArrayHashMapUnmanaged(void),3911 windows_libs: std.array_hash_map.String(void),
3912 /// The local variable `unresolved_link_inputs` is fed into library3912 /// The local variable `unresolved_link_inputs` is fed into library
3913 /// resolution, mutating the input array, and producing this data as3913 /// resolution, mutating the input array, and producing this data as
3914 /// output. Allocated with gpa.3914 /// output. Allocated with gpa.
...@@ -3926,7 +3926,7 @@ const CreateModule = struct {...@@ -3926,7 +3926,7 @@ const CreateModule = struct {
3926 lib_dir_args: std.ArrayList([]const u8),3926 lib_dir_args: std.ArrayList([]const u8),
3927 libc_installation: ?LibCInstallation,3927 libc_installation: ?LibCInstallation,
3928 want_native_include_dirs: bool,3928 want_native_include_dirs: bool,
3929 frameworks: std.StringArrayHashMapUnmanaged(Framework),3929 frameworks: std.array_hash_map.String(Framework),
3930 native_system_include_paths: []const []const u8,3930 native_system_include_paths: []const []const u8,
3931 framework_dirs: std.ArrayList([]const u8),3931 framework_dirs: std.ArrayList([]const u8),
3932 rpath_list: std.ArrayList([]const u8),3932 rpath_list: std.ArrayList([]const u8),
...@@ -4419,7 +4419,7 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {...@@ -4419,7 +4419,7 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {
44194419
4420 var file_name_bytes: std.ArrayList(u8) = .empty;4420 var file_name_bytes: std.ArrayList(u8) = .empty;
4421 defer file_name_bytes.deinit(gpa);4421 defer file_name_bytes.deinit(gpa);
4422 var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty;4422 var files: std.array_hash_map.Auto(Zcu.File.Index, void) = .empty;
4423 defer files.deinit(gpa);4423 defer files.deinit(gpa);
4424 var decl_data: std.ArrayList(u8) = .empty;4424 var decl_data: std.ArrayList(u8) = .empty;
4425 defer decl_data.deinit(gpa);4425 defer decl_data.deinit(gpa);
tools/dump-cov.zig+1-1
...@@ -67,7 +67,7 @@ pub fn main(init: std.process.Init) !void {...@@ -67,7 +67,7 @@ pub fn main(init: std.process.Init) !void {
67 try stdout.print("{any}\n", .{header.*});67 try stdout.print("{any}\n", .{header.*});
68 const pcs = header.pcAddrs();68 const pcs = header.pcAddrs();
6969
70 var indexed_pcs: std.AutoArrayHashMapUnmanaged(usize, void) = .empty;70 var indexed_pcs: std.array_hash_map.Auto(usize, void) = .empty;
71 try indexed_pcs.entries.resize(arena, pcs.len);71 try indexed_pcs.entries.resize(arena, pcs.len);
72 @memcpy(indexed_pcs.entries.items(.key), pcs);72 @memcpy(indexed_pcs.entries.items(.key), pcs);
73 try indexed_pcs.reIndex(arena);73 try indexed_pcs.reIndex(arena);