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,
4949/// Allocated into `gpa`.
5050memory_blocked_steps: std.ArrayList(Configuration.Step.Index),
5151/// Allocated into `gpa`.
52step_stack: std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),
52step_stack: std.array_hash_map.Auto(Configuration.Step.Index, void),
5353pkg_config: PkgConfig,
5454
5555error_style: ErrorStyle,
......@@ -481,7 +481,7 @@ pub fn main(init: process.Init.Minimal) !void {
481481 // maker process fails or crashes and it's helpful to be able to repeat
482482 // execution of the command line or otherwise inspect the configuration file.
483483 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;
485485 for (configuration.steps, 0..) |*conf_step, step_index_usize| {
486486 if (conf_step.owner != .root) continue;
487487 const step_index: Configuration.Step.Index = @enumFromInt(step_index_usize);
......@@ -1217,7 +1217,7 @@ fn printTreeStep(
12171217 step_index: Configuration.Step.Index,
12181218 stderr: Io.Terminal,
12191219 parent_node: *PrintNode,
1220 step_stack: *std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),
1220 step_stack: *std.array_hash_map.Auto(Configuration.Step.Index, void),
12211221) !void {
12221222 const writer = stderr.writer;
12231223 const first = step_stack.swapRemove(step_index);
......@@ -1502,7 +1502,7 @@ fn printChildNodePrefix(stderr: Io.Terminal) !void {
15021502fn constructGraphAndCheckForDependencyLoop(
15031503 maker: *Maker,
15041504 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),
15061506 rand: std.Random,
15071507) error{ DependencyLoopDetected, OutOfMemory }!void {
15081508 const c = &maker.scanned_config.configuration;
lib/compiler/Maker/Fuzz.zig+2-2
......@@ -27,7 +27,7 @@ prog_node: std.Progress.Node,
2727
2828/// Protects `coverage_files`.
2929coverage_mutex: Io.Mutex,
30coverage_files: std.AutoArrayHashMapUnmanaged(u64, CoverageMap),
30coverage_files: std.array_hash_map.Auto(u64, CoverageMap),
3131
3232queue_mutex: Io.Mutex,
3333queue_cond: Io.Condition,
......@@ -273,7 +273,7 @@ pub fn serveSourcesTar(fuzz: *Fuzz, req: *std.http.Server.Request) !void {
273273 defer arena_state.deinit();
274274 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);
277277 var dedup_table: DedupTable = .empty;
278278 defer dedup_table.deinit(gpa);
279279
lib/compiler/Maker/ScannedConfig.zig+1-1
......@@ -8,7 +8,7 @@ const Serializer = std.zon.Serializer;
88const Graph = @import("Graph.zig");
99
1010configuration: Configuration,
11top_level_steps: std.StringArrayHashMapUnmanaged(Configuration.Step.Index),
11top_level_steps: std.array_hash_map.String(Configuration.Step.Index),
1212path: []const u8,
1313
1414pub 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 {
180180 .table = .{},
181181 };
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);
184184 /// The special file name "." means any changes inside the directory.
185185 pub const Files = std.ArrayList([]const u8);
186186
lib/compiler/Maker/Step/Compile.zig+7-7
......@@ -119,9 +119,9 @@ fn updateGeneratedFile(
119119
120120/// List of importable modules in a compilation's module graph, including
121121/// 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);
123123/// 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
126126const ModuleListContext = struct {
127127 pub fn eql(ctx: @This(), a: ModuleList, b: ModuleList) bool {
......@@ -221,8 +221,8 @@ fn lowerZigArgs(
221221 // module, along with any C compiler arguments that need to be passed
222222 // to the compiler for each module individually as reported by
223223 // pkg-config.
224 var seen_system_libs: std.AutoArrayHashMapUnmanaged(Configuration.String, []const []const u8) = .empty;
225 var frameworks: std.AutoArrayHashMapUnmanaged(Configuration.String, Configuration.Module.Framework.Flags) = .empty;
224 var seen_system_libs: std.array_hash_map.Auto(Configuration.String, []const []const u8) = .empty;
225 var frameworks: std.array_hash_map.Auto(Configuration.String, Configuration.Module.Framework.Flags) = .empty;
226226 var module_graph: ModuleGraph = .empty;
227227
228228 var prev_has_cflags = false;
......@@ -1126,8 +1126,8 @@ fn moduleNeedsCliArg(mod: *const Configuration.Module, conf: *const Configuratio
11261126}
11271127
11281128const CliNamedModules = struct {
1129 modules: std.AutoArrayHashMapUnmanaged(Configuration.Module.Index, void),
1130 names: std.StringArrayHashMapUnmanaged(void),
1129 modules: std.array_hash_map.Auto(Configuration.Module.Index, void),
1130 names: std.array_hash_map.String(void),
11311131
11321132 /// Traverse the whole dependency graph and give every module a unique
11331133 /// name, ideally one named after what it's called somewhere in the graph.
......@@ -1177,7 +1177,7 @@ pub fn getCompileDependencies(
11771177 start: Configuration.Step.Index,
11781178 chase_dynamic: bool,
11791179) ![]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;
11811181 var compiles_i: usize = 0;
11821182
11831183 try compiles.putNoClobber(arena, start, {});
lib/compiler/Maker/Step/TranslateC.zig+1-1
......@@ -66,7 +66,7 @@ pub fn make(
6666
6767 var prev_search_strategy: std.Build.Module.SystemLib.SearchStrategy = .paths_first;
6868 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
7171 for (conf_tc.system_libs.slice) |system_lib_index| {
7272 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;
2727/// interested in noticing changes to.
2828///
2929/// 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
3232/// Special key of "." means any changes in this directory trigger the steps.
33const ReactionSet = std.StringArrayHashMapUnmanaged(StepSet);
34const StepSet = std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, Generation);
33const ReactionSet = std.array_hash_map.String(StepSet);
34const StepSet = std.array_hash_map.Auto(Configuration.Step.Index, Generation);
3535
3636const Generation = u8;
3737
......@@ -46,10 +46,10 @@ const Os = switch (builtin.os.tag) {
4646 handle_table: HandleTable,
4747 /// fanotify file descriptors are keyed by mount id since marks
4848 /// 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
5151 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
5454 const fan_mask: std.os.linux.fanotify.MarkMask = .{
5555 .CLOSE_WRITE = true,
......@@ -314,7 +314,7 @@ const Os = switch (builtin.os.tag) {
314314 const windows = std.os.windows;
315315
316316 /// 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),
318318 ready_dirs: std.DoublyLinkedList,
319319
320320 const FileId = struct {
lib/compiler/aro/aro/Compilation.zig+2-2
......@@ -140,7 +140,7 @@ io: Io,
140140cwd: std.Io.Dir,
141141diagnostics: *Diagnostics,
142142
143sources: std.StringArrayHashMapUnmanaged(Source) = .empty,
143sources: std.array_hash_map.String(Source) = .empty,
144144source_aliases: std.ArrayList(Source) = .empty,
145145/// Allocated into `gpa`, but keys are externally managed.
146146search_path: std.ArrayList(Include) = .empty,
......@@ -159,7 +159,7 @@ builtins: Builtins = .{},
159159string_interner: StringInterner = .{},
160160interner: Interner = .{},
161161type_store: TypeStore = .{},
162pragma_handlers: std.StringArrayHashMapUnmanaged(*Pragma) = .empty,
162pragma_handlers: std.array_hash_map.String(*Pragma) = .empty,
163163/// If this is not null, the directory containing the specified Source will be searched for includes
164164/// Used by MS extensions which allow searching for includes relative to the directory of the main source file.
165165ms_cwd_source_id: ?Source.Id = null,
lib/compiler/aro/aro/DepFile.zig+1-1
......@@ -6,7 +6,7 @@ pub const Format = enum { make, nmake };
66const DepFile = @This();
77
88target: []const u8,
9deps: std.StringArrayHashMapUnmanaged(void) = .empty,
9deps: std.array_hash_map.String(void) = .empty,
1010format: Format,
1111
1212pub fn deinit(d: *DepFile, gpa: Allocator) void {
lib/compiler/aro/aro/Preprocessor.zig+1-1
......@@ -23,7 +23,7 @@ const Tree = @import("Tree.zig");
2323const Token = Tree.Token;
2424const TokenWithExpansionLocs = Tree.TokenWithExpansionLocs;
2525
26const DefineMap = std.StringArrayHashMapUnmanaged(Macro);
26const DefineMap = std.array_hash_map.String(Macro);
2727const RawTokenList = std.ArrayList(RawToken);
2828const max_include_depth = 200;
2929
lib/compiler/aro/aro/StringInterner.zig+1-1
......@@ -19,7 +19,7 @@ pub const StringId = enum(u32) {
1919 }
2020};
2121
22table: std.StringArrayHashMapUnmanaged(void) = .empty,
22table: std.array_hash_map.String(void) = .empty,
2323
2424pub fn deinit(si: *StringInterner, allocator: mem.Allocator) void {
2525 si.table.deinit(allocator);
lib/compiler/aro/backend/Interner.zig+1-1
......@@ -8,7 +8,7 @@ const Limb = std.math.big.Limb;
88
99const Interner = @This();
1010
11map: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
11map: std.array_hash_map.Auto(void, void) = .empty,
1212items: std.MultiArrayList(struct {
1313 tag: Tag,
1414 data: u32,
lib/compiler/aro/backend/Ir.zig+4-4
......@@ -7,7 +7,7 @@ const Object = @import("Object.zig");
77const Ir = @This();
88
99interner: *Interner,
10decls: std.StringArrayHashMapUnmanaged(Decl),
10decls: std.array_hash_map.String(Decl),
1111
1212pub const Decl = struct {
1313 instructions: std.MultiArrayList(Inst),
......@@ -26,7 +26,7 @@ pub const Builder = struct {
2626 arena: std.heap.ArenaAllocator,
2727 interner: *Interner,
2828
29 decls: std.StringArrayHashMapUnmanaged(Decl) = .empty,
29 decls: std.array_hash_map.String(Decl) = .empty,
3030 instructions: std.MultiArrayList(Ir.Inst) = .empty,
3131 body: std.ArrayList(Ref) = .empty,
3232 alloc_count: u32 = 0,
......@@ -181,7 +181,7 @@ pub const Renderer = struct {
181181 ir: *const Ir,
182182 errors: ErrorList = .{},
183183
184 pub const ErrorList = std.StringArrayHashMapUnmanaged([]const u8);
184 pub const ErrorList = std.array_hash_map.String([]const u8);
185185
186186 pub const Error = Allocator.Error || error{LowerFail};
187187
......@@ -380,7 +380,7 @@ const REF = std.Io.Terminal.Color.bright_blue;
380380const LITERAL = std.Io.Terminal.Color.bright_green;
381381const ATTRIBUTE = std.Io.Terminal.Color.bright_yellow;
382382
383const RefMap = std.AutoArrayHashMapUnmanaged(Ref, void);
383const RefMap = std.array_hash_map.Auto(Ref, void);
384384
385385pub 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 {
160160const Serialize = struct {
161161 arena: Allocator,
162162 wc: *Configuration.Wip,
163 module_map: std.AutoArrayHashMapUnmanaged(*std.Build.Module, Configuration.Module.Index) = .empty,
164 package_map: std.AutoArrayHashMapUnmanaged(*std.Build, Configuration.Package.Index) = .empty,
163 module_map: std.array_hash_map.Auto(*std.Build.Module, Configuration.Module.Index) = .empty,
164 package_map: std.array_hash_map.Auto(*std.Build, Configuration.Package.Index) = .empty,
165165 /// 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
168168 fn builderToPackage(s: *Serialize, b: *std.Build) !Configuration.Package.Index {
169169 if (b.pkg_hash.len == 0) return .root;
lib/compiler/reduce/Walk.zig+2-2
......@@ -44,7 +44,7 @@ pub const Transformation = union(enum) {
4444 imported_string: []const u8,
4545 /// Identifier names that must be renamed in the inlined code or else
4646 /// will cause ambiguous reference errors.
47 in_scope_names: std.StringArrayHashMapUnmanaged(void),
47 in_scope_names: std.array_hash_map.String(void),
4848 };
4949};
5050
......@@ -723,7 +723,7 @@ fn walkBuiltinCall(
723723 try w.transformations.append(.{ .inline_imported_file = .{
724724 .builtin_call_node = call_node,
725725 .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(
727727 w.arena,
728728 w.in_scope_names.keys(),
729729 &.{},
lib/compiler/resinator/cli.zig+1-1
......@@ -159,7 +159,7 @@ pub const Options = struct {
159159 default_language_id: ?u16 = null,
160160 default_code_page: ?SupportedCodePage = null,
161161 verbose: bool = false,
162 symbols: std.StringArrayHashMapUnmanaged(SymbolValue) = .empty,
162 symbols: std.array_hash_map.String(SymbolValue) = .empty,
163163 null_terminate_string_table_strings: bool = false,
164164 max_string_literal_codepoints: u15 = lex.default_max_string_literal_codepoints,
165165 silent_duplicate_control_ids: bool = false,
lib/compiler/resinator/compile.zig+2-2
......@@ -3049,7 +3049,7 @@ pub const StringTablesByLanguage = struct {
30493049 /// when the first STRINGTABLE for the language was defined, and all blocks for a given
30503050 /// language are written contiguously.
30513051 /// 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
30543054 pub fn deinit(self: *StringTablesByLanguage, allocator: Allocator) void {
30553055 self.tables.deinit(allocator);
......@@ -3080,7 +3080,7 @@ pub const StringTable = struct {
30803080 /// was added to the block (i.e. `STRINGTABLE { 16 "b" 0 "a" }` would then get written
30813081 /// with block ID 2 (the one with "b") first and block ID 1 (the one with "a") second).
30823082 /// 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
30853085 pub const Block = struct {
30863086 strings: std.ArrayList(Token) = .empty,
lib/compiler/resinator/cvtres.zig+5-5
......@@ -439,9 +439,9 @@ pub const ResourceDataEntry = extern struct {
439439
440440/// type -> name -> language
441441const ResourceTree = struct {
442 type_to_name_map: std.ArrayHashMapUnmanaged(NameOrOrdinal, NameToLanguageMap, NameOrOrdinalHashContext, true),
443 rsrc_string_table: std.ArrayHashMapUnmanaged(NameOrOrdinal, void, NameOrOrdinalHashContext, true),
444 deduplicated_data: std.StringArrayHashMapUnmanaged(u32),
442 type_to_name_map: std.array_hash_map.Custom(NameOrOrdinal, NameToLanguageMap, NameOrOrdinalHashContext, true),
443 rsrc_string_table: std.array_hash_map.Custom(NameOrOrdinal, void, NameOrOrdinalHashContext, true),
444 deduplicated_data: std.array_hash_map.String(u32),
445445 data_offsets: std.ArrayList(u32),
446446 rsrc02_len: u32,
447447 coff_options: CoffOptions,
......@@ -451,8 +451,8 @@ const ResourceTree = struct {
451451 resource: *const Resource,
452452 original_index: usize,
453453 };
454 const LanguageToResourceMap = std.AutoArrayHashMapUnmanaged(Language, RelocatableResource);
455 const NameToLanguageMap = std.ArrayHashMapUnmanaged(NameOrOrdinal, LanguageToResourceMap, NameOrOrdinalHashContext, true);
454 const LanguageToResourceMap = std.array_hash_map.Auto(Language, RelocatableResource);
455 const NameToLanguageMap = std.array_hash_map.Custom(NameOrOrdinal, LanguageToResourceMap, NameOrOrdinalHashContext, true);
456456
457457 const NameOrOrdinalHashContext = struct {
458458 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");
77
88const Scope = @This();
99
10pub const SymbolTable = std.StringArrayHashMapUnmanaged(ast.Node);
10pub const SymbolTable = std.array_hash_map.String(ast.Node);
1111pub const AliasList = std.ArrayList(struct {
1212 alias: []const u8,
1313 name: []const u8,
......@@ -18,7 +18,7 @@ pub const ContainerMemberFns = struct {
1818 container_decl_ptr: *ast.Node,
1919 member_fns: std.ArrayList(*ast.Payload.Func) = .empty,
2020};
21pub const ContainerMemberFnsHashMap = std.ArrayHashMapUnmanaged(
21pub const ContainerMemberFnsHashMap = std.array_hash_map.Custom(
2222 aro.QualType,
2323 ContainerMemberFns,
2424 struct {
......@@ -79,7 +79,7 @@ pub const Block = struct {
7979 /// will be used. This maps the variable's name to the Discard payload, so that if
8080 /// the variable is subsequently referenced we can indicate that the discard should
8181 /// 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
8484 /// When the block corresponds to a function, keep track of the return type
8585 /// so that the return expression can be cast, if necessary
......@@ -209,7 +209,7 @@ pub const Root = struct {
209209 base: Scope,
210210 translator: *Translator,
211211 sym_table: SymbolTable,
212 blank_macros: std.StringArrayHashMapUnmanaged(void),
212 blank_macros: std.array_hash_map.String(void),
213213 nodes: std.ArrayList(ast.Node),
214214 container_member_fns_map: ContainerMemberFnsHashMap,
215215
......@@ -267,7 +267,7 @@ pub const Root = struct {
267267 const gpa = root.translator.gpa;
268268 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;
271271 defer member_names.deinit(gpa);
272272 for (root.container_member_fns_map.keys(), root.container_member_fns_map.values()) |container_qt, members| {
273273 // Get the container name
lib/compiler/translate-c/Translator.zig+4-4
......@@ -106,7 +106,7 @@ global_scope: *Scope.Root,
106106mangle_count: u32 = 0,
107107
108108/// 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,
110110/// Table of record decls that have been demoted to opaques.
111111opaque_demotes: std.HashMapUnmanaged(QualType, void, QualTypeHashContext, std.hash_map.default_max_load_percentage) = .empty,
112112/// Table of unnamed enums and records that are child types of typedefs.
......@@ -123,7 +123,7 @@ anonymous_record_field_names: std.HashMapUnmanaged(
123123/// a list of names that we found by visiting all the top level decls without
124124/// translating them. The other maps are updated as we translate; this one is updated
125125/// up front in a pre-processing step.
126global_names: std.StringArrayHashMapUnmanaged(void) = .empty,
126global_names: std.array_hash_map.String(void) = .empty,
127127
128128/// This is similar to `global_names`, but contains names which we would
129129/// *like* to use, but do not strictly *have* to if they are unavailable.
......@@ -132,11 +132,11 @@ global_names: std.StringArrayHashMapUnmanaged(void) = .empty,
132132/// may be mangled.
133133/// This is distinct from `global_names` so we can detect at a type
134134/// 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
137137/// Set of identifiers known to refer to typedef declarations.
138138/// Used when parsing macros.
139typedefs: std.StringArrayHashMapUnmanaged(void) = .empty,
139typedefs: std.array_hash_map.String(void) = .empty,
140140
141141/// The lhs lval of a compound assignment expression.
142142compound_assign_dummy: ?ZigNode = null,
lib/docs/wasm/Walk.zig+9-9
......@@ -10,9 +10,9 @@ const Oom = error{OutOfMemory};
1010
1111pub const Decl = @import("Decl.zig");
1212
13pub var files: std.StringArrayHashMapUnmanaged(File) = .empty;
13pub var files: std.array_hash_map.String(File) = .empty;
1414pub 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
1717file: File.Index,
1818
......@@ -42,17 +42,17 @@ pub const Category = union(enum(u8)) {
4242pub const File = struct {
4343 ast: Ast,
4444 /// 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,
4646 /// 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,
4848 /// 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,
5050 /// 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,
5252 /// root node => its namespace scope
5353 /// struct/union/enum/opaque decl node => its namespace scope
5454 /// 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
5757 pub fn lookup_token(file: *File, token: Ast.TokenIndex) Decl.Index {
5858 const decl_node = file.ident_decls.get(token) orelse return .none;
......@@ -465,8 +465,8 @@ pub const Scope = struct {
465465 const Namespace = struct {
466466 base: Scope = .{ .tag = .namespace },
467467 parent: *Scope,
468 names: std.StringArrayHashMapUnmanaged(Ast.Node.Index) = .empty,
469 doctests: std.StringArrayHashMapUnmanaged(Ast.Node.Index) = .empty,
468 names: std.array_hash_map.String(Ast.Node.Index) = .empty,
469 doctests: std.array_hash_map.String(Ast.Node.Index) = .empty,
470470 decl_index: Decl.Index,
471471 };
472472
lib/docs/wasm/main.zig+4-4
......@@ -264,7 +264,7 @@ const ErrorIdentifier = packed struct(u64) {
264264};
265265
266266var 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
269269export fn decl_error_set(decl_index: Decl.Index) Slice(ErrorIdentifier) {
270270 return Slice(ErrorIdentifier).init(decl_error_set_fallible(decl_index) catch @panic("OOM"));
......@@ -305,7 +305,7 @@ fn sort_error_set_result() void {
305305
306306fn addErrorsFromDecl(
307307 decl_index: Decl.Index,
308 out: *std.StringArrayHashMapUnmanaged(ErrorIdentifier),
308 out: *std.array_hash_map.String(ErrorIdentifier),
309309) Oom!void {
310310 switch (decl_index.get().categorize()) {
311311 .error_set => |node| try addErrorsFromExpr(decl_index, out, node),
......@@ -316,7 +316,7 @@ fn addErrorsFromDecl(
316316
317317fn addErrorsFromExpr(
318318 decl_index: Decl.Index,
319 out: *std.StringArrayHashMapUnmanaged(ErrorIdentifier),
319 out: *std.array_hash_map.String(ErrorIdentifier),
320320 node: Ast.Node.Index,
321321) Oom!void {
322322 const decl = decl_index.get();
......@@ -343,7 +343,7 @@ fn addErrorsFromExpr(
343343
344344fn addErrorsFromNode(
345345 decl_index: Decl.Index,
346 out: *std.StringArrayHashMapUnmanaged(ErrorIdentifier),
346 out: *std.array_hash_map.String(ErrorIdentifier),
347347 node: Ast.Node.Index,
348348) Oom!void {
349349 const decl = decl_index.get();
lib/fuzzer.zig+3-3
......@@ -340,7 +340,7 @@ const Fuzzer = struct {
340340 quality_buf: []Input.Best,
341341 input_buf: []Input.Best.Map,
342342 },
343 seen_uids: std.ArrayHashMapUnmanaged(Uid, struct {
343 seen_uids: std.array_hash_map.Custom(Uid, struct {
344344 slices: union {
345345 ints: std.ArrayList([]u64),
346346 bytes: std.ArrayList(Input.Data.Bytes),
......@@ -505,7 +505,7 @@ const Fuzzer = struct {
505505 }
506506 };
507507
508 pub const UidSlices = std.ArrayHashMapUnmanaged(Uid, struct {
508 pub const UidSlices = std.array_hash_map.Custom(Uid, struct {
509509 base: u32,
510510 len: u32,
511511 }, Uid.hashmap_ctx, false);
......@@ -584,7 +584,7 @@ const Fuzzer = struct {
584584 };
585585
586586 pub const Builder = struct {
587 uid_slices: std.ArrayHashMapUnmanaged(Uid, union {
587 uid_slices: std.array_hash_map.Custom(Uid, union {
588588 ints: std.MultiArrayList(struct {
589589 value: u64,
590590 order_i: u32,
lib/std/Build.zig+3-3
......@@ -33,7 +33,7 @@ user_input_options: UserInputOptionsMap,
3333available_options_map: std.array_hash_map.String(AvailableOption) = .empty,
3434invalid_user_input: bool,
3535default_step: *Step,
36top_level_steps: std.StringArrayHashMapUnmanaged(*Step.TopLevel),
36top_level_steps: std.array_hash_map.String(*Step.TopLevel),
3737/// Path to the directory containing build.zig.
3838root: Cache.Path,
3939debug_log_scopes: []const []const u8 = &.{},
......@@ -78,11 +78,11 @@ pub const Graph = struct {
7878 io: Io,
7979 /// Process lifetime.
8080 arena: Allocator,
81 system_integration_options: std.StringArrayHashMapUnmanaged(SystemLibraryMode) = .empty,
81 system_integration_options: std.array_hash_map.String(SystemLibraryMode) = .empty,
8282 system_package_mode: bool = false,
8383 zig_exe: []const u8,
8484 environ_map: process.Environ.Map,
85 needed_lazy_dependencies: std.StringArrayHashMapUnmanaged(void) = .empty,
85 needed_lazy_dependencies: std.array_hash_map.String(void) = .empty,
8686 /// Information about the native target. Computed before build() is invoked.
8787 host: ResolvedTarget,
8888 dependency_cache: InitializedDepMap = .empty,
lib/std/Build/Cache.zig+1-1
......@@ -351,7 +351,7 @@ pub const Manifest = struct {
351351 };
352352 };
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
356356 pub const FilesContext = struct {
357357 pub fn hash(fc: FilesContext, file: File) u32 {
lib/std/Build/Module.zig+3-3
......@@ -12,7 +12,7 @@ root_source_file: ?LazyPath,
1212/// The modules that are mapped into this module's import table.
1313/// Use `addImport` rather than modifying this field directly in order to
1414/// maintain step dependency edges.
15import_table: std.StringArrayHashMapUnmanaged(*Module),
15import_table: std.array_hash_map.String(*Module),
1616
1717resolved_target: ?std.Build.ResolvedTarget = null,
1818optimize: ?std.builtin.OptimizeMode = null,
......@@ -22,7 +22,7 @@ c_macros: ArrayList([]const u8),
2222include_dirs: ArrayList(IncludeDir),
2323lib_paths: ArrayList(LazyPath),
2424rpaths: ArrayList(RPath),
25frameworks: std.StringArrayHashMapUnmanaged(LinkFrameworkOptions),
25frameworks: std.array_hash_map.String(LinkFrameworkOptions),
2626link_objects: ArrayList(LinkObject),
2727
2828strip: ?bool,
......@@ -563,7 +563,7 @@ pub fn getGraph(root: *Module) Graph {
563563
564564 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;
567567 var next_idx: usize = 0;
568568
569569 modules.putNoClobber(arena, root, "root") catch @panic("OOM");
lib/std/Build/Step/Compile.zig+2-2
......@@ -187,7 +187,7 @@ entry: Entry = .default,
187187/// List of symbols forced as undefined in the symbol table
188188/// thus forcing their resolution by the linker.
189189/// 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
192192/// Overrides the default stack size
193193stack_size: ?u64 = null,
......@@ -759,7 +759,7 @@ pub fn rootModuleTarget(c: *Compile) std.Target {
759759pub fn getCompileDependencies(start: *Compile, chase_dynamic: bool) []const *Compile {
760760 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;
763763 var next_idx: usize = 0;
764764
765765 compiles.putNoClobber(arena, start, {}) catch @panic("OOM");
lib/std/Io/Kqueue.zig+1-1
......@@ -40,7 +40,7 @@ const Thread = struct {
4040 steal_ready_search_index: u32,
4141 /// For ensuring multiple fibers waiting on the same file descriptor and
4242 /// filter use the same kevent.
43 wait_queues: std.AutoArrayHashMapUnmanaged(WaitQueueKey, *Fiber),
43 wait_queues: std.array_hash_map.Auto(WaitQueueKey, *Fiber),
4444
4545 const WaitQueueKey = struct {
4646 ident: usize,
lib/std/debug/Coverage.zig+2-2
......@@ -15,13 +15,13 @@ const assert = std.debug.assert;
1515/// String memory references the memory-mapped debug information.
1616///
1717/// Protected by `mutex`.
18directories: std.ArrayHashMapUnmanaged(String, void, String.MapContext, false),
18directories: std.array_hash_map.Custom(String, void, String.MapContext, false),
1919/// Provides a globally-scoped integer index for files.
2020///
2121/// String memory references the memory-mapped debug information.
2222///
2323/// Protected by `mutex`.
24files: std.ArrayHashMapUnmanaged(File, void, File.MapContext, false),
24files: std.array_hash_map.Custom(File, void, File.MapContext, false),
2525string_bytes: std.ArrayList(u8),
2626/// Protects the other fields.
2727mutex: Io.Mutex,
lib/std/debug/Dwarf.zig+1-1
......@@ -134,7 +134,7 @@ pub const CompileUnit = struct {
134134 files: []FileEntry,
135135 version: u16,
136136
137 pub const LineTable = std.AutoArrayHashMapUnmanaged(u64, LineEntry);
137 pub const LineTable = std.array_hash_map.Auto(u64, LineEntry);
138138
139139 pub const LineEntry = struct {
140140 line: u32,
lib/std/debug/MachOFile.zig+5-5
......@@ -4,7 +4,7 @@ strings: []const u8,
44text_vmaddr: u64,
55
66/// 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
99pub const Error = error{
1010 InvalidMachO,
......@@ -115,7 +115,7 @@ pub fn load(gpa: Allocator, io: Io, path: []const u8, arch: std.Target.Cpu.Arch)
115115 // necessary because we prefer to use STAB ("symbolic debugging table") symbols,
116116 // but they might not be present, so we track normal symbols too.
117117 // 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;
119119 defer symbol_names.deinit(gpa);
120120 try symbol_names.ensureUnusedCapacity(gpa, symtab.nsyms);
121121
......@@ -305,7 +305,7 @@ const OFile = struct {
305305 symtab_raw: []align(1) const macho.nlist_64,
306306 /// All named symbols in `symtab_raw`. Stored `u32` key is the index into `symtab_raw`. Accessed
307307 /// 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
310310 const SymbolAdapter = struct {
311311 strtab: []const u8,
......@@ -380,7 +380,7 @@ test {
380380
381381fn appendStabSymbol(
382382 symbols: *std.ArrayList(Symbol),
383 symbol_names: *std.StringArrayHashMapUnmanaged(void),
383 symbol_names: *std.array_hash_map.String(void),
384384 strings: []const u8,
385385 last_sym: Symbol,
386386) void {
......@@ -476,7 +476,7 @@ fn loadOFile(gpa: Allocator, io: Io, o_file_name: []const u8) !OFile {
476476 const symtab_raw: []align(1) const macho.nlist_64 = @ptrCast(mapped_ofile[symtab_cmd.symoff..][0..n_sym_bytes]);
477477
478478 // 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;
480480 defer symbols_by_name.deinit(gpa);
481481 try symbols_by_name.ensureUnusedCapacity(gpa, @intCast(symtab_raw.len));
482482 for (symtab_raw, 0..) |sym_raw, sym_index| {
lib/std/debug/SelfInfo/MachO.zig+1-1
......@@ -1,6 +1,6 @@
11mutex: Io.Mutex,
22/// Accessed through `Module.Adapter`.
3modules: std.ArrayHashMapUnmanaged(Module, void, Module.Context, false),
3modules: std.array_hash_map.Custom(Module, void, Module.Context, false),
44
55pub const init: SelfInfo = .{
66 .mutex = .init,
lib/std/json/hashmap.zig+4-4
......@@ -6,20 +6,20 @@ const innerParse = @import("static.zig").innerParse;
66const innerParseFromValue = @import("static.zig").innerParseFromValue;
77const Value = @import("dynamic.zig").Value;
88
9/// A thin wrapper around `std.StringArrayHashMapUnmanaged` that implements
9/// A thin wrapper around `std.array_hash_map.String` that implements
1010/// `jsonParse`, `jsonParseFromValue`, and `jsonStringify`.
1111/// This is useful when your JSON schema has an object with arbitrary data keys
1212/// instead of comptime-known struct field names.
1313pub fn ArrayHashMap(comptime T: type) type {
1414 return struct {
15 map: std.StringArrayHashMapUnmanaged(T) = .empty,
15 map: std.array_hash_map.String(T) = .empty,
1616
1717 pub fn deinit(self: *@This(), allocator: Allocator) void {
1818 self.map.deinit(allocator);
1919 }
2020
2121 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;
2323 errdefer map.deinit(allocator);
2424
2525 if (.object_begin != try source.next()) return error.UnexpectedToken;
......@@ -52,7 +52,7 @@ pub fn ArrayHashMap(comptime T: type) type {
5252 pub fn jsonParseFromValue(allocator: Allocator, source: Value, options: ParseOptions) !@This() {
5353 if (source != .object) return error.UnexpectedToken;
5454
55 var map: std.StringArrayHashMapUnmanaged(T) = .empty;
55 var map: std.array_hash_map.String(T) = .empty;
5656 errdefer map.deinit(allocator);
5757
5858 var it = source.object.iterator();
lib/std/process/Environ.zig+1-1
......@@ -101,7 +101,7 @@ pub const Map = struct {
101101 array_hash_map: ArrayHashMap,
102102 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
106106 pub const Size = usize;
107107
lib/std/process/Preopens.zig+1-1
......@@ -16,7 +16,7 @@ pub const empty: Preopens = switch (native_os) {
1616
1717pub const Map = switch (native_os) {
1818 // Indexed by file descriptor number.
19 .wasi => std.StringArrayHashMapUnmanaged(void),
19 .wasi => std.array_hash_map.String(void),
2020 else => void,
2121};
2222
lib/std/zig/Ast/Render.zig+1-1
......@@ -42,7 +42,7 @@ pub const Fixups = struct {
4242 /// These nodes will be replaced with a different node.
4343 replace_nodes_with_node: std.AutoHashMapUnmanaged(Ast.Node.Index, Ast.Node.Index) = .empty,
4444 /// 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
4747 /// All `@import` builtin calls which refer to a file path will be prefixed
4848 /// with this path.
lib/std/zig/AstGen.zig+5-5
......@@ -52,7 +52,7 @@ within_fn: bool = false,
5252fn_ret_ty: Zir.Inst.Ref = .none,
5353/// Maps string table indexes to the first `@import` ZIR instruction
5454/// 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,
5656/// Used for temporary storage when building payloads.
5757scratch: std.ArrayList(u32) = .empty,
5858/// Whenever a `ref` instruction is needed, it is created and saved in this
......@@ -11163,7 +11163,7 @@ const Scope = struct {
1116311163 declaring_gz: ?*GenZir,
1116411164
1116511165 /// 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
1116811168 fn deinit(self: *Namespace, gpa: Allocator) void {
1116911169 self.decls.deinit(gpa);
......@@ -12856,9 +12856,9 @@ fn scanContainer(
1285612856 var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, astgen.gpa);
1285712857 const bfa = bfa_state.allocator();
1285812858
12859 var names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;
12860 var test_names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;
12861 var decltest_names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;
12859 var names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
12860 var test_names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
12861 var decltest_names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
1286212862 defer {
1286312863 names.deinit(bfa);
1286412864 test_names.deinit(bfa);
lib/std/zig/llvm/Builder.zig+21-21
......@@ -21,25 +21,25 @@ data_layout: String,
2121target_triple: String,
2222module_asm: std.ArrayList(u8),
2323
24string_map: std.AutoArrayHashMapUnmanaged(void, void),
24string_map: std.array_hash_map.Auto(void, void),
2525string_indices: std.ArrayList(u32),
2626string_bytes: std.ArrayList(u8),
2727
28types: std.AutoArrayHashMapUnmanaged(String, Type),
28types: std.array_hash_map.Auto(String, Type),
2929next_unnamed_type: String,
3030next_unique_type_id: std.AutoHashMapUnmanaged(String, u32),
31type_map: std.AutoArrayHashMapUnmanaged(void, void),
31type_map: std.array_hash_map.Auto(void, void),
3232type_items: std.ArrayList(Type.Item),
3333type_extra: std.ArrayList(u32),
3434
35attributes: std.AutoArrayHashMapUnmanaged(Attribute.Storage, void),
36attributes_map: std.AutoArrayHashMapUnmanaged(void, void),
35attributes: std.array_hash_map.Auto(Attribute.Storage, void),
36attributes_map: std.array_hash_map.Auto(void, void),
3737attributes_indices: std.ArrayList(u32),
3838attributes_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),
4343next_unnamed_global: StrtabString,
4444next_replaced_global: StrtabString,
4545next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32),
......@@ -47,28 +47,28 @@ aliases: std.ArrayList(Alias),
4747variables: std.ArrayList(Variable),
4848functions: std.ArrayList(Function),
4949
50strtab_string_map: std.AutoArrayHashMapUnmanaged(void, void),
50strtab_string_map: std.array_hash_map.Auto(void, void),
5151strtab_string_indices: std.ArrayList(u32),
5252strtab_string_bytes: std.ArrayList(u8),
5353
54constant_map: std.AutoArrayHashMapUnmanaged(void, void),
54constant_map: std.array_hash_map.Auto(void, void),
5555constant_items: std.MultiArrayList(Constant.Item),
5656constant_extra: std.ArrayList(u32),
5757constant_limbs: std.ArrayList(std.math.big.Limb),
5858
5959alignment_forward_references: std.ArrayList(Alignment),
6060
61metadata_map: std.AutoArrayHashMapUnmanaged(void, void),
61metadata_map: std.array_hash_map.Auto(void, void),
6262metadata_items: std.MultiArrayList(Metadata.Item),
6363metadata_extra: std.ArrayList(u32),
6464metadata_limbs: std.ArrayList(std.math.big.Limb),
6565metadata_forward_references: std.ArrayList(Metadata.Optional),
66metadata_named: std.AutoArrayHashMapUnmanaged(String, struct {
66metadata_named: std.array_hash_map.Auto(String, struct {
6767 len: u32,
6868 index: Metadata.Item.ExtraIndex,
6969}),
7070
71metadata_string_map: std.AutoArrayHashMapUnmanaged(void, void),
71metadata_string_map: std.array_hash_map.Auto(void, void),
7272metadata_string_indices: std.ArrayList(u32),
7373metadata_string_bytes: std.ArrayList(u8),
7474
......@@ -1633,7 +1633,7 @@ pub const FunctionAttributes = enum(u32) {
16331633 pub const Wip = struct {
16341634 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);
16371637 const Maps = std.ArrayList(Map);
16381638
16391639 pub fn deinit(self: *Wip, builder: *const Builder) void {
......@@ -5235,8 +5235,8 @@ pub const WipFunction = struct {
52355235 instructions: std.MultiArrayList(Instruction),
52365236 names: std.ArrayList(String),
52375237 strip: bool,
5238 debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation),
5239 debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void),
5238 debug_locations: std.array_hash_map.Auto(Instruction.Index, DebugLocation),
5239 debug_values: std.array_hash_map.Auto(Instruction.Index, void),
52405240 extra: std.ArrayList(u32),
52415241
52425242 pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 };
......@@ -8451,7 +8451,7 @@ pub const Metadata = packed struct(u32) {
84518451 const Formatter = struct {
84528452 builder: *Builder,
84538453 need_comma: bool,
8454 map: std.AutoArrayHashMapUnmanaged(union(enum) {
8454 map: std.array_hash_map.Auto(union(enum) {
84558455 metadata: Metadata,
84568456 debug_location: DebugLocation.Location,
84578457 }, void) = .empty,
......@@ -9791,7 +9791,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
97919791 }
97929792 }
97939793
9794 var attribute_groups: std.AutoArrayHashMapUnmanaged(Attributes, void) = .empty;
9794 var attribute_groups: std.array_hash_map.Auto(Attributes, void) = .empty;
97959795 defer attribute_groups.deinit(self.gpa);
97969796
97979797 for (0.., self.functions.items) |function_i, function| {
......@@ -13507,7 +13507,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
1350713507 try type_block.end();
1350813508 }
1350913509
13510 var attributes_set: std.AutoArrayHashMapUnmanaged(struct {
13510 var attributes_set: std.array_hash_map.Auto(struct {
1351113511 attributes: Attributes,
1351213512 index: u32,
1351313513 }, void) = .{};
......@@ -13743,7 +13743,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
1374313743 try paramattr_block.end();
1374413744 }
1374513745
13746 var globals: std.AutoArrayHashMapUnmanaged(Global.Index, void) = .empty;
13746 var globals: std.array_hash_map.Auto(Global.Index, void) = .empty;
1374713747 defer globals.deinit(self.gpa);
1374813748 try globals.ensureUnusedCapacity(
1374913749 self.gpa,
......@@ -13784,7 +13784,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
1378413784
1378513785 const ConstantAdapter = struct {
1378613786 builder: *const Builder,
13787 globals: *const std.AutoArrayHashMapUnmanaged(Global.Index, void),
13787 globals: *const std.array_hash_map.Auto(Global.Index, void),
1378813788
1378913789 pub fn get(adapter: @This(), param: anytype) switch (@TypeOf(param)) {
1379013790 Constant => u32,
......@@ -13815,7 +13815,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
1381513815
1381613816 // Globals
1381713817 {
13818 var section_map: std.AutoArrayHashMapUnmanaged(String, void) = .empty;
13818 var section_map: std.array_hash_map.Auto(String, void) = .empty;
1381913819 defer section_map.deinit(self.gpa);
1382013820 try section_map.ensureUnusedCapacity(self.gpa, globals.count());
1382113821
src/Compilation.zig+19-19
......@@ -87,7 +87,7 @@ link_inputs: []const link.Input,
8787framework_dirs: []const []const u8,
8888/// These are only for DLLs dependencies fulfilled by the `.def` files shipped
8989/// with Zig. Static libraries are provided as `link.Input` values.
90windows_libs: std.StringArrayHashMapUnmanaged(void),
90windows_libs: std.array_hash_map.String(void),
9191/// The number of items in `windows_libs` which we have already built. All items at or after this
9292/// index will be built in `performAllTheWork`.
9393windows_libs_num_done: u32,
......@@ -101,10 +101,10 @@ native_system_include_paths: []const []const u8,
101101/// List of symbols forced as undefined in the symbol table
102102/// thus forcing their resolution by the linker.
103103/// 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,
107win32_resource_table: if (dev.env.supports(.win32_resource)) std.AutoArrayHashMapUnmanaged(*Win32Resource, void) else struct {
106c_object_table: std.array_hash_map.Auto(*CObject, void) = .empty,
107win32_resource_table: if (dev.env.supports(.win32_resource)) std.array_hash_map.Auto(*Win32Resource, void) else struct {
108108 pub fn keys(_: @This()) [0]void {
109109 return .{};
110110 }
......@@ -145,11 +145,11 @@ win32_resource_work_queue: if (dev.env.supports(.win32_resource)) std.Deque(*Win
145145
146146/// The ErrorMsg memory is owned by the `CObject`, using Compilation's general purpose allocator.
147147/// 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
150150/// The ErrorBundle memory is owned by the `Win32Resource`, using Compilation's general purpose allocator.
151151/// 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 {
153153 pub fn values(_: @This()) [0]void {
154154 return .{};
155155 }
......@@ -157,7 +157,7 @@ failed_win32_resources: if (dev.env.supports(.win32_resource)) std.AutoArrayHash
157157} = .{},
158158
159159/// Miscellaneous things that can fail.
160misc_failures: std.AutoArrayHashMapUnmanaged(MiscTask, MiscError) = .empty,
160misc_failures: std.array_hash_map.Auto(MiscTask, MiscError) = .empty,
161161
162162/// When this is `true` it means invoking clang as a sub-process is expected to inherit
163163/// stdin, stdout, stderr, and if it returns non success, to forward the exit code.
......@@ -865,7 +865,7 @@ pub const TimeReport = struct {
865865 /// a function) all generic instances of this function. It also includes time spent analyzing
866866 /// function bodies if this is a function (generic or otherwise).
867867 /// 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 {
869869 ns: u64,
870870 count: u32,
871871 }),
......@@ -875,14 +875,14 @@ pub const TimeReport = struct {
875875 /// instances, both of this function itself and of its parent namespace.
876876 /// An entry not existing means the declaration has not been codegenned (so far).
877877 /// 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
880880 /// Key is a ZIR `declaration` instruction which is anything other than a `comptime` decl; value
881881 /// is the number of nanoseconds spent linking it into the binary. As above, this is the total
882882 /// across all generic instances.
883883 /// An entry not existing means the declaration has not been linked (so far).
884884 /// 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
887887 pub fn deinit(tr: *TimeReport, gpa: Allocator) void {
888888 tr.stats = undefined;
......@@ -1068,8 +1068,8 @@ pub const CObject = struct {
10681068 }
10691069
10701070 pub const Bundle = struct {
1071 file_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty,
1072 category_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty,
1071 file_names: std.array_hash_map.Auto(u32, []const u8) = .empty,
1072 category_names: std.array_hash_map.Auto(u32, []const u8) = .empty,
10731073 diags: []Diag = &.{},
10741074
10751075 pub fn destroy(bundle: *Bundle, gpa: Allocator) void {
......@@ -1122,13 +1122,13 @@ pub const CObject = struct {
11221122 var bc = std.zig.llvm.BitcodeReader.init(gpa, .{ .reader = &file_reader.interface });
11231123 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;
11261126 errdefer {
11271127 for (file_names.values()) |file_name| gpa.free(file_name);
11281128 file_names.deinit(gpa);
11291129 }
11301130
1131 var category_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty;
1131 var category_names: std.array_hash_map.Auto(u32, []const u8) = .empty;
11321132 errdefer {
11331133 for (category_names.values()) |category_name| gpa.free(category_name);
11341134 category_names.deinit(gpa);
......@@ -1604,7 +1604,7 @@ pub const CreateOptions = struct {
16041604 /// implementations still do.
16051605 lib_directories: []const Cache.Directory = &.{},
16061606 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,
16081608 c_source_files: []const CSourceFile = &.{},
16091609 rc_source_files: []const RcSourceFile = &.{},
16101610 manifest_file: ?[]const u8 = null,
......@@ -1683,7 +1683,7 @@ pub const CreateOptions = struct {
16831683 skip_linker_dependencies: bool = false,
16841684 hash_style: link.File.Lld.Elf.HashStyle = .both,
16851685 entry: Entry = .default,
1686 force_undefined_symbols: std.StringArrayHashMapUnmanaged(void) = .empty,
1686 force_undefined_symbols: std.array_hash_map.String(void) = .empty,
16871687 stack_size: ?u64 = null,
16881688 image_base: ?u64 = null,
16891689 version: ?std.SemanticVersion = null,
......@@ -4064,7 +4064,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {
40644064 }
40654065 }
40664066 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: {
40684068 const SortOrder = struct {
40694069 zcu: *Zcu,
40704070 errors: []const *Zcu.ErrorMsg,
......@@ -4360,7 +4360,7 @@ pub fn addModuleErrorMsg(
43604360
43614361 // De-duplicate error notes. The main use case in mind for this is
43624362 // 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;
43644364 defer notes.deinit(gpa);
43654365
43664366 var last_note_loc: ?std.zig.Loc = null;
......@@ -4831,7 +4831,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
48314831 var buffer: [1024]u8 = undefined;
48324832 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;
48354835 defer seen_table.deinit(comp.gpa);
48364836
48374837 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),
4141/// * For a `func`, this is the source of the full function signature.
4242/// These are also invalidated if tracking fails for this instruction.
4343/// 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),
4545/// Dependencies on the value of a Nav.
4646/// 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),
4848/// Dependencies on the type of a Nav.
4949/// 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),
5151/// Dependencies on a function's inferred error set. Key is the function body, not the IES.
5252/// 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),
5454/// Dependencies on the resolved layout of a `struct`, `union`, or `enum` type.
5555/// 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),
5757/// Dependencies on the resolved default field values of a `struct` type.
5858/// 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),
6060/// Dependencies on a Zig or ZON source file. Triggered by `@import`.
6161/// * For ZON source files, the dependency is invalidated if the file changes at all. The `@import`
6262/// must be re-analyzed to return the new data structure.
......@@ -64,18 +64,18 @@ struct_defaults_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),
6464/// (which can only happen because the `.main_struct_inst` got lost). The `@import` must be
6565/// re-analyzed to return the new type.
6666/// 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),
6868/// Dependencies on an embedded file.
6969/// Introduced by `@embedFile`; invalidated when the file changes.
7070/// 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),
7272/// Dependencies on the full set of names in a ZIR namespace.
7373/// Key refers to a `struct_decl`, `union_decl`, etc.
7474/// 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),
7676/// Dependencies on the (non-)existence of some name in a namespace.
7777/// 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),
7979// Dependencies on the value of fields memoized on `Zcu` (`panic_messages` etc).
8080// If set, these are indices into `dep_entries` of the first dependency on this state.
8181memoized_state_main_deps: DepEntry.Index.Optional,
......@@ -86,7 +86,7 @@ memoized_state_assembly_deps: DepEntry.Index.Optional,
8686/// Given a `Depender`, points to an entry in `dep_entries` whose `depender`
8787/// matches. The `next_dependee` field can be used to iterate all such entries
8888/// 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
9191/// Stores dependency information. The hashmaps declared above are used to look
9292/// 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 {
15871587 return @as(u32, std.math.maxInt(BackingInt)) >> ip.tid_width;
15881588}
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
15921592/// An index into `maps` which might be `none`.
15931593pub const OptionalMapIndex = enum(u32) {
......@@ -11039,7 +11039,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator,
1103911039 defer arena_allocator.deinit();
1104011040 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;
1104311043 for (ip.locals, 0..) |*local, tid| {
1104411044 const items = local.shared.items.view().slice();
1104511045 const extra_list = local.shared.extra;
src/Package/Fetch.zig+5-5
......@@ -162,9 +162,9 @@ pub const JobQueue = struct {
162162 /// Both non-lazy and lazy dependencies are always fetched.
163163 all,
164164 };
165 pub const Table = std.AutoArrayHashMapUnmanaged(Package.Hash, *Fetch);
166 pub const UnlazySet = std.AutoArrayHashMapUnmanaged(Package.Hash, void);
167 pub const ForkSet = std.ArrayHashMapUnmanaged(Fork, void, Fork.Context, false);
165 pub const Table = std.array_hash_map.Auto(Package.Hash, *Fetch);
166 pub const UnlazySet = std.array_hash_map.Auto(Package.Hash, void);
167 pub const ForkSet = std.array_hash_map.Custom(Fork, void, Fork.Context, false);
168168
169169 pub const Fork = struct {
170170 path: Cache.Path,
......@@ -1725,7 +1725,7 @@ fn computeHash(f: *Fetch, pkg_path: Cache.Path, filter: Filter) RunError!Compute
17251725
17261726 // Track directories which had any files deleted from them so that empty directories
17271727 // can be deleted.
1728 var sus_dirs: std.StringArrayHashMapUnmanaged(void) = .empty;
1728 var sus_dirs: std.array_hash_map.String(void) = .empty;
17291729 defer sus_dirs.deinit(gpa);
17301730
17311731 var walker = try root_dir.walk(gpa);
......@@ -2002,7 +2002,7 @@ fn normalizePath(bytes: []u8) void {
20022002}
20032003
20042004const Filter = struct {
2005 include_paths: std.StringArrayHashMapUnmanaged(void) = .empty,
2005 include_paths: std.array_hash_map.String(void) = .empty,
20062006
20072007 /// sub_path is relative to the package root.
20082008 pub fn includePath(self: *const Filter, sub_path: []const u8) bool {
src/Package/Manifest.zig+4-4
......@@ -42,9 +42,9 @@ name: []const u8,
4242id: u32,
4343version: std.SemanticVersion,
4444version_node: Ast.Node.Index,
45dependencies: std.StringArrayHashMapUnmanaged(Dependency),
45dependencies: std.array_hash_map.String(Dependency),
4646dependencies_node: Ast.Node.OptionalIndex,
47paths: std.StringArrayHashMapUnmanaged(void),
47paths: std.array_hash_map.String(void),
4848minimum_zig_version: ?std.SemanticVersion,
4949
5050errors: []ErrorMessage,
......@@ -144,9 +144,9 @@ const Parse = struct {
144144 id: u32,
145145 version: std.SemanticVersion,
146146 version_node: Ast.Node.Index,
147 dependencies: std.StringArrayHashMapUnmanaged(Dependency),
147 dependencies: std.array_hash_map.String(Dependency),
148148 dependencies_node: Ast.Node.OptionalIndex,
149 paths: std.StringArrayHashMapUnmanaged(void),
149 paths: std.array_hash_map.String(void),
150150 allow_missing_paths_field: bool,
151151 minimum_zig_version: ?std.SemanticVersion,
152152
src/Package/Module.zig+2-2
......@@ -35,11 +35,11 @@ cc_argv: []const []const u8,
3535structured_cfg: bool,
3636no_builtin: bool,
3737
38pub const Deps = std.StringArrayHashMapUnmanaged(*Module);
38pub const Deps = std.array_hash_map.String(*Module);
3939
4040pub const Tree = struct {
4141 /// 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),
4343};
4444
4545pub const CreateOptions = struct {
src/Sema.zig+6-6
......@@ -88,7 +88,7 @@ err: ?*Zcu.ErrorMsg = null,
8888
8989/// The temporary arena is used for the memory of the `InferredAlloc` values
9090/// 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
9393/// Links every pointer derived from a base `alloc` back to that `alloc`. Used
9494/// to detect comptime-known `const`s.
......@@ -119,13 +119,13 @@ exports: std.ArrayList(Zcu.Export) = .empty,
119119/// All references registered so far by this `Sema`. This is a temporary duplicate
120120/// of data stored in `Zcu.all_references`. It exists to avoid adding references to
121121/// a given `AnalUnit` multiple times.
122references: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,
123type_references: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,
122references: std.array_hash_map.Auto(AnalUnit, void) = .empty,
123type_references: std.array_hash_map.Auto(InternPool.Index, void) = .empty,
124124
125125/// All dependencies registered so far by this `Sema`. This is a temporary duplicate
126126/// of the main dependency data. It exists to avoid adding dependencies to a given
127127/// `AnalUnit` multiple times.
128dependencies: std.AutoArrayHashMapUnmanaged(InternPool.Dependee, void) = .empty,
128dependencies: std.array_hash_map.Auto(InternPool.Dependee, void) = .empty,
129129
130130/// Whether memoization of this call is permitted. Operations with side effects global
131131/// to the `Sema`, such as `@setEvalBranchQuota`, set this to `false`. It is observed
......@@ -212,11 +212,11 @@ pub const InferredErrorSet = struct {
212212 /// are returned from any dependent functions.
213213 errors: NameMap = .{},
214214 /// 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,
216216 /// The regular error set created by resolving this inferred error set.
217217 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
221221 pub fn addErrorSet(
222222 self: *InferredErrorSet,
src/Type.zig+3-3
......@@ -3340,7 +3340,7 @@ pub fn assertHasLayout(ty: Type, zcu: *const Zcu) void {
33403340}
33413341
33423342/// 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 {
33443344 const zcu = pt.zcu;
33453345 const ip = &zcu.intern_pool;
33463346
......@@ -3455,8 +3455,8 @@ fn shouldDedupeType(ty: Type, ctx: *Comparison, pt: Zcu.PerThread) error{OutOfMe
34553455/// the subtype length and number of occurences. Placeholders are then found by
34563456/// iterating `type_dedupe_cache` which caches the inline/placeholder decisions.
34573457pub const Comparison = struct {
3458 type_occurrences: std.AutoArrayHashMapUnmanaged(Type, u16),
3459 type_dedupe_cache: std.AutoArrayHashMapUnmanaged(Type, DedupeEntry),
3458 type_occurrences: std.array_hash_map.Auto(Type, u16),
3459 type_dedupe_cache: std.array_hash_map.Auto(Type, DedupeEntry),
34603460 placeholder_index: u8,
34613461
34623462 pub const Placeholder = struct {
src/Zcu.zig+37-37
......@@ -97,20 +97,20 @@ free_exports: std.ArrayList(Export.Index) = .empty,
9797/// Maps from an `AnalUnit` which performs a single export, to the index into `all_exports` of
9898/// the export it performs. Note that the key is not the `Decl` being exported, but the `AnalUnit`
9999/// whose analysis triggered the export.
100single_exports: std.AutoArrayHashMapUnmanaged(AnalUnit, Export.Index) = .empty,
100single_exports: std.array_hash_map.Auto(AnalUnit, Export.Index) = .empty,
101101/// Like `single_exports`, but for `AnalUnit`s which perform multiple exports.
102102/// 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 {
104104 index: u32,
105105 len: u32,
106106}) = .{},
107107
108108/// 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
111111/// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones.
112112/// 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
115115/// The set of all the Zig source files in the Zig Compilation Unit. Tracked in
116116/// 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
125125///
126126/// Not serialized. This state is reconstructed during the first call to
127127/// `Compilation.update` of the process for a given `Compilation`.
128import_table: std.ArrayHashMapUnmanaged(
128import_table: std.array_hash_map.Custom(
129129 File.Index,
130130 void,
131131 struct {
......@@ -141,7 +141,7 @@ import_table: std.ArrayHashMapUnmanaged(
141141/// update removes an import, or if a module specified on the CLI is never imported.
142142/// Reconstructed on every update, after AstGen and before Sema.
143143/// 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
146146/// If this is populated, a "file exists in multiple modules" error should be emitted.
147147/// This causes file errors to not be shown, because we don't really know which files
......@@ -162,7 +162,7 @@ multi_module_err: ?struct {
162162/// on the `Compilation.Path` of the `EmbedFile`.
163163///
164164/// This table owns all of the `*EmbedFile` memory, which is allocated into gpa.
165embed_table: std.ArrayHashMapUnmanaged(
165embed_table: std.array_hash_map.Custom(
166166 *EmbedFile,
167167 void,
168168 struct {
......@@ -179,27 +179,27 @@ intern_pool: InternPool = .empty,
179179
180180/// Value explains why this `AnalUnit` is being analyzed. It is `null` for the topmost analysis
181181/// (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,
183183/// 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,
185185/// 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,
187187/// This `Nav` succeeded analysis, but failed codegen.
188188/// This may be a simple "value" `Nav`, or it may be a function.
189189/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.
190190/// While multiple threads are active (most of the time!), this is guarded by `zcu.comp.mutex`, as
191191/// codegen and linking run on a separate thread.
192failed_codegen: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, *ErrorMsg) = .empty,
193failed_types: std.AutoArrayHashMapUnmanaged(InternPool.Index, *ErrorMsg) = .empty,
192failed_codegen: std.array_hash_map.Auto(InternPool.Nav.Index, *ErrorMsg) = .empty,
193failed_types: std.array_hash_map.Auto(InternPool.Index, *ErrorMsg) = .empty,
194194
195195/// Key is an `AnalUnit` which is in `dependency_loop_nodes`. For each dependency loop, exactly one
196196/// unit in the loop is in this map, though the choice is arbitrary and not necessarily reproducible
197197/// between compilations. So, instead of (for instance) defining where the dependency loop "starts",
198198/// 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,
200200/// Key is an `AnalUnit`, value is the `AnalUnit` which the key references and why it does so.
201201/// 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 {
203203 unit: AnalUnit,
204204 reason: DependencyReason,
205205}) = .empty,
......@@ -207,7 +207,7 @@ dependency_loop_nodes: std.AutoArrayHashMapUnmanaged(AnalUnit, struct {
207207/// Keep track of `@compileLog`s per `AnalUnit`.
208208/// We track the source location of the first `@compileLog` call, and all logged lines as a linked list.
209209/// 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 {
211211 base_node_inst: InternPool.TrackedInst.Index,
212212 node_offset: Ast.Node.Offset,
213213 first_line: CompileLogLine.Index,
......@@ -228,7 +228,7 @@ free_compile_log_lines: std.ArrayList(CompileLogLine.Index) = .empty,
228228/// We just store a `[]u8` instead of a full `*ErrorMsg`, because the source
229229/// location is always the entire file. The `[]u8` memory is owned by the map
230230/// and allocated into `gpa`.
231failed_files: std.AutoArrayHashMapUnmanaged(File.Index, ?[]u8) = .empty,
231failed_files: std.array_hash_map.Auto(File.Index, ?[]u8) = .empty,
232232/// AstGen is not aware of modules, and so cannot determine whether an import
233233/// string makes sense. That is the job of a traversal after AstGen.
234234///
......@@ -256,10 +256,10 @@ failed_imports: std.ArrayList(struct {
256256 import_token: Ast.TokenIndex,
257257 kind: enum { file_outside_module_root, illegal_zig_import },
258258}) = .empty,
259failed_exports: std.AutoArrayHashMapUnmanaged(Export.Index, *ErrorMsg) = .empty,
259failed_exports: std.array_hash_map.Auto(Export.Index, *ErrorMsg) = .empty,
260260/// If analysis failed due to a cimport error, the corresponding Clang errors
261261/// 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
264264/// Maximum amount of distinct error values, set by --error-limit
265265error_limit: ErrorInt,
......@@ -271,19 +271,19 @@ outdated_lock: if (std.debug.runtime_safety) std.Io.RwLock else void = if (std.d
271271/// Value is the number of PO dependencies of this AnalUnit.
272272/// This value will decrease as we perform semantic analysis to learn what is outdated.
273273/// 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,
275275/// Value is the number of PO dependencies of this AnalUnit.
276276/// 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,
278278/// This is the set of all `AnalUnit`s in `outdated` whose PO dependency count is 0.
279279/// Such `AnalUnit`s are ready for immediate re-analysis.
280280/// See `findOutdatedToAnalyze` for details.
281281outdated_ready: struct {
282282 /// These are separate from other units because it allows `findOutdatedToAnalyze` to prioritize
283283 /// 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),
285285 /// Does not contain `.func` units.
286 other: std.AutoArrayHashMapUnmanaged(AnalUnit, void),
286 other: std.array_hash_map.Auto(AnalUnit, void),
287287} = .{ .funcs = .empty, .other = .empty },
288288/// This contains a list of AnalUnit whose analysis or codegen failed, but the
289289/// failure was something like running out of disk space, and trying again may
......@@ -298,23 +298,23 @@ analysis_roots_len: usize = 0,
298298/// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and
299299/// reset to `null` when any semantic analysis occurs (since this invalidates the data).
300300/// Allocated into `gpa`.
301resolved_references: ?std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) = null,
301resolved_references: ?std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) = null,
302302
303303/// If `true`, then semantic analysis must not occur on this update due to AstGen errors.
304304/// Essentially the entire pipeline after AstGen, including Sema, codegen, and link, is skipped.
305305/// Reset to `false` at the start of each update in `Compilation.update`.
306306skip_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
312312/// Key is the `AnalUnit` *performing* the reference. This representation allows
313313/// incremental updates to quickly delete references caused by a specific `AnalUnit`.
314314/// Value is index into `all_references` of the first reference triggered by the unit.
315315/// The `next` field on the `Reference` forms a linked list of all references
316316/// triggered by the key `AnalUnit`.
317reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,
317reference_table: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
318318all_references: std.ArrayList(Reference) = .empty,
319319/// Freelist of indices in `all_references`.
320320free_references: std.ArrayList(u32) = .empty,
......@@ -327,7 +327,7 @@ free_inline_reference_frames: std.ArrayList(InlineReferenceFrame.Index) = .empty
327327/// Value is index into `all_type_reference` of the first reference triggered by the unit.
328328/// The `next` field on the `TypeReference` forms a linked list of all type references
329329/// triggered by the key `AnalUnit`.
330type_reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,
330type_reference_table: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
331331all_type_references: std.ArrayList(TypeReference) = .empty,
332332/// Freelist of indices in `all_type_references`.
333333free_type_references: std.ArrayList(u32) = .empty,
......@@ -355,12 +355,12 @@ pub const DependencyReason = struct {
355355pub const IncrementalDebugState = struct {
356356 /// All container types in the ZCU, even dead ones.
357357 /// 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),
359359 /// All `Nav`s in the ZCU, even dead ones.
360360 /// 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),
362362 /// 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
365365 pub const init: IncrementalDebugState = .{
366366 .types = .empty,
......@@ -681,7 +681,7 @@ pub const SimplePanicId = enum {
681681 }
682682};
683683
684pub const GlobalErrorSet = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, void);
684pub const GlobalErrorSet = std.array_hash_map.Auto(InternPool.NullTerminatedString, void);
685685
686686pub const CImportError = struct {
687687 offset: u32,
......@@ -840,9 +840,9 @@ pub const Namespace = struct {
840840 /// Will be a struct, enum, union, or opaque.
841841 owner_type: InternPool.Index,
842842 /// 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,
844844 /// 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,
846846 /// All `comptime` declarations in this namespace. We store these purely so that incremental
847847 /// compilation can re-use the existing `ComptimeUnit`s when a namespace changes.
848848 comptime_decls: std.ArrayList(InternPool.ComptimeUnit.Id) = .empty,
......@@ -4188,13 +4188,13 @@ pub const ResolvedReference = struct {
41884188/// If an `AnalUnit` is not in the returned map, it is unreferenced.
41894189/// The returned hashmap is owned by the `Zcu`, so should not be freed by the caller.
41904190/// 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) {
41924192 if (zcu.resolved_references == null) {
41934193 zcu.resolved_references = try zcu.resolveReferencesInner();
41944194 }
41954195 return &zcu.resolved_references.?;
41964196}
4197fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) {
4197fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) {
41984198 const trace = tracy.trace(@src());
41994199 defer trace.end();
42004200
......@@ -4202,8 +4202,8 @@ fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanag
42024202 const comp = zcu.comp;
42034203 const ip = &zcu.intern_pool;
42044204
4205 var units: std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) = .empty;
4206 var types: std.AutoArrayHashMapUnmanaged(InternPool.Index, ?ResolvedReference) = .empty;
4205 var units: std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) = .empty;
4206 var types: std.array_hash_map.Auto(InternPool.Index, ?ResolvedReference) = .empty;
42074207 defer {
42084208 units.deinit(gpa);
42094209 types.deinit(gpa);
src/Zcu/PerThread.zig+6-6
......@@ -787,7 +787,7 @@ const UpdatedFile = struct {
787787 inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index),
788788};
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 {
791791 for (updated_files.values()) |*elem| elem.inst_map.deinit(gpa);
792792 updated_files.deinit(gpa);
793793}
......@@ -805,7 +805,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {
805805
806806 // We need to visit every updated File for every TrackedInst in InternPool.
807807 // 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;
809809 defer cleanupUpdatedFiles(gpa, &updated_files);
810810
811811 for (zcu.import_table.keys()) |file_index| {
......@@ -907,7 +907,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {
907907 if (!has_namespace) continue;
908908
909909 // 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;
911911 defer old_names.deinit(zcu.gpa);
912912 for (old_zir.typeDecls(old_inst)) |decl_inst| {
913913 const old_decl = old_zir.getDeclaration(decl_inst);
......@@ -3568,8 +3568,8 @@ pub fn processExports(pt: Zcu.PerThread) !void {
35683568 }
35693569
35703570 // 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;
3572 var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.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.array_hash_map.Auto(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
35733573 defer {
35743574 for (nav_exports.values()) |*exports| {
35753575 exports.deinit(gpa);
......@@ -3665,7 +3665,7 @@ pub fn processExports(pt: Zcu.PerThread) !void {
36653665 }
36663666}
36673667
3668const SymbolExports = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, Zcu.Export.Index);
3668const SymbolExports = std.array_hash_map.Auto(InternPool.NullTerminatedString, Zcu.Export.Index);
36693669
36703670fn processExportsInner(
36713671 pt: Zcu.PerThread,
src/codegen/aarch64/Select.zig+6-6
......@@ -4,12 +4,12 @@ air: Air,
44nav_index: InternPool.Nav.Index,
55
66// Blocks
7def_order: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, void),
8blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Block),
9loops: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Loop),
7def_order: std.array_hash_map.Auto(Air.Inst.Index, void),
8blocks: std.array_hash_map.Auto(Air.Inst.Index, Block),
9loops: std.array_hash_map.Auto(Air.Inst.Index, Loop),
1010active_loops: std.ArrayList(Loop.Index),
1111loop_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),
1313 list: std.ArrayList(Air.Inst.Index),
1414},
1515dom_start: u32,
......@@ -11225,7 +11225,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
1122511225 defer std.debug.unlockStderr();
1122611226 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;
1122911229 defer {
1123011230 for (reverse_live_values.values()) |*list| list.deinit(gpa);
1123111231 reverse_live_values.deinit(gpa);
......@@ -11254,7 +11254,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
1125411254 };
1125511255 }
1125611256
11257 var roots: std.AutoArrayHashMapUnmanaged(Value.Index, u32) = .empty;
11257 var roots: std.array_hash_map.Auto(Value.Index, u32) = .empty;
1125811258 defer roots.deinit(gpa);
1125911259 {
1126011260 try roots.ensureTotalCapacity(gpa, isel.values.items.len);
src/codegen/c.zig+11-11
......@@ -59,14 +59,14 @@ pub const Mir = struct {
5959 /// Key is the value of the UAV; value is the UAV's alignment, or
6060 /// `.none` for natural alignment. The specified alignment is never
6161 /// less than the natural alignment.
62 need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
62 need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
6363 ctype_deps: CType.Dependencies,
6464 /// 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),
6666 /// 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),
6868 /// 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
7171 pub fn deinit(mir: *Mir, gpa: Allocator) void {
7272 gpa.free(mir.fwd_decl);
......@@ -164,8 +164,8 @@ const LocalType = struct {
164164};
165165
166166const LocalIndex = u16;
167const LocalsList = std.AutoArrayHashMapUnmanaged(LocalIndex, void);
168const LocalsMap = std.AutoArrayHashMapUnmanaged(LocalType, LocalsList);
167const LocalsList = std.array_hash_map.Auto(LocalIndex, void);
168const LocalsMap = std.array_hash_map.Auto(LocalType, LocalsList);
169169
170170const ValueRenderLocation = enum {
171171 initializer,
......@@ -391,11 +391,11 @@ pub const Function = struct {
391391 code: Writer.Allocating,
392392 indent_counter: usize,
393393 /// 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),
395395 /// 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),
397397 /// 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),
399399 func_index: InternPool.Index,
400400 /// All the locals, to be emitted at the top of the function.
401401 locals: std.ArrayList(LocalType) = .empty,
......@@ -407,7 +407,7 @@ pub const Function = struct {
407407 /// of variable declarations at the top of a function, sorted descending
408408 /// by type alignment.
409409 /// 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,
411411 /// Maps from `loop_switch_br` instructions to the allocated local used
412412 /// for the switch cond. Dispatches should set this local to the new cond.
413413 loop_switch_conds: std.AutoHashMapUnmanaged(Air.Inst.Index, LocalIndex) = .empty,
......@@ -643,7 +643,7 @@ pub const DeclGen = struct {
643643 /// Key is the value of the UAV; value is the UAV's alignment, or
644644 /// `.none` for natural alignment. The specified alignment is never
645645 /// less than the natural alignment.
646 uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
646 uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
647647
648648 fn fail(dg: *DeclGen, comptime format: []const u8, args: anytype) Error {
649649 @branchHint(.cold);
src/codegen/c/type.zig+6-6
......@@ -572,30 +572,30 @@ pub const CType = union(enum) {
572572 pub const Dependencies = struct {
573573 /// Key is any Zig type which corresponds to a C `struct`, `union`, or `typedef`. That C
574574 /// type must be declared and complete.
575 type: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
575 type: std.array_hash_map.Auto(InternPool.Index, void),
576576
577577 /// Key is a Zig type which is the *payload* of an error union. The C `struct` type
578578 /// corresponding to such an error union must be declared and complete.
579579 ///
580580 /// These are separate from `type` to avoid redundant types for every different error set
581581 /// 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
584584 /// Like `type`, but the type does not necessarily need to be completed yet: a forward
585585 /// declaration is sufficient.
586 type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
586 type_fwd: std.array_hash_map.Auto(InternPool.Index, void),
587587
588588 /// Like `errunion_type`, but the type does not necessarily need to be completed yet: a
589589 /// 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
592592 /// Key is a Zig type; value is a bitmask of alignments. For every bit which is set, an
593593 /// aligned typedef is required. For instance, if bit 3 is set, the C type 'aligned__8_foo'
594594 /// 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
597597 /// 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
600600 pub const empty: Dependencies = .{
601601 .type = .empty,
src/codegen/llvm/FuncGen.zig+1-1
......@@ -2513,7 +2513,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
25132513 var llvm_param_i: usize = 0;
25142514 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;
25172517 try name_map.ensureUnusedCapacity(arena, max_param_count);
25182518
25192519 var it = unwrapped_asm.iterateOutputs();
src/codegen/riscv64/CodeGen.zig+4-4
......@@ -112,7 +112,7 @@ const_tracking: ConstTrackingMap = .{},
112112inst_tracking: InstTrackingMap = .{},
113113
114114frame_allocs: std.MultiArrayList(FrameAlloc) = .{},
115free_frame_indices: std.AutoArrayHashMapUnmanaged(FrameIndex, void) = .empty,
115free_frame_indices: std.array_hash_map.Auto(FrameIndex, void) = .empty,
116116frame_locs: std.MultiArrayList(Mir.FrameLoc) = .{},
117117
118118loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
......@@ -338,7 +338,7 @@ const MCValue = union(enum) {
338338};
339339
340340const 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
343343 fn deinit(func: *Branch, gpa: Allocator) void {
344344 func.inst_table.deinit(gpa);
......@@ -346,8 +346,8 @@ const Branch = struct {
346346 }
347347};
348348
349const InstTrackingMap = std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InstTracking);
350const ConstTrackingMap = std.AutoArrayHashMapUnmanaged(InternPool.Index, InstTracking);
349const InstTrackingMap = std.array_hash_map.Auto(Air.Inst.Index, InstTracking);
350const ConstTrackingMap = std.array_hash_map.Auto(InternPool.Index, InstTracking);
351351
352352const InstTracking = struct {
353353 long: MCValue,
src/codegen/sparc64/CodeGen.zig+1-1
......@@ -200,7 +200,7 @@ const MCValue = union(enum) {
200200};
201201
202202const 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
205205 fn deinit(self: *Branch, gpa: Allocator) void {
206206 self.inst_table.deinit(gpa);
src/codegen/spirv/Assembler.zig+2-2
......@@ -35,8 +35,8 @@ inst: struct {
3535 return null;
3636 }
3737} = .{},
38value_map: std.StringArrayHashMapUnmanaged(AsmValue) = .{},
39inst_map: std.StringArrayHashMapUnmanaged(void) = .empty,
38value_map: std.array_hash_map.String(AsmValue) = .{},
39inst_map: std.array_hash_map.String(void) = .empty,
4040
4141const Operand = union(enum) {
4242 /// 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
2828intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
2929decls: std.ArrayList(Decl) = .empty,
3030decl_deps: std.ArrayList(Decl.Index) = .empty,
31entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
31entry_points: std.array_hash_map.Auto(Id, EntryPoint) = .empty,
3232/// This map serves a dual purpose:
3333/// - It keeps track of pointers that are currently being emitted, so that we can tell
3434/// if they are recursive and need an OpTypeForwardPointer.
......@@ -58,18 +58,18 @@ cache: struct {
5858 float_types: std.AutoHashMapUnmanaged(std.lang.Type.Float, Id) = .empty,
5959 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,
6060 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,
61 struct_types: std.ArrayHashMapUnmanaged(StructType, Id, StructType.HashContext, true) = .empty,
62 fn_types: std.ArrayHashMapUnmanaged(FnType, Id, FnType.HashContext, true) = .empty,
61 struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty,
62 fn_types: std.array_hash_map.Custom(FnType, Id, FnType.HashContext, true) = .empty,
6363
6464 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,
6565 extensions: std.StringHashMapUnmanaged(void) = .empty,
6666 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,
6767 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,
6868 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
7171 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
7474 spirv_types: std.AutoHashMapUnmanaged(InternPool.Index, Id) = .empty,
7575} = .{},
src/codegen/wasm/CodeGen.zig+5-5
......@@ -141,7 +141,7 @@ branches: std.ArrayList(Branch) = .empty,
141141/// Table to save `WValue`'s generated by an `Air.Inst`
142142// values: ValueTable,
143143/// 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 {
145145 label: u32,
146146 value: WValue,
147147}) = .{},
......@@ -171,12 +171,12 @@ mir_extra: std.ArrayList(u32),
171171mir_locals: std.ArrayList(std.wasm.Valtype),
172172/// Set of all UAVs referenced by this function. Key is the UAV value, value is the alignment.
173173/// `.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),
175175/// Set of all functions whose address this function has taken and which therefore might be called
176176/// 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),
178178/// 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),
180180/// The number of `error_name_table_ref` instructions emitted.
181181error_name_table_ref_count: u32,
182182/// 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) {
322322};
323323
324324/// 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
327327const 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,
2626
2727/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.
2828/// 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),
3030/// 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),
3232/// 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),
3434/// Not directly used by `Emit`, but the linker needs this to add it to its own refcount.
3535error_name_table_ref_count: u32,
3636
src/codegen/x86_64/CodeGen.zig+3-3
......@@ -140,7 +140,7 @@ register_manager: RegisterManager = .{},
140140scope_generation: u32 = 0,
141141
142142frame_allocs: std.MultiArrayList(FrameAlloc) = .empty,
143free_frame_indices: std.AutoArrayHashMapUnmanaged(FrameIndex, void) = .empty,
143free_frame_indices: std.array_hash_map.Auto(FrameIndex, void) = .empty,
144144frame_locs: std.MultiArrayList(Mir.FrameLoc) = .empty,
145145
146146loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
......@@ -569,8 +569,8 @@ pub const MCValue = union(enum) {
569569 }
570570};
571571
572const InstTrackingMap = std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InstTracking);
573const ConstTrackingMap = std.AutoArrayHashMapUnmanaged(InternPool.Index, InstTracking);
572const InstTrackingMap = std.array_hash_map.Auto(Air.Inst.Index, InstTracking);
573const ConstTrackingMap = std.array_hash_map.Auto(InternPool.Index, InstTracking);
574574const InstTracking = struct {
575575 long: MCValue,
576576 short: MCValue,
src/libs/mingw/implib.zig+1-1
......@@ -245,7 +245,7 @@ pub fn getMembers(
245245 };
246246 var renames: std.ArrayList(DeferredExport) = .empty;
247247 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;
249249 defer regular_imports.deinit(allocator);
250250
251251 for (module_def.exports.items) |*e| {
src/link.zig+1-1
......@@ -471,7 +471,7 @@ pub const File = struct {
471471 /// wrapper for a system function. The wrapper function should be called
472472 /// __wrap_symbol. If it wishes to call the system function, it should call
473473 /// __real_symbol.
474 symbol_wrap_set: std.StringArrayHashMapUnmanaged(void),
474 symbol_wrap_set: std.array_hash_map.String(void),
475475
476476 compatibility_version: ?std.SemanticVersion,
477477
src/link/C.zig+26-26
......@@ -44,10 +44,10 @@ type_dependencies: std.ArrayList(link.ConstPool.Index),
4444align_dependency_masks: std.ArrayList(u64),
4545
4646/// 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),
4848/// All UAVs which may be referenced are in this map. The UAV alignment is not included in the
4949/// 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),
5151/// Contains all types which are needed by some other rendered code. Does not contain any constants
5252/// other than types.
5353type_pool: link.ConstPool,
......@@ -59,10 +59,10 @@ types: std.ArrayList(RenderedType),
5959/// The set of big int types required by *any* generated code so far. These are always safe to emit,
6060/// so they do not participate in the dependency graph traversal in `flush`. Therefore, redundant
6161/// 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),
65exported_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, String),
64exported_navs: std.array_hash_map.Auto(InternPool.Nav.Index, String),
65exported_uavs: std.array_hash_map.Auto(InternPool.Index, String),
6666
6767/// A reference into `string_bytes`.
6868const String = extern struct {
......@@ -133,10 +133,10 @@ const RenderedDecl = struct {
133133 fwd_decl: String,
134134 code: String,
135135 ctype_deps: CTypeDependencies,
136 need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
137 need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
138 need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
139 need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
136 need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
137 need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
138 need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
139 need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
140140
141141 const init: RenderedDecl = .{
142142 .fwd_decl = .empty,
......@@ -746,7 +746,7 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog
746746 // incremental updates which is invalid C (due to e.g. types changing). Machine code backends
747747 // don't have this problem because there are, of course, no type checking performed when you
748748 // *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;
750750 defer need_navs.deinit(gpa);
751751 {
752752 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
774774 //
775775 // 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;
778778 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;
781781 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;
783783 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;
785785 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;
788788 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;
791791 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;
794794 defer need_never_inline_funcs.deinit(gpa);
795795
796796 // As mentioned above, we need this type for error names.
......@@ -1284,9 +1284,9 @@ pub fn deleteExport(
12841284
12851285fn mergeNeededCTypes(
12861286 c: *C,
1287 need_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),
1288 need_errunion_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),
1289 need_aligned_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64),
1287 need_types: *std.array_hash_map.Auto(link.ConstPool.Index, void),
1288 need_errunion_types: *std.array_hash_map.Auto(link.ConstPool.Index, void),
1289 need_aligned_types: *std.array_hash_map.Auto(link.ConstPool.Index, u64),
12901290 deps: *const CTypeDependencies,
12911291) Allocator.Error!void {
12921292 const gpa = c.base.comp.gpa;
......@@ -1312,8 +1312,8 @@ fn mergeNeededCTypes(
13121312
13131313fn mergeNeededUavs(
13141314 zcu: *const Zcu,
1315 global: *std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
1316 new: *const std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
1315 global: *std.array_hash_map.Auto(InternPool.Index, Alignment),
1316 new: *const std.array_hash_map.Auto(InternPool.Index, Alignment),
13171317) Allocator.Error!void {
13181318 const gpa = zcu.comp.gpa;
13191319
......@@ -1422,12 +1422,12 @@ const FlushTypes = struct {
14221422 c: *C,
14231423 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),
14261426 aligned_type_strings: []const []const u8,
14271427
1428 status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, bool),
1429 errunion_status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, bool),
1430 aligned_status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),
1428 status: std.array_hash_map.Auto(link.ConstPool.Index, bool),
1429 errunion_status: std.array_hash_map.Auto(link.ConstPool.Index, bool),
1430 aligned_status: std.array_hash_map.Auto(link.ConstPool.Index, void),
14311431
14321432 fn processDeps(ft: *FlushTypes, deps: *const CTypeDependencies) void {
14331433 const resolved = deps.get(ft.c);
src/link/Coff.zig+8-8
......@@ -30,18 +30,18 @@ strings: std.HashMapUnmanaged(
3030),
3131string_bytes: std.ArrayList(u8),
3232image_section_table: std.ArrayList(Symbol.Index),
33pseudo_section_table: std.AutoArrayHashMapUnmanaged(String, Symbol.Index),
34object_section_table: std.AutoArrayHashMapUnmanaged(String, Symbol.Index),
33pseudo_section_table: std.array_hash_map.Auto(String, Symbol.Index),
34object_section_table: std.array_hash_map.Auto(String, Symbol.Index),
3535symbol_table: std.ArrayList(Symbol),
36globals: std.AutoArrayHashMapUnmanaged(GlobalName, Symbol.Index),
36globals: std.array_hash_map.Auto(GlobalName, Symbol.Index),
3737global_pending_index: u32,
38navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, Symbol.Index),
39uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Symbol.Index),
38navs: std.array_hash_map.Auto(InternPool.Nav.Index, Symbol.Index),
39uavs: std.array_hash_map.Auto(InternPool.Index, Symbol.Index),
4040lazy: 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),
4242 pending_index: u32,
4343}),
44pending_uavs: std.AutoArrayHashMapUnmanaged(Node.UavMapIndex, struct {
44pending_uavs: std.array_hash_map.Auto(Node.UavMapIndex, struct {
4545 alignment: InternPool.Alignment,
4646}),
4747relocs: std.ArrayList(Reloc),
......@@ -272,7 +272,7 @@ pub const Node = union(enum) {
272272
273273pub const ImportTable = struct {
274274 ni: MappedFile.Node.Index,
275 entries: std.AutoArrayHashMapUnmanaged(void, Entry),
275 entries: std.array_hash_map.Auto(void, Entry),
276276
277277 pub const Entry = struct {
278278 import_lookup_table_ni: MappedFile.Node.Index,
src/link/ConstPool.zig+3-3
......@@ -15,10 +15,10 @@
1515/// * ensure that any `get` call is eventually followed by a `flushPending` call
1616const ConstPool = @This();
1717
18values: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
18values: std.array_hash_map.Auto(InternPool.Index, void),
1919pending: std.ArrayList(Index),
20complete_containers: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
21container_deps: std.AutoArrayHashMapUnmanaged(InternPool.Index, ContainerDepEntry.Index),
20complete_containers: std.array_hash_map.Auto(InternPool.Index, void),
21container_deps: std.array_hash_map.Auto(InternPool.Index, ContainerDepEntry.Index),
2222container_dep_entries: std.ArrayList(ContainerDepEntry),
2323
2424pub const empty: ConstPool = .{
src/link/Dwarf.zig+6-6
......@@ -27,11 +27,11 @@ address_size: AddressSize,
2727
2828const_pool: link.ConstPool,
2929
30mods: std.AutoArrayHashMapUnmanaged(*Module, ModInfo),
30mods: std.array_hash_map.Auto(*Module, ModInfo),
3131/// Indices are `link.ConstPool.Index`.
3232values: std.ArrayList(struct { Unit.Index, Entry.Index }),
33navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, Entry.Index),
34decls: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, Entry.Index),
33navs: std.array_hash_map.Auto(InternPool.Nav.Index, Entry.Index),
34decls: std.array_hash_map.Auto(InternPool.TrackedInst.Index, Entry.Index),
3535
3636debug_abbrev: DebugAbbrev,
3737debug_aranges: DebugAranges,
......@@ -69,8 +69,8 @@ pub const AddressSize = enum(u8) {
6969
7070const ModInfo = struct {
7171 root_dir_path: Entry.Index,
72 dirs: std.AutoArrayHashMapUnmanaged(Unit.Index, void),
73 files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void),
72 dirs: std.array_hash_map.Auto(Unit.Index, void),
73 files: std.array_hash_map.Auto(Zcu.File.Index, void),
7474
7575 fn deinit(mod_info: *ModInfo, gpa: Allocator) void {
7676 mod_info.dirs.deinit(gpa);
......@@ -236,7 +236,7 @@ const DebugRngLists = struct {
236236
237237const StringSection = struct {
238238 contents: std.ArrayList(u8),
239 map: std.AutoArrayHashMapUnmanaged(void, void),
239 map: std.array_hash_map.Auto(void, void),
240240 section: Section,
241241
242242 const unit: Unit.Index = @enumFromInt(0);
src/link/Elf.zig+5-5
......@@ -2,7 +2,7 @@ pub const Atom = @import("Elf/Atom.zig");
22
33base: link.File,
44zig_object: ?*ZigObject,
5rpath_table: std.StringArrayHashMapUnmanaged(void),
5rpath_table: std.array_hash_map.String(void),
66image_base: u64,
77z_nodelete: bool,
88z_notext: bool,
......@@ -30,7 +30,7 @@ file_handles: std.ArrayList(File.Handle) = .empty,
3030zig_object_index: ?File.Index = null,
3131linker_defined_index: ?File.Index = null,
3232objects: std.ArrayList(File.Index) = .empty,
33shared_objects: std.StringArrayHashMapUnmanaged(File.Index) = .empty,
33shared_objects: std.array_hash_map.String(File.Index) = .empty,
3434
3535/// List of all output sections and their associated metadata.
3636sections: std.MultiArrayList(Section) = .{},
......@@ -249,7 +249,7 @@ pub fn createEmpty(
249249 const is_dyn_lib = output_mode == .Lib and link_mode == .dynamic;
250250 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;
253253 try rpath_table.entries.resize(arena, options.rpath_list.len);
254254 @memcpy(rpath_table.entries.items(.key), options.rpath_list);
255255 try rpath_table.reIndex(arena);
......@@ -1112,7 +1112,7 @@ fn parseDso(
11121112 io: Io,
11131113 diags: *Diags,
11141114 dso: link.Input.Dso,
1115 shared_objects: *std.StringArrayHashMapUnmanaged(File.Index),
1115 shared_objects: *std.array_hash_map.String(File.Index),
11161116 files: *std.MultiArrayList(File.Entry),
11171117 target: *const std.Target,
11181118) !void {
......@@ -4153,7 +4153,7 @@ pub const Ref = struct {
41534153pub const SymbolResolver = struct {
41544154 keys: std.ArrayList(Key) = .empty,
41554155 values: std.ArrayList(Ref) = .empty,
4156 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
4156 table: std.array_hash_map.Auto(void, void) = .empty,
41574157
41584158 const Result = struct {
41594159 found_existing: bool,
src/link/Elf/AtomList.zig+1-1
......@@ -3,7 +3,7 @@ size: u64 = 0,
33alignment: Atom.Alignment = .@"1",
44output_section_index: u32 = 0,
55// atoms: std.ArrayList(Elf.Ref) = .empty,
6atoms: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,
6atoms: std.array_hash_map.Auto(Elf.Ref, void) = .empty,
77
88dirty: bool = true,
99
src/link/Elf/Thunk.zig+1-1
......@@ -1,6 +1,6 @@
11value: i64 = 0,
22output_section_index: u32 = 0,
3symbols: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,
3symbols: std.array_hash_map.Auto(Elf.Ref, void) = .empty,
44output_symtab_ctx: Elf.SymtabCtx = .{},
55
66pub fn deinit(thunk: *Thunk, allocator: Allocator) void {
src/link/Elf/ZigObject.zig+4-4
......@@ -2408,10 +2408,10 @@ const TlsVariable = struct {
24082408};
24092409
24102410const AtomList = std.ArrayList(Atom.Index);
2411const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);
2412const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);
2413const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);
2414const TlsTable = std.AutoArrayHashMapUnmanaged(Atom.Index, void);
2411const NavTable = std.array_hash_map.Auto(InternPool.Nav.Index, AvMetadata);
2412const UavTable = std.array_hash_map.Auto(InternPool.Index, AvMetadata);
2413const LazySymbolTable = std.array_hash_map.Auto(InternPool.Index, LazySymbolMetadata);
2414const TlsTable = std.array_hash_map.Auto(Atom.Index, void);
24152415
24162416const x86_64 = struct {
24172417 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,
112112/// The `.dynamic` section contains zero or more symbol relocations starting at this index.
113113dynamic_first_symbol_reloc: SymbolReloc.Index,
114114
115needed: std.AutoArrayHashMapUnmanaged(String(.dynstr), void),
115needed: std.array_hash_map.Auto(String(.dynstr), void),
116116inputs: std.ArrayList(struct {
117117 path: std.Build.Cache.Path,
118118 member: ?[]const u8,
......@@ -120,21 +120,21 @@ inputs: std.ArrayList(struct {
120120}),
121121input_sections: std.ArrayList(InputSection),
122122input_section_pending_index: u32,
123navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, struct {
123navs: std.array_hash_map.Auto(InternPool.Nav.Index, struct {
124124 lsi: Symbol.LocalIndex,
125125 /// The start index of the contiguous sequence of symbol relocations in this NAV.
126126 first_symbol_reloc: SymbolReloc.Index,
127127 /// The start index of the contiguous sequence of GOT relocations in this NAV.
128128 first_got_reloc: GotReloc.Index,
129129}),
130uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, struct {
130uavs: std.array_hash_map.Auto(InternPool.Index, struct {
131131 lsi: Symbol.LocalIndex,
132132 /// The start index of the contiguous sequence of symbol relocations in this UAV.
133133 first_symbol_reloc: SymbolReloc.Index,
134134 // No `first_got_reloc` field because a UAV never contains GOT relocations.
135135}),
136136lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {
137 map: std.AutoArrayHashMapUnmanaged(InternPool.Index, struct {
137 map: std.array_hash_map.Auto(InternPool.Index, struct {
138138 lsi: Symbol.LocalIndex,
139139 /// The start index of the contiguous sequence of symbol relocations in this lazy code/data.
140140 first_symbol_reloc: SymbolReloc.Index,
src/link/MachO.zig+4-4
......@@ -28,9 +28,9 @@ sections: std.MultiArrayList(Section) = .{},
2828resolver: SymbolResolver = .{},
2929/// This table will be populated after `scanRelocs` has run.
3030/// Key is symbol index.
31undefs: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, UndefRefs) = .empty,
31undefs: std.array_hash_map.Auto(SymbolResolver.Index, UndefRefs) = .empty,
3232undefs_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,
3434dupes_mutex: std.Io.Mutex = .init,
3535
3636dyld_info_cmd: macho.dyld_info_command = .{},
......@@ -4102,7 +4102,7 @@ const Section = struct {
41024102};
41034103
41044104pub const LiteralPool = struct {
4105 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
4105 table: std.array_hash_map.Auto(void, void) = .empty,
41064106 keys: std.ArrayList(Key) = .empty,
41074107 values: std.ArrayList(MachO.Ref) = .empty,
41084108 data: std.ArrayList(u8) = .empty,
......@@ -4541,7 +4541,7 @@ pub const Ref = struct {
45414541pub const SymbolResolver = struct {
45424542 keys: std.ArrayList(Key) = .empty,
45434543 values: std.ArrayList(Ref) = .empty,
4544 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
4544 table: std.array_hash_map.Auto(void, void) = .empty,
45454545
45464546 const Result = struct {
45474547 found_existing: bool,
src/link/MachO/Dylib.zig+1-1
......@@ -14,7 +14,7 @@ symbols: std.ArrayList(Symbol) = .empty,
1414symbols_extra: std.ArrayList(u32) = .empty,
1515globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,
1616dependents: std.ArrayList(Id) = .empty,
17rpaths: std.StringArrayHashMapUnmanaged(void) = .empty,
17rpaths: std.array_hash_map.String(void) = .empty,
1818umbrella: File.Index,
1919platform: ?MachO.Platform = null,
2020
src/link/MachO/Thunk.zig+1-1
......@@ -1,6 +1,6 @@
11value: u64 = 0,
22out_n_sect: u8 = 0,
3symbols: std.AutoArrayHashMapUnmanaged(MachO.Ref, void) = .empty,
3symbols: std.array_hash_map.Auto(MachO.Ref, void) = .empty,
44output_symtab_ctx: MachO.SymtabCtx = .{},
55
66pub fn deinit(thunk: *Thunk, allocator: Allocator) void {
src/link/MachO/ZigObject.zig+4-4
......@@ -1750,11 +1750,11 @@ const TlvInitializer = struct {
17501750 }
17511751};
17521752
1753const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);
1754const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);
1755const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);
1753const NavTable = std.array_hash_map.Auto(InternPool.Nav.Index, AvMetadata);
1754const UavTable = std.array_hash_map.Auto(InternPool.Index, AvMetadata);
1755const LazySymbolTable = std.array_hash_map.Auto(InternPool.Index, LazySymbolMetadata);
17561756const RelocationTable = std.ArrayList(std.ArrayList(Relocation));
1757const TlvInitializerTable = std.AutoArrayHashMapUnmanaged(Atom.Index, TlvInitializer);
1757const TlvInitializerTable = std.array_hash_map.Auto(Atom.Index, TlvInitializer);
17581758
17591759const x86_64 = struct {
17601760 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 {
2323 /// The set of (result-id's of) invocation globals that are accessed
2424 /// in this function, or after resolution, that are accessed in this
2525 /// function or any of it's callees.
26 invocation_globals: std.AutoArrayHashMapUnmanaged(ResultId, void),
26 invocation_globals: std.array_hash_map.Auto(ResultId, void),
2727 };
2828
2929 /// Information about a particular invocation global
3030 const InvocationGlobal = struct {
3131 /// The list of invocation globals that this invocation global
3232 /// depends on.
33 dependencies: std.AutoArrayHashMapUnmanaged(ResultId, void),
33 dependencies: std.array_hash_map.Auto(ResultId, void),
3434 /// The invocation global's type
3535 ty: ResultId,
3636 /// Initializer function. May be `none`.
......@@ -39,13 +39,13 @@ const ModuleInfo = struct {
3939 };
4040
4141 /// Maps function result-id -> Fn information structure.
42 functions: std.AutoArrayHashMapUnmanaged(ResultId, Fn),
42 functions: std.array_hash_map.Auto(ResultId, Fn),
4343 /// 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),
4545 /// For each function, a list of function result-ids that it calls.
4646 callee_store: []const ResultId,
4747 /// 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
5050 /// Fetch the list of callees per function. Guaranteed to contain only unique IDs.
5151 fn callees(self: ModuleInfo, fn_id: ResultId) []const ResultId {
......@@ -342,9 +342,9 @@ const ModuleBuilder = struct {
342342 entry_point_new_id_base: u32,
343343 /// A set of all function types in the new program. SPIR-V mandates that these are unique,
344344 /// 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,
346346 /// 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,
348348 /// Offset of the functions section in the new binary.
349349 new_functions_section: ?usize,
350350
src/link/Wasm.zig+32-32
......@@ -80,27 +80,27 @@ name: []const u8,
8080/// List of relocatable files to be linked into the final binary.
8181objects: std.ArrayList(Object) = .empty,
8282
83func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,
83func_types: std.array_hash_map.Auto(FunctionType, void) = .empty,
8484/// Provides a mapping of both imports and provided functions to symbol name.
8585/// Local functions may be unnamed.
8686/// 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,
8888/// All functions for all objects.
8989object_functions: std.ArrayList(ObjectFunction) = .empty,
9090
9191/// Provides a mapping of both imports and provided globals to symbol name.
9292/// Local globals may be unnamed.
93object_global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImport) = .empty,
93object_global_imports: std.array_hash_map.Auto(String, GlobalImport) = .empty,
9494/// All globals for all objects.
9595object_globals: std.ArrayList(ObjectGlobal) = .empty,
9696
9797/// 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,
9999/// All parsed table sections for all objects.
100100object_tables: std.ArrayList(Table) = .empty,
101101
102102/// 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,
104104/// All parsed memory sections for all objects.
105105object_memories: std.ArrayList(ObjectMemory) = .empty,
106106
......@@ -119,15 +119,15 @@ object_data_segments: std.ArrayList(ObjectDataSegment) = .empty,
119119/// Each segment has many data symbols, which correspond logically to global
120120/// constants.
121121object_datas: std.ArrayList(ObjectData) = .empty,
122object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty,
122object_data_imports: std.array_hash_map.Auto(String, ObjectDataImport) = .empty,
123123/// 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
126126/// All comdat information for all objects.
127127object_comdats: std.ArrayList(Comdat) = .empty,
128128/// A table that maps the relocations to be performed where the key represents
129129/// 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,
131131/// Incremented across all objects in order to enable calculation of `ObjectSectionIndex` values.
132132object_total_sections: u32 = 0,
133133/// All comdat symbols from all objects concatenated.
......@@ -150,7 +150,7 @@ nav_fixups: std.ArrayList(NavFixup) = .empty,
150150func_table_fixups: std.ArrayList(FuncTableFixup) = .empty,
151151/// Symbols to be emitted into an object file. Remains empty when not emitting
152152/// an object file.
153symbol_table: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
153symbol_table: std.array_hash_map.Auto(String, void) = .empty,
154154
155155/// When importing objects from the host environment, a name must be supplied.
156156/// LLVM uses "env" by default when none is given.
......@@ -174,24 +174,24 @@ preloaded_strings: PreloadedStrings,
174174
175175/// This field is used when emitting an object; `navs_exe` used otherwise.
176176/// 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,
178178/// This field is unused when emitting an object; `navs_obj` used otherwise.
179179/// 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,
181181/// Tracks all InternPool values referenced by codegen. Needed for outputting
182182/// the data segment. This one does not track ref count because object files
183183/// 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,
185185/// 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,
187187/// Sparse table of uavs that need to be emitted with greater alignment than
188188/// the default for the type.
189overaligned_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment) = .empty,
189overaligned_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment) = .empty,
190190/// When the key is an enum type, this represents a `@tagName` function.
191zcu_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuFunc) = .empty,
192nav_exports: std.AutoArrayHashMapUnmanaged(NavExport, Zcu.Export.Index) = .empty,
193uav_exports: std.AutoArrayHashMapUnmanaged(UavExport, Zcu.Export.Index) = .empty,
194imports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,
191zcu_funcs: std.array_hash_map.Auto(InternPool.Index, ZcuFunc) = .empty,
192nav_exports: std.array_hash_map.Auto(NavExport, Zcu.Export.Index) = .empty,
193uav_exports: std.array_hash_map.Auto(UavExport, Zcu.Export.Index) = .empty,
194imports: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
195195
196196dwarf: ?Dwarf = null,
197197
......@@ -200,19 +200,19 @@ flush_buffer: Flush = .{},
200200/// Empty until `prelink`. There it is populated based on object files.
201201/// Next, it is copied into `Flush.missing_exports` just before `flush`
202202/// and that data is used during `flush`.
203missing_exports: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
203missing_exports: std.array_hash_map.Auto(String, void) = .empty,
204204entry_resolution: FunctionImport.Resolution = .unresolved,
205205
206206/// Empty when outputting an object.
207function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,
208hidden_function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,
207function_exports: std.array_hash_map.Auto(String, FunctionIndex) = .empty,
208hidden_function_exports: std.array_hash_map.Auto(String, FunctionIndex) = .empty,
209209global_exports: std.ArrayList(GlobalExport) = .empty,
210210/// Tracks the value at the end of prelink.
211211global_exports_len: u32 = 0,
212212
213213/// Ordered list of non-import functions that will appear in the final binary.
214214/// Empty until prelink.
215functions: std.AutoArrayHashMapUnmanaged(FunctionImport.Resolution, void) = .empty,
215functions: std.array_hash_map.Auto(FunctionImport.Resolution, void) = .empty,
216216/// Tracks the value at the end of prelink, at which point `functions`
217217/// contains only object file functions, and nothing from the Zcu yet.
218218functions_end_prelink: u32 = 0,
......@@ -230,7 +230,7 @@ data_imports_len_prelink: u32 = 0,
230230/// `flush` gets a copy of this table, and then Zcu exports are applied to
231231/// remove elements from the table, and the remainder are either undefined
232232/// 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
235235/// At the end of prelink, this is populated with data symbols needed by
236236/// objects.
......@@ -243,29 +243,29 @@ function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImportId) = .emp
243243/// `flush` gets a copy of this table, and then Zcu exports are applied to
244244/// remove elements from the table, and the remainder are either undefined
245245/// 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,
247247/// Set of data symbols that will appear in the final binary. Used to populate
248248/// `Flush.data_segments` before sorting.
249data_segments: std.AutoArrayHashMapUnmanaged(DataSegmentId, void) = .empty,
249data_segments: std.array_hash_map.Auto(DataSegmentId, void) = .empty,
250250
251251/// Ordered list of non-import globals that will appear in the final binary.
252252/// Empty until prelink.
253globals: std.AutoArrayHashMapUnmanaged(GlobalImport.Resolution, void) = .empty,
253globals: std.array_hash_map.Auto(GlobalImport.Resolution, void) = .empty,
254254/// Tracks the value at the end of prelink, at which point `globals`
255255/// contains only object file globals, and nothing from the Zcu yet.
256256globals_end_prelink: u32 = 0,
257global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImportId) = .empty,
257global_imports: std.array_hash_map.Auto(String, GlobalImportId) = .empty,
258258
259259/// Ordered list of non-import tables that will appear in the final binary.
260260/// Empty until prelink.
261tables: std.AutoArrayHashMapUnmanaged(TableImport.Resolution, void) = .empty,
262table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport.Index) = .empty,
261tables: std.array_hash_map.Auto(TableImport.Resolution, void) = .empty,
262table_imports: std.array_hash_map.Auto(String, TableImport.Index) = .empty,
263263
264264/// All functions that have had their address taken and therefore might be
265265/// called via a `call_indirect` function.
266zcu_indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,
267object_indirect_function_import_set: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
268object_indirect_function_set: std.AutoArrayHashMapUnmanaged(ObjectFunctionIndex, void) = .empty,
266zcu_indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
267object_indirect_function_import_set: std.array_hash_map.Auto(String, void) = .empty,
268object_indirect_function_set: std.array_hash_map.Auto(ObjectFunctionIndex, void) = .empty,
269269
270270error_name_table_ref_count: u32 = 0,
271271tag_name_table_ref_count: u32 = 0,
src/link/Wasm/Archive.zig+1-1
......@@ -12,7 +12,7 @@ toc: Toc,
1212
1313/// Key points into `LazyArchive` `file_contents`.
1414/// Value is allocated with gpa.
15const Toc = std.StringArrayHashMapUnmanaged(std.ArrayList(u32));
15const Toc = std.array_hash_map.String(std.ArrayList(u32));
1616
1717const ARMAG = std.elf.ARMAG;
1818const ARFMAG = std.elf.ARFMAG;
src/link/Wasm/Flush.zig+7-7
......@@ -24,22 +24,22 @@ const ArrayList = std.ArrayList;
2424/// Ordered list of data segments that will appear in the final binary.
2525/// When sorted, to-be-merged segments will be made adjacent.
2626/// Values are virtual address.
27data_segments: std.AutoArrayHashMapUnmanaged(Wasm.DataSegmentId, u32) = .empty,
27data_segments: std.array_hash_map.Auto(Wasm.DataSegmentId, u32) = .empty,
2828/// Each time a `data_segment` offset equals zero it indicates a new group, and
2929/// the next element in this array will contain the total merged segment size.
3030/// Value is the virtual memory address of the end of the segment.
3131data_segment_groups: ArrayList(DataSegmentGroup) = .empty,
3232
3333binary_bytes: ArrayList(u8) = .empty,
34missing_exports: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
35function_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.FunctionImportId) = .empty,
36global_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.GlobalImportId) = .empty,
37data_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.DataImportId) = .empty,
34missing_exports: std.array_hash_map.Auto(String, void) = .empty,
35function_imports: std.array_hash_map.Auto(String, Wasm.FunctionImportId) = .empty,
36global_imports: std.array_hash_map.Auto(String, Wasm.GlobalImportId) = .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
4141/// 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
4444/// For debug purposes only.
4545memory_layout_finished: bool = false,
src/main.zig+7-7
......@@ -987,7 +987,7 @@ fn buildOutputType(
987987 var test_no_exec = false;
988988 var test_execve = false;
989989 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;
991991 var stack_size: ?u64 = null;
992992 var image_base: ?u64 = null;
993993 var link_eh_frame_hdr = false;
......@@ -1024,7 +1024,7 @@ fn buildOutputType(
10241024 // These are before resolving sysroot.
10251025 var extra_cflags: std.ArrayList([]const u8) = .empty;
10261026 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;
10281028 var rc_includes: std.zig.RcIncludes = .any;
10291029 var manifest_file: ?[]const u8 = null;
10301030 var linker_export_symbol_names: std.ArrayList([]const u8) = .empty;
......@@ -3592,7 +3592,7 @@ fn buildOutputType(
35923592 defer file_system_inputs.deinit(gpa);
35933593
35943594 // Deduplicate rpath entries
3595 var rpath_dedup = std.StringArrayHashMapUnmanaged(void){};
3595 var rpath_dedup = std.array_hash_map.String(void){};
35963596 for (create_module.rpath_list.items) |rpath| {
35973597 try rpath_dedup.put(arena, rpath, {});
35983598 }
......@@ -3896,7 +3896,7 @@ fn buildOutputType(
38963896
38973897const CreateModule = struct {
38983898 dirs: Compilation.Directories,
3899 modules: std.StringArrayHashMapUnmanaged(CliModule),
3899 modules: std.array_hash_map.String(CliModule),
39003900 opts: Compilation.Config.Options,
39013901 dynamic_linker: ?[]const u8,
39023902 object_format: ?[]const u8,
......@@ -3908,7 +3908,7 @@ const CreateModule = struct {
39083908 /// link_libcpp, and then the libraries are filtered into
39093909 /// `unresolved_link_inputs` and `windows_libs`.
39103910 cli_link_inputs: std.ArrayList(link.UnresolvedInput),
3911 windows_libs: std.StringArrayHashMapUnmanaged(void),
3911 windows_libs: std.array_hash_map.String(void),
39123912 /// The local variable `unresolved_link_inputs` is fed into library
39133913 /// resolution, mutating the input array, and producing this data as
39143914 /// output. Allocated with gpa.
......@@ -3926,7 +3926,7 @@ const CreateModule = struct {
39263926 lib_dir_args: std.ArrayList([]const u8),
39273927 libc_installation: ?LibCInstallation,
39283928 want_native_include_dirs: bool,
3929 frameworks: std.StringArrayHashMapUnmanaged(Framework),
3929 frameworks: std.array_hash_map.String(Framework),
39303930 native_system_include_paths: []const []const u8,
39313931 framework_dirs: std.ArrayList([]const u8),
39323932 rpath_list: std.ArrayList([]const u8),
......@@ -4419,7 +4419,7 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {
44194419
44204420 var file_name_bytes: std.ArrayList(u8) = .empty;
44214421 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;
44234423 defer files.deinit(gpa);
44244424 var decl_data: std.ArrayList(u8) = .empty;
44254425 defer decl_data.deinit(gpa);
tools/dump-cov.zig+1-1
......@@ -67,7 +67,7 @@ pub fn main(init: std.process.Init) !void {
6767 try stdout.print("{any}\n", .{header.*});
6868 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;
7171 try indexed_pcs.entries.resize(arena, pcs.len);
7272 @memcpy(indexed_pcs.entries.items(.key), pcs);
7373 try indexed_pcs.reIndex(arena);