authorgravatar for 106487517+bnjmnjrk@users.noreply.github.comBenjamin Jurk <106487517+bnjmnjrk@users.noreply.github.com> 2025-11-20 23:46:23+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-11-20 14:46:23-08:00
log4b5351bc0ddc248d6935d7d160a57cb4dfe4dedd
tree8ce84d4e44a8ee1abaf0ef71d8287cec4b0f8c0a
parentdb622f14c445b4f55981636543c546e22346abd5
signaturebadge-check Signed by PGP key B5690EEEBB952194

update deprecated ArrayListUnmanaged usage (#25958)


112 files changed, 630 insertions(+), 631 deletions(-)

doc/langref/test_switch_dispatch_loop.zig+1-1
...@@ -9,7 +9,7 @@ const Instruction = enum {...@@ -9,7 +9,7 @@ const Instruction = enum {
99
10fn evaluate(initial_stack: []const i32, code: []const Instruction) !i32 {10fn evaluate(initial_stack: []const i32, code: []const Instruction) !i32 {
11 var buffer: [8]i32 = undefined;11 var buffer: [8]i32 = undefined;
12 var stack = std.ArrayListUnmanaged(i32).initBuffer(&buffer);12 var stack = std.ArrayList(i32).initBuffer(&buffer);
13 try stack.appendSliceBounded(initial_stack);13 try stack.appendSliceBounded(initial_stack);
14 var ip: usize = 0;14 var ip: usize = 0;
1515
lib/build-web/fuzz.zig+9-9
...@@ -42,7 +42,7 @@ pub fn sourceIndexMessage(msg_bytes: []u8) error{OutOfMemory}!void {...@@ -42,7 +42,7 @@ pub fn sourceIndexMessage(msg_bytes: []u8) error{OutOfMemory}!void {
4242
43var coverage = Coverage.init;43var coverage = Coverage.init;
44/// Index of type `SourceLocationIndex`.44/// Index of type `SourceLocationIndex`.
45var coverage_source_locations: std.ArrayListUnmanaged(Coverage.SourceLocation) = .empty;45var coverage_source_locations: std.ArrayList(Coverage.SourceLocation) = .empty;
46/// Contains the most recent coverage update message, unmodified.46/// Contains the most recent coverage update message, unmodified.
47var recent_coverage_update: std.ArrayListAlignedUnmanaged(u8, .of(u64)) = .empty;47var recent_coverage_update: std.ArrayListAlignedUnmanaged(u8, .of(u64)) = .empty;
4848
...@@ -76,7 +76,7 @@ pub fn coverageUpdateMessage(msg_bytes: []u8) error{OutOfMemory}!void {...@@ -76,7 +76,7 @@ pub fn coverageUpdateMessage(msg_bytes: []u8) error{OutOfMemory}!void {
76 try updateCoverage();76 try updateCoverage();
77}77}
7878
79var entry_points: std.ArrayListUnmanaged(SourceLocationIndex) = .empty;79var entry_points: std.ArrayList(SourceLocationIndex) = .empty;
8080
81pub fn entryPointsMessage(msg_bytes: []u8) error{OutOfMemory}!void {81pub fn entryPointsMessage(msg_bytes: []u8) error{OutOfMemory}!void {
82 const header: abi.fuzz.EntryPointHeader = @bitCast(msg_bytes[0..@sizeOf(abi.fuzz.EntryPointHeader)].*);82 const header: abi.fuzz.EntryPointHeader = @bitCast(msg_bytes[0..@sizeOf(abi.fuzz.EntryPointHeader)].*);
...@@ -127,7 +127,7 @@ const SourceLocationIndex = enum(u32) {...@@ -127,7 +127,7 @@ const SourceLocationIndex = enum(u32) {
127 }127 }
128128
129 fn toWalkFile(sli: SourceLocationIndex) ?Walk.File.Index {129 fn toWalkFile(sli: SourceLocationIndex) ?Walk.File.Index {
130 var buf: std.ArrayListUnmanaged(u8) = .empty;130 var buf: std.ArrayList(u8) = .empty;
131 defer buf.deinit(gpa);131 defer buf.deinit(gpa);
132 sli.appendPath(&buf) catch @panic("OOM");132 sli.appendPath(&buf) catch @panic("OOM");
133 return @enumFromInt(Walk.files.getIndex(buf.items) orelse return null);133 return @enumFromInt(Walk.files.getIndex(buf.items) orelse return null);
...@@ -135,11 +135,11 @@ const SourceLocationIndex = enum(u32) {...@@ -135,11 +135,11 @@ const SourceLocationIndex = enum(u32) {
135135
136 fn fileHtml(136 fn fileHtml(
137 sli: SourceLocationIndex,137 sli: SourceLocationIndex,
138 out: *std.ArrayListUnmanaged(u8),138 out: *std.ArrayList(u8),
139 ) error{ OutOfMemory, SourceUnavailable }!void {139 ) error{ OutOfMemory, SourceUnavailable }!void {
140 const walk_file_index = sli.toWalkFile() orelse return error.SourceUnavailable;140 const walk_file_index = sli.toWalkFile() orelse return error.SourceUnavailable;
141 const root_node = walk_file_index.findRootDecl().get().ast_node;141 const root_node = walk_file_index.findRootDecl().get().ast_node;
142 var annotations: std.ArrayListUnmanaged(html_render.Annotation) = .empty;142 var annotations: std.ArrayList(html_render.Annotation) = .empty;
143 defer annotations.deinit(gpa);143 defer annotations.deinit(gpa);
144 try computeSourceAnnotations(sli.ptr().file, walk_file_index, &annotations, coverage_source_locations.items);144 try computeSourceAnnotations(sli.ptr().file, walk_file_index, &annotations, coverage_source_locations.items);
145 html_render.fileSourceHtml(walk_file_index, out, root_node, .{145 html_render.fileSourceHtml(walk_file_index, out, root_node, .{
...@@ -153,13 +153,13 @@ const SourceLocationIndex = enum(u32) {...@@ -153,13 +153,13 @@ const SourceLocationIndex = enum(u32) {
153fn computeSourceAnnotations(153fn computeSourceAnnotations(
154 cov_file_index: Coverage.File.Index,154 cov_file_index: Coverage.File.Index,
155 walk_file_index: Walk.File.Index,155 walk_file_index: Walk.File.Index,
156 annotations: *std.ArrayListUnmanaged(html_render.Annotation),156 annotations: *std.ArrayList(html_render.Annotation),
157 source_locations: []const Coverage.SourceLocation,157 source_locations: []const Coverage.SourceLocation,
158) !void {158) !void {
159 // Collect all the source locations from only this file into this array159 // Collect all the source locations from only this file into this array
160 // first, then sort by line, col, so that we can collect annotations with160 // first, then sort by line, col, so that we can collect annotations with
161 // O(N) time complexity.161 // O(N) time complexity.
162 var locs: std.ArrayListUnmanaged(SourceLocationIndex) = .empty;162 var locs: std.ArrayList(SourceLocationIndex) = .empty;
163 defer locs.deinit(gpa);163 defer locs.deinit(gpa);
164164
165 for (source_locations, 0..) |sl, sli_usize| {165 for (source_locations, 0..) |sl, sli_usize| {
...@@ -309,7 +309,7 @@ fn updateCoverage() error{OutOfMemory}!void {...@@ -309,7 +309,7 @@ fn updateCoverage() error{OutOfMemory}!void {
309 if (recent_coverage_update.items.len == 0) return;309 if (recent_coverage_update.items.len == 0) return;
310 const want_file = (selected_source_location orelse return).ptr().file;310 const want_file = (selected_source_location orelse return).ptr().file;
311311
312 var covered: std.ArrayListUnmanaged(SourceLocationIndex) = .empty;312 var covered: std.ArrayList(SourceLocationIndex) = .empty;
313 defer covered.deinit(gpa);313 defer covered.deinit(gpa);
314314
315 // This code assumes 64-bit elements, which is incorrect if the executable315 // This code assumes 64-bit elements, which is incorrect if the executable
...@@ -340,7 +340,7 @@ fn updateCoverage() error{OutOfMemory}!void {...@@ -340,7 +340,7 @@ fn updateCoverage() error{OutOfMemory}!void {
340fn updateSource() error{OutOfMemory}!void {340fn updateSource() error{OutOfMemory}!void {
341 if (recent_coverage_update.items.len == 0) return;341 if (recent_coverage_update.items.len == 0) return;
342 const file_sli = selected_source_location.?;342 const file_sli = selected_source_location.?;
343 var html: std.ArrayListUnmanaged(u8) = .empty;343 var html: std.ArrayList(u8) = .empty;
344 defer html.deinit(gpa);344 defer html.deinit(gpa);
345 file_sli.fileHtml(&html) catch |err| switch (err) {345 file_sli.fileHtml(&html) catch |err| switch (err) {
346 error.OutOfMemory => |e| return e,346 error.OutOfMemory => |e| return e,
lib/build-web/time_report.zig+1-1
...@@ -254,7 +254,7 @@ pub fn runTestResultMessage(msg_bytes: []u8) error{OutOfMemory}!void {...@@ -254,7 +254,7 @@ pub fn runTestResultMessage(msg_bytes: []u8) error{OutOfMemory}!void {
254 const durations: []align(1) const u64 = @ptrCast(trailing[0 .. hdr.tests_len * 8]);254 const durations: []align(1) const u64 = @ptrCast(trailing[0 .. hdr.tests_len * 8]);
255 var offset: usize = hdr.tests_len * 8;255 var offset: usize = hdr.tests_len * 8;
256256
257 var table_html: std.ArrayListUnmanaged(u8) = .empty;257 var table_html: std.ArrayList(u8) = .empty;
258 defer table_html.deinit(gpa);258 defer table_html.deinit(gpa);
259259
260 for (durations) |test_ns| {260 for (durations) |test_ns| {
lib/compiler/build_runner.zig+3-3
...@@ -459,7 +459,7 @@ pub fn main() !void {...@@ -459,7 +459,7 @@ pub fn main() !void {
459 }459 }
460460
461 if (graph.needed_lazy_dependencies.entries.len != 0) {461 if (graph.needed_lazy_dependencies.entries.len != 0) {
462 var buffer: std.ArrayListUnmanaged(u8) = .empty;462 var buffer: std.ArrayList(u8) = .empty;
463 for (graph.needed_lazy_dependencies.keys()) |k| {463 for (graph.needed_lazy_dependencies.keys()) |k| {
464 try buffer.appendSlice(arena, k);464 try buffer.appendSlice(arena, k);
465 try buffer.append(arena, '\n');465 try buffer.append(arena, '\n');
...@@ -672,7 +672,7 @@ const Run = struct {...@@ -672,7 +672,7 @@ const Run = struct {
672 watch: bool,672 watch: bool,
673 web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn,673 web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn,
674 /// Allocated into `gpa`.674 /// Allocated into `gpa`.
675 memory_blocked_steps: std.ArrayListUnmanaged(*Step),675 memory_blocked_steps: std.ArrayList(*Step),
676 /// Allocated into `gpa`.676 /// Allocated into `gpa`.
677 step_stack: std.AutoArrayHashMapUnmanaged(*Step, void),677 step_stack: std.AutoArrayHashMapUnmanaged(*Step, void),
678 thread_pool: std.Thread.Pool,678 thread_pool: std.Thread.Pool,
...@@ -1468,7 +1468,7 @@ pub fn printErrorMessages(...@@ -1468,7 +1468,7 @@ pub fn printErrorMessages(
1468 if (error_style.verboseContext()) {1468 if (error_style.verboseContext()) {
1469 // Provide context for where these error messages are coming from by1469 // Provide context for where these error messages are coming from by
1470 // printing the corresponding Step subtree.1470 // printing the corresponding Step subtree.
1471 var step_stack: std.ArrayListUnmanaged(*Step) = .empty;1471 var step_stack: std.ArrayList(*Step) = .empty;
1472 defer step_stack.deinit(gpa);1472 defer step_stack.deinit(gpa);
1473 try step_stack.append(gpa, failing_step);1473 try step_stack.append(gpa, failing_step);
1474 while (step_stack.items[step_stack.items.len - 1].dependants.items.len != 0) {1474 while (step_stack.items[step_stack.items.len - 1].dependants.items.len != 0) {
lib/compiler/objcopy.zig+2-2
...@@ -381,8 +381,8 @@ const BinaryElfSegment = struct {...@@ -381,8 +381,8 @@ const BinaryElfSegment = struct {
381};381};
382382
383const BinaryElfOutput = struct {383const BinaryElfOutput = struct {
384 segments: std.ArrayListUnmanaged(*BinaryElfSegment),384 segments: std.ArrayList(*BinaryElfSegment),
385 sections: std.ArrayListUnmanaged(*BinaryElfSection),385 sections: std.ArrayList(*BinaryElfSection),
386 allocator: Allocator,386 allocator: Allocator,
387 shstrtab: ?[]const u8,387 shstrtab: ?[]const u8,
388388
lib/compiler/reduce.zig+1-1
...@@ -109,7 +109,7 @@ pub fn main() !void {...@@ -109,7 +109,7 @@ pub fn main() !void {
109 const root_source_file_path = opt_root_source_file_path orelse109 const root_source_file_path = opt_root_source_file_path orelse
110 fatal("missing root source file path argument; see -h for usage", .{});110 fatal("missing root source file path argument; see -h for usage", .{});
111111
112 var interestingness_argv: std.ArrayListUnmanaged([]const u8) = .empty;112 var interestingness_argv: std.ArrayList([]const u8) = .empty;
113 try interestingness_argv.ensureUnusedCapacity(arena, argv.len + 1);113 try interestingness_argv.ensureUnusedCapacity(arena, argv.len + 1);
114 interestingness_argv.appendAssumeCapacity(checker_path);114 interestingness_argv.appendAssumeCapacity(checker_path);
115 interestingness_argv.appendSliceAssumeCapacity(argv);115 interestingness_argv.appendSliceAssumeCapacity(argv);
lib/compiler/reduce/Walk.zig+1-1
...@@ -23,7 +23,7 @@ pub const Transformation = union(enum) {...@@ -23,7 +23,7 @@ pub const Transformation = union(enum) {
23 delete_var_decl: struct {23 delete_var_decl: struct {
24 var_decl_node: Ast.Node.Index,24 var_decl_node: Ast.Node.Index,
25 /// Identifier nodes that reference the variable.25 /// Identifier nodes that reference the variable.
26 references: std.ArrayListUnmanaged(Ast.Node.Index),26 references: std.ArrayList(Ast.Node.Index),
27 },27 },
28 /// Replace an expression with `undefined`.28 /// Replace an expression with `undefined`.
29 replace_with_undef: Ast.Node.Index,29 replace_with_undef: Ast.Node.Index,
lib/compiler/std-docs.zig+1-1
...@@ -284,7 +284,7 @@ fn buildWasmBinary(...@@ -284,7 +284,7 @@ fn buildWasmBinary(
284) !Cache.Path {284) !Cache.Path {
285 const gpa = context.gpa;285 const gpa = context.gpa;
286286
287 var argv: std.ArrayListUnmanaged([]const u8) = .empty;287 var argv: std.ArrayList([]const u8) = .empty;
288288
289 try argv.appendSlice(arena, &.{289 try argv.appendSlice(arena, &.{
290 context.zig_exe_path, //290 context.zig_exe_path, //
lib/compiler/test_runner.zig+1-1
...@@ -104,7 +104,7 @@ fn mainServer() !void {...@@ -104,7 +104,7 @@ fn mainServer() !void {
104 @panic("internal test runner memory leak");104 @panic("internal test runner memory leak");
105 };105 };
106106
107 var string_bytes: std.ArrayListUnmanaged(u8) = .empty;107 var string_bytes: std.ArrayList(u8) = .empty;
108 defer string_bytes.deinit(testing.allocator);108 defer string_bytes.deinit(testing.allocator);
109 try string_bytes.append(testing.allocator, 0); // Reserve 0 for null.109 try string_bytes.append(testing.allocator, 0); // Reserve 0 for null.
110110
lib/docs/wasm/Walk.zig+1-1
...@@ -11,7 +11,7 @@ const Oom = error{OutOfMemory};...@@ -11,7 +11,7 @@ const Oom = error{OutOfMemory};
11pub const Decl = @import("Decl.zig");11pub const Decl = @import("Decl.zig");
1212
13pub var files: std.StringArrayHashMapUnmanaged(File) = .empty;13pub var files: std.StringArrayHashMapUnmanaged(File) = .empty;
14pub var decls: std.ArrayListUnmanaged(Decl) = .empty;14pub var decls: std.ArrayList(Decl) = .empty;
15pub var modules: std.StringArrayHashMapUnmanaged(File.Index) = .empty;15pub var modules: std.StringArrayHashMapUnmanaged(File.Index) = .empty;
1616
17file: File.Index,17file: File.Index,
lib/docs/wasm/markdown/Parser.zig+1-1
...@@ -29,7 +29,7 @@ const Node = Document.Node;...@@ -29,7 +29,7 @@ const Node = Document.Node;
29const ExtraIndex = Document.ExtraIndex;29const ExtraIndex = Document.ExtraIndex;
30const ExtraData = Document.ExtraData;30const ExtraData = Document.ExtraData;
31const StringIndex = Document.StringIndex;31const StringIndex = Document.StringIndex;
32const ArrayList = std.ArrayListUnmanaged;32const ArrayList = std.ArrayList;
3333
34nodes: Node.List = .{},34nodes: Node.List = .{},
35extra: ArrayList(u32) = .empty,35extra: ArrayList(u32) = .empty,
lib/fuzzer.zig+7-7
...@@ -280,10 +280,10 @@ const Instrumentation = struct {...@@ -280,10 +280,10 @@ const Instrumentation = struct {
280 /// Values that have been constant operands in comparisons and switch cases.280 /// Values that have been constant operands in comparisons and switch cases.
281 /// There may be duplicates in this array if they came from different addresses, which is281 /// There may be duplicates in this array if they came from different addresses, which is
282 /// fine as they are likely more important and hence more likely to be selected.282 /// fine as they are likely more important and hence more likely to be selected.
283 const_vals2: std.ArrayListUnmanaged(u16) = .empty,283 const_vals2: std.ArrayList(u16) = .empty,
284 const_vals4: std.ArrayListUnmanaged(u32) = .empty,284 const_vals4: std.ArrayList(u32) = .empty,
285 const_vals8: std.ArrayListUnmanaged(u64) = .empty,285 const_vals8: std.ArrayList(u64) = .empty,
286 const_vals16: std.ArrayListUnmanaged(u128) = .empty,286 const_vals16: std.ArrayList(u128) = .empty,
287287
288 /// A minimal state for this struct which instrumentation can function on.288 /// A minimal state for this struct which instrumentation can function on.
289 /// Used before this structure is initialized to avoid illegal behavior289 /// Used before this structure is initialized to avoid illegal behavior
...@@ -384,11 +384,11 @@ const Fuzzer = struct {...@@ -384,11 +384,11 @@ const Fuzzer = struct {
384 /// Minimized past inputs leading to new pc hits.384 /// Minimized past inputs leading to new pc hits.
385 /// These are randomly mutated in round-robin fashion385 /// These are randomly mutated in round-robin fashion
386 /// Element zero is always an empty input. It is gauraunteed no other elements are empty.386 /// Element zero is always an empty input. It is gauraunteed no other elements are empty.
387 corpus: std.ArrayListUnmanaged([]const u8),387 corpus: std.ArrayList([]const u8),
388 corpus_pos: usize,388 corpus_pos: usize,
389 /// List of past mutations that have led to new inputs. This way, the mutations that are the389 /// List of past mutations that have led to new inputs. This way, the mutations that are the
390 /// most effective are the most likely to be selected again. Starts with one of each mutation.390 /// most effective are the most likely to be selected again. Starts with one of each mutation.
391 mutations: std.ArrayListUnmanaged(Mutation) = .empty,391 mutations: std.ArrayList(Mutation) = .empty,
392392
393 /// Filesystem directory containing found inputs for future runs393 /// Filesystem directory containing found inputs for future runs
394 corpus_dir: std.fs.Dir,394 corpus_dir: std.fs.Dir,
...@@ -1308,7 +1308,7 @@ const Mutation = enum {...@@ -1308,7 +1308,7 @@ const Mutation = enum {
1308 }1308 }
1309};1309};
13101310
1311/// Like `std.ArrayListUnmanaged(u8)` but backed by memory mapping.1311/// Like `std.ArrayList(u8)` but backed by memory mapping.
1312pub const MemoryMappedList = struct {1312pub const MemoryMappedList = struct {
1313 /// Contents of the list.1313 /// Contents of the list.
1314 ///1314 ///
lib/std/Build/Cache.zig+3-3
...@@ -1063,10 +1063,10 @@ pub const Manifest = struct {...@@ -1063,10 +1063,10 @@ pub const Manifest = struct {
1063 const dep_file_contents = try dir.readFileAlloc(dep_file_sub_path, gpa, .limited(manifest_file_size_max));1063 const dep_file_contents = try dir.readFileAlloc(dep_file_sub_path, gpa, .limited(manifest_file_size_max));
1064 defer gpa.free(dep_file_contents);1064 defer gpa.free(dep_file_contents);
10651065
1066 var error_buf: std.ArrayListUnmanaged(u8) = .empty;1066 var error_buf: std.ArrayList(u8) = .empty;
1067 defer error_buf.deinit(gpa);1067 defer error_buf.deinit(gpa);
10681068
1069 var resolve_buf: std.ArrayListUnmanaged(u8) = .empty;1069 var resolve_buf: std.ArrayList(u8) = .empty;
1070 defer resolve_buf.deinit(gpa);1070 defer resolve_buf.deinit(gpa);
10711071
1072 var it: DepTokenizer = .{ .bytes = dep_file_contents };1072 var it: DepTokenizer = .{ .bytes = dep_file_contents };
...@@ -1217,7 +1217,7 @@ pub const Manifest = struct {...@@ -1217,7 +1217,7 @@ pub const Manifest = struct {
1217 self.files.deinit(self.cache.gpa);1217 self.files.deinit(self.cache.gpa);
1218 }1218 }
12191219
1220 pub fn populateFileSystemInputs(man: *Manifest, buf: *std.ArrayListUnmanaged(u8)) Allocator.Error!void {1220 pub fn populateFileSystemInputs(man: *Manifest, buf: *std.ArrayList(u8)) Allocator.Error!void {
1221 assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".fields.len == man.cache.prefixes_len);1221 assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".fields.len == man.cache.prefixes_len);
1222 buf.clearRetainingCapacity();1222 buf.clearRetainingCapacity();
1223 const gpa = man.cache.gpa;1223 const gpa = man.cache.gpa;
lib/std/Build/Cache/DepTokenizer.zig+6-6
...@@ -363,7 +363,7 @@ pub const Token = union(enum) {...@@ -363,7 +363,7 @@ pub const Token = union(enum) {
363 };363 };
364364
365 /// Resolve escapes in target or prereq. Only valid with .target_must_resolve or .prereq_must_resolve.365 /// Resolve escapes in target or prereq. Only valid with .target_must_resolve or .prereq_must_resolve.
366 pub fn resolve(self: Token, gpa: Allocator, list: *std.ArrayListUnmanaged(u8)) error{OutOfMemory}!void {366 pub fn resolve(self: Token, gpa: Allocator, list: *std.ArrayList(u8)) error{OutOfMemory}!void {
367 switch (self) {367 switch (self) {
368 .target_must_resolve => |bytes| {368 .target_must_resolve => |bytes| {
369 var state: enum { start, escape, dollar } = .start;369 var state: enum { start, escape, dollar } = .start;
...@@ -429,7 +429,7 @@ pub const Token = union(enum) {...@@ -429,7 +429,7 @@ pub const Token = union(enum) {
429 }429 }
430 }430 }
431431
432 pub fn printError(self: Token, gpa: Allocator, list: *std.ArrayListUnmanaged(u8)) error{OutOfMemory}!void {432 pub fn printError(self: Token, gpa: Allocator, list: *std.ArrayList(u8)) error{OutOfMemory}!void {
433 switch (self) {433 switch (self) {
434 .target, .target_must_resolve, .prereq, .prereq_must_resolve => unreachable, // not an error434 .target, .target_must_resolve, .prereq, .prereq_must_resolve => unreachable, // not an error
435 .incomplete_quoted_prerequisite,435 .incomplete_quoted_prerequisite,
...@@ -1027,8 +1027,8 @@ fn depTokenizer(input: []const u8, expect: []const u8) !void {...@@ -1027,8 +1027,8 @@ fn depTokenizer(input: []const u8, expect: []const u8) !void {
1027 defer arena_allocator.deinit();1027 defer arena_allocator.deinit();
10281028
1029 var it: Tokenizer = .{ .bytes = input };1029 var it: Tokenizer = .{ .bytes = input };
1030 var buffer: std.ArrayListUnmanaged(u8) = .empty;1030 var buffer: std.ArrayList(u8) = .empty;
1031 var resolve_buf: std.ArrayListUnmanaged(u8) = .empty;1031 var resolve_buf: std.ArrayList(u8) = .empty;
1032 var i: usize = 0;1032 var i: usize = 0;
1033 while (it.next()) |token| {1033 while (it.next()) |token| {
1034 if (i != 0) try buffer.appendSlice(arena, "\n");1034 if (i != 0) try buffer.appendSlice(arena, "\n");
...@@ -1076,11 +1076,11 @@ fn depTokenizer(input: []const u8, expect: []const u8) !void {...@@ -1076,11 +1076,11 @@ fn depTokenizer(input: []const u8, expect: []const u8) !void {
1076 try testing.expectEqualStrings(expect, buffer.items);1076 try testing.expectEqualStrings(expect, buffer.items);
1077}1077}
10781078
1079fn printCharValues(gpa: Allocator, list: *std.ArrayListUnmanaged(u8), bytes: []const u8) !void {1079fn printCharValues(gpa: Allocator, list: *std.ArrayList(u8), bytes: []const u8) !void {
1080 for (bytes) |b| try list.append(gpa, printable_char_tab[b]);1080 for (bytes) |b| try list.append(gpa, printable_char_tab[b]);
1081}1081}
10821082
1083fn printUnderstandableChar(gpa: Allocator, list: *std.ArrayListUnmanaged(u8), char: u8) !void {1083fn printUnderstandableChar(gpa: Allocator, list: *std.ArrayList(u8), char: u8) !void {
1084 if (std.ascii.isPrint(char)) {1084 if (std.ascii.isPrint(char)) {
1085 try list.print(gpa, "'{c}'", .{char});1085 try list.print(gpa, "'{c}'", .{char});
1086 } else {1086 } else {
lib/std/Build/Fuzz.zig+3-3
...@@ -33,7 +33,7 @@ coverage_files: std.AutoArrayHashMapUnmanaged(u64, CoverageMap),...@@ -33,7 +33,7 @@ coverage_files: std.AutoArrayHashMapUnmanaged(u64, CoverageMap),
3333
34queue_mutex: std.Thread.Mutex,34queue_mutex: std.Thread.Mutex,
35queue_cond: std.Thread.Condition,35queue_cond: std.Thread.Condition,
36msg_queue: std.ArrayListUnmanaged(Msg),36msg_queue: std.ArrayList(Msg),
3737
38pub const Mode = union(enum) {38pub const Mode = union(enum) {
39 forever: struct { ws: *Build.WebServer },39 forever: struct { ws: *Build.WebServer },
...@@ -65,7 +65,7 @@ const CoverageMap = struct {...@@ -65,7 +65,7 @@ const CoverageMap = struct {
65 coverage: Coverage,65 coverage: Coverage,
66 source_locations: []Coverage.SourceLocation,66 source_locations: []Coverage.SourceLocation,
67 /// Elements are indexes into `source_locations` pointing to the unit tests that are being fuzz tested.67 /// Elements are indexes into `source_locations` pointing to the unit tests that are being fuzz tested.
68 entry_points: std.ArrayListUnmanaged(u32),68 entry_points: std.ArrayList(u32),
69 start_timestamp: i64,69 start_timestamp: i64,
7070
71 fn deinit(cm: *CoverageMap, gpa: Allocator) void {71 fn deinit(cm: *CoverageMap, gpa: Allocator) void {
...@@ -85,7 +85,7 @@ pub fn init(...@@ -85,7 +85,7 @@ pub fn init(
85 mode: Mode,85 mode: Mode,
86) Allocator.Error!Fuzz {86) Allocator.Error!Fuzz {
87 const run_steps: []const *Step.Run = steps: {87 const run_steps: []const *Step.Run = steps: {
88 var steps: std.ArrayListUnmanaged(*Step.Run) = .empty;88 var steps: std.ArrayList(*Step.Run) = .empty;
89 defer steps.deinit(gpa);89 defer steps.deinit(gpa);
90 const rebuild_node = root_prog_node.start("Rebuilding Unit Tests", 0);90 const rebuild_node = root_prog_node.start("Rebuilding Unit Tests", 0);
91 defer rebuild_node.end();91 defer rebuild_node.end();
lib/std/Build/Step/CheckObject.zig+8-8
...@@ -721,12 +721,12 @@ const MachODumper = struct {...@@ -721,12 +721,12 @@ const MachODumper = struct {
721 gpa: Allocator,721 gpa: Allocator,
722 data: []const u8,722 data: []const u8,
723 header: macho.mach_header_64,723 header: macho.mach_header_64,
724 segments: std.ArrayListUnmanaged(macho.segment_command_64) = .empty,724 segments: std.ArrayList(macho.segment_command_64) = .empty,
725 sections: std.ArrayListUnmanaged(macho.section_64) = .empty,725 sections: std.ArrayList(macho.section_64) = .empty,
726 symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty,726 symtab: std.ArrayList(macho.nlist_64) = .empty,
727 strtab: std.ArrayListUnmanaged(u8) = .empty,727 strtab: std.ArrayList(u8) = .empty,
728 indsymtab: std.ArrayListUnmanaged(u32) = .empty,728 indsymtab: std.ArrayList(u32) = .empty,
729 imports: std.ArrayListUnmanaged([]const u8) = .empty,729 imports: std.ArrayList([]const u8) = .empty,
730730
731 fn parse(ctx: *ObjectContext) !void {731 fn parse(ctx: *ObjectContext) !void {
732 var it = try ctx.getLoadCommandIterator();732 var it = try ctx.getLoadCommandIterator();
...@@ -1767,9 +1767,9 @@ const ElfDumper = struct {...@@ -1767,9 +1767,9 @@ const ElfDumper = struct {
1767 const ArchiveContext = struct {1767 const ArchiveContext = struct {
1768 gpa: Allocator,1768 gpa: Allocator,
1769 data: []const u8,1769 data: []const u8,
1770 symtab: std.ArrayListUnmanaged(ArSymtabEntry) = .empty,1770 symtab: std.ArrayList(ArSymtabEntry) = .empty,
1771 strtab: []const u8,1771 strtab: []const u8,
1772 objects: std.ArrayListUnmanaged(struct { name: []const u8, off: usize, len: usize }) = .empty,1772 objects: std.ArrayList(struct { name: []const u8, off: usize, len: usize }) = .empty,
17731773
1774 fn parseSymtab(ctx: *ArchiveContext, raw: []const u8, ptr_width: enum { p32, p64 }) !void {1774 fn parseSymtab(ctx: *ArchiveContext, raw: []const u8, ptr_width: enum { p32, p64 }) !void {
1775 var reader: std.Io.Reader = .fixed(raw);1775 var reader: std.Io.Reader = .fixed(raw);
lib/std/Build/Step/Compile.zig+2-2
...@@ -1801,7 +1801,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {...@@ -1801,7 +1801,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
1801 for (arg, 0..) |c, arg_idx| {1801 for (arg, 0..) |c, arg_idx| {
1802 if (c == '\\' or c == '"') {1802 if (c == '\\' or c == '"') {
1803 // Slow path for arguments that need to be escaped. We'll need to allocate and copy1803 // Slow path for arguments that need to be escaped. We'll need to allocate and copy
1804 var escaped: std.ArrayListUnmanaged(u8) = .empty;1804 var escaped: std.ArrayList(u8) = .empty;
1805 try escaped.ensureTotalCapacityPrecise(arena, arg.len + 1);1805 try escaped.ensureTotalCapacityPrecise(arena, arg.len + 1);
1806 try escaped.appendSlice(arena, arg[0..arg_idx]);1806 try escaped.appendSlice(arena, arg[0..arg_idx]);
1807 for (arg[arg_idx..]) |to_escape| {1807 for (arg[arg_idx..]) |to_escape| {
...@@ -2035,7 +2035,7 @@ fn checkCompileErrors(compile: *Compile) !void {...@@ -2035,7 +2035,7 @@ fn checkCompileErrors(compile: *Compile) !void {
2035 };2035 };
20362036
2037 // Render the expected lines into a string that we can compare verbatim.2037 // Render the expected lines into a string that we can compare verbatim.
2038 var expected_generated: std.ArrayListUnmanaged(u8) = .empty;2038 var expected_generated: std.ArrayList(u8) = .empty;
2039 const expect_errors = compile.expect_errors.?;2039 const expect_errors = compile.expect_errors.?;
20402040
2041 var actual_line_it = mem.splitScalar(u8, actual_errors, '\n');2041 var actual_line_it = mem.splitScalar(u8, actual_errors, '\n');
lib/std/Build/Step/Fmt.zig+1-1
...@@ -48,7 +48,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {...@@ -48,7 +48,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
48 const arena = b.allocator;48 const arena = b.allocator;
49 const fmt: *Fmt = @fieldParentPtr("step", step);49 const fmt: *Fmt = @fieldParentPtr("step", step);
5050
51 var argv: std.ArrayListUnmanaged([]const u8) = .empty;51 var argv: std.ArrayList([]const u8) = .empty;
52 try argv.ensureUnusedCapacity(arena, 2 + 1 + fmt.paths.len + 2 * fmt.exclude_paths.len);52 try argv.ensureUnusedCapacity(arena, 2 + 1 + fmt.paths.len + 2 * fmt.exclude_paths.len);
5353
54 argv.appendAssumeCapacity(b.graph.zig_exe);54 argv.appendAssumeCapacity(b.graph.zig_exe);
lib/std/Build/Step/ObjCopy.zig-1
...@@ -3,7 +3,6 @@ const ObjCopy = @This();...@@ -3,7 +3,6 @@ const ObjCopy = @This();
33
4const Allocator = std.mem.Allocator;4const Allocator = std.mem.Allocator;
5const ArenaAllocator = std.heap.ArenaAllocator;5const ArenaAllocator = std.heap.ArenaAllocator;
6const ArrayListUnmanaged = std.ArrayListUnmanaged;
7const File = std.fs.File;6const File = std.fs.File;
8const InstallDir = std.Build.InstallDir;7const InstallDir = std.Build.InstallDir;
9const Step = std.Build.Step;8const Step = std.Build.Step;
lib/std/Build/Step/Options.zig+7-7
...@@ -12,8 +12,8 @@ pub const base_id: Step.Id = .options;...@@ -12,8 +12,8 @@ pub const base_id: Step.Id = .options;
12step: Step,12step: Step,
13generated_file: GeneratedFile,13generated_file: GeneratedFile,
1414
15contents: std.ArrayListUnmanaged(u8),15contents: std.ArrayList(u8),
16args: std.ArrayListUnmanaged(Arg),16args: std.ArrayList(Arg),
17encountered_types: std.StringHashMapUnmanaged(void),17encountered_types: std.StringHashMapUnmanaged(void),
1818
19pub fn create(owner: *std.Build) *Options {19pub fn create(owner: *std.Build) *Options {
...@@ -45,7 +45,7 @@ fn addOptionFallible(options: *Options, comptime T: type, name: []const u8, valu...@@ -45,7 +45,7 @@ fn addOptionFallible(options: *Options, comptime T: type, name: []const u8, valu
4545
46fn printType(46fn printType(
47 options: *Options,47 options: *Options,
48 out: *std.ArrayListUnmanaged(u8),48 out: *std.ArrayList(u8),
49 comptime T: type,49 comptime T: type,
50 value: T,50 value: T,
51 indent: u8,51 indent: u8,
...@@ -267,7 +267,7 @@ fn printType(...@@ -267,7 +267,7 @@ fn printType(
267 }267 }
268}268}
269269
270fn printUserDefinedType(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T: type, indent: u8) !void {270fn printUserDefinedType(options: *Options, out: *std.ArrayList(u8), comptime T: type, indent: u8) !void {
271 switch (@typeInfo(T)) {271 switch (@typeInfo(T)) {
272 .@"enum" => |info| {272 .@"enum" => |info| {
273 return try printEnum(options, out, T, info, indent);273 return try printEnum(options, out, T, info, indent);
...@@ -281,7 +281,7 @@ fn printUserDefinedType(options: *Options, out: *std.ArrayListUnmanaged(u8), com...@@ -281,7 +281,7 @@ fn printUserDefinedType(options: *Options, out: *std.ArrayListUnmanaged(u8), com
281281
282fn printEnum(282fn printEnum(
283 options: *Options,283 options: *Options,
284 out: *std.ArrayListUnmanaged(u8),284 out: *std.ArrayList(u8),
285 comptime T: type,285 comptime T: type,
286 comptime val: std.builtin.Type.Enum,286 comptime val: std.builtin.Type.Enum,
287 indent: u8,287 indent: u8,
...@@ -309,7 +309,7 @@ fn printEnum(...@@ -309,7 +309,7 @@ fn printEnum(
309 try out.appendSlice(gpa, "};\n");309 try out.appendSlice(gpa, "};\n");
310}310}
311311
312fn printStruct(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T: type, comptime val: std.builtin.Type.Struct, indent: u8) !void {312fn printStruct(options: *Options, out: *std.ArrayList(u8), comptime T: type, comptime val: std.builtin.Type.Struct, indent: u8) !void {
313 const gpa = options.step.owner.allocator;313 const gpa = options.step.owner.allocator;
314 const gop = try options.encountered_types.getOrPut(gpa, @typeName(T));314 const gop = try options.encountered_types.getOrPut(gpa, @typeName(T));
315 if (gop.found_existing) return;315 if (gop.found_existing) return;
...@@ -369,7 +369,7 @@ fn printStruct(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T:...@@ -369,7 +369,7 @@ fn printStruct(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T:
369369
370fn printStructValue(370fn printStructValue(
371 options: *Options,371 options: *Options,
372 out: *std.ArrayListUnmanaged(u8),372 out: *std.ArrayList(u8),
373 comptime struct_val: std.builtin.Type.Struct,373 comptime struct_val: std.builtin.Type.Struct,
374 val: anytype,374 val: anytype,
375 indent: u8,375 indent: u8,
lib/std/Build/Step/Run.zig+4-4
...@@ -16,7 +16,7 @@ pub const base_id: Step.Id = .run;...@@ -16,7 +16,7 @@ pub const base_id: Step.Id = .run;
16step: Step,16step: Step,
1717
18/// See also addArg and addArgs to modifying this directly18/// See also addArg and addArgs to modifying this directly
19argv: std.ArrayListUnmanaged(Arg),19argv: std.ArrayList(Arg),
2020
21/// Use `setCwd` to set the initial current working directory21/// Use `setCwd` to set the initial current working directory
22cwd: ?Build.LazyPath,22cwd: ?Build.LazyPath,
...@@ -63,7 +63,7 @@ stdin: StdIn,...@@ -63,7 +63,7 @@ stdin: StdIn,
63/// If the Run step is determined to have side-effects, the Run step is always63/// If the Run step is determined to have side-effects, the Run step is always
64/// executed when it appears in the build graph, regardless of whether these64/// executed when it appears in the build graph, regardless of whether these
65/// files have been modified.65/// files have been modified.
66file_inputs: std.ArrayListUnmanaged(std.Build.LazyPath),66file_inputs: std.ArrayList(std.Build.LazyPath),
6767
68/// After adding an output argument, this step will by default rename itself68/// After adding an output argument, this step will by default rename itself
69/// for a better display name in the build summary.69/// for a better display name in the build summary.
...@@ -104,7 +104,7 @@ has_side_effects: bool,...@@ -104,7 +104,7 @@ has_side_effects: bool,
104104
105/// If this is a Zig unit test binary, this tracks the indexes of the unit105/// If this is a Zig unit test binary, this tracks the indexes of the unit
106/// tests that are also fuzz tests.106/// tests that are also fuzz tests.
107fuzz_tests: std.ArrayListUnmanaged(u32),107fuzz_tests: std.ArrayList(u32),
108cached_test_metadata: ?CachedTestMetadata = null,108cached_test_metadata: ?CachedTestMetadata = null,
109109
110/// Populated during the fuzz phase if this run step corresponds to a unit test110/// Populated during the fuzz phase if this run step corresponds to a unit test
...@@ -139,7 +139,7 @@ pub const StdIo = union(enum) {...@@ -139,7 +139,7 @@ pub const StdIo = union(enum) {
139 /// conditions.139 /// conditions.
140 /// Note that an explicit check for exit code 0 needs to be added to this140 /// Note that an explicit check for exit code 0 needs to be added to this
141 /// list if such a check is desirable.141 /// list if such a check is desirable.
142 check: std.ArrayListUnmanaged(Check),142 check: std.ArrayList(Check),
143 /// This Run step is running a zig unit test binary and will communicate143 /// This Run step is running a zig unit test binary and will communicate
144 /// extra metadata over the IPC protocol.144 /// extra metadata over the IPC protocol.
145 zig_test,145 zig_test,
lib/std/Build/Step/UpdateSourceFiles.zig+1-1
...@@ -12,7 +12,7 @@ const fs = std.fs;...@@ -12,7 +12,7 @@ const fs = std.fs;
12const ArrayList = std.ArrayList;12const ArrayList = std.ArrayList;
1313
14step: Step,14step: Step,
15output_source_files: std.ArrayListUnmanaged(OutputSourceFile),15output_source_files: std.ArrayList(OutputSourceFile),
1616
17pub const base_id: Step.Id = .update_source_files;17pub const base_id: Step.Id = .update_source_files;
1818
lib/std/Build/Step/WriteFile.zig+2-2
...@@ -11,8 +11,8 @@ const WriteFile = @This();...@@ -11,8 +11,8 @@ const WriteFile = @This();
11step: Step,11step: Step,
1212
13// The elements here are pointers because we need stable pointers for the GeneratedFile field.13// The elements here are pointers because we need stable pointers for the GeneratedFile field.
14files: std.ArrayListUnmanaged(File),14files: std.ArrayList(File),
15directories: std.ArrayListUnmanaged(Directory),15directories: std.ArrayList(Directory),
16generated_directory: std.Build.GeneratedFile,16generated_directory: std.Build.GeneratedFile,
1717
18pub const base_id: Step.Id = .write_file;18pub const base_id: Step.Id = .write_file;
lib/std/Build/WebServer.zig+1-1
...@@ -549,7 +549,7 @@ fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.Optim...@@ -549,7 +549,7 @@ fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.Optim
549 .sub_path = "docs/wasm/html_render.zig",549 .sub_path = "docs/wasm/html_render.zig",
550 };550 };
551551
552 var argv: std.ArrayListUnmanaged([]const u8) = .empty;552 var argv: std.ArrayList([]const u8) = .empty;
553553
554 try argv.appendSlice(arena, &.{554 try argv.appendSlice(arena, &.{
555 graph.zig_exe, "build-exe", //555 graph.zig_exe, "build-exe", //
lib/std/Io.zig+1-1
...@@ -361,7 +361,7 @@ pub fn Poller(comptime StreamEnum: type) type {...@@ -361,7 +361,7 @@ pub fn Poller(comptime StreamEnum: type) type {
361 r.end = data.len;361 r.end = data.len;
362 }362 }
363 {363 {
364 var list: std.ArrayListUnmanaged(u8) = .{364 var list: std.ArrayList(u8) = .{
365 .items = r.buffer[0..r.end],365 .items = r.buffer[0..r.end],
366 .capacity = r.buffer.len,366 .capacity = r.buffer.len,
367 };367 };
lib/std/Io/Threaded.zig+1-1
...@@ -22,7 +22,7 @@ mutex: std.Thread.Mutex = .{},...@@ -22,7 +22,7 @@ mutex: std.Thread.Mutex = .{},
22cond: std.Thread.Condition = .{},22cond: std.Thread.Condition = .{},
23run_queue: std.SinglyLinkedList = .{},23run_queue: std.SinglyLinkedList = .{},
24join_requested: bool = false,24join_requested: bool = false,
25threads: std.ArrayListUnmanaged(std.Thread),25threads: std.ArrayList(std.Thread),
26stack_size: usize,26stack_size: usize,
27cpu_count: std.Thread.CpuCountError!usize,27cpu_count: std.Thread.CpuCountError!usize,
28concurrent_count: usize,28concurrent_count: usize,
lib/std/array_hash_map.zig+1-1
...@@ -505,7 +505,7 @@ pub fn ArrayHashMapWithAllocator(...@@ -505,7 +505,7 @@ pub fn ArrayHashMapWithAllocator(
505/// A hash table of keys and values, each stored sequentially.505/// A hash table of keys and values, each stored sequentially.
506///506///
507/// Insertion order is preserved. In general, this data structure supports the same507/// Insertion order is preserved. In general, this data structure supports the same
508/// operations as `std.ArrayListUnmanaged`.508/// operations as `std.ArrayList`.
509///509///
510/// Deletion operations:510/// Deletion operations:
511/// * `swapRemove` - O(1)511/// * `swapRemove` - O(1)
lib/std/crypto/Certificate/Bundle.zig+1-1
...@@ -21,7 +21,7 @@ const base64 = std.base64.standard.decoderWithIgnore(" \t\r\n");...@@ -21,7 +21,7 @@ const base64 = std.base64.standard.decoderWithIgnore(" \t\r\n");
2121
22/// The key is the contents slice of the subject.22/// The key is the contents slice of the subject.
23map: std.HashMapUnmanaged(der.Element.Slice, u32, MapContext, std.hash_map.default_max_load_percentage) = .empty,23map: std.HashMapUnmanaged(der.Element.Slice, u32, MapContext, std.hash_map.default_max_load_percentage) = .empty,
24bytes: std.ArrayListUnmanaged(u8) = .empty,24bytes: std.ArrayList(u8) = .empty,
2525
26pub const VerifyError = Certificate.Parsed.VerifyError || error{26pub const VerifyError = Certificate.Parsed.VerifyError || error{
27 CertificateIssuerNotFound,27 CertificateIssuerNotFound,
lib/std/debug/Coverage.zig+1-1
...@@ -21,7 +21,7 @@ directories: std.ArrayHashMapUnmanaged(String, void, String.MapContext, false),...@@ -21,7 +21,7 @@ directories: std.ArrayHashMapUnmanaged(String, void, String.MapContext, false),
21///21///
22/// Protected by `mutex`.22/// Protected by `mutex`.
23files: std.ArrayHashMapUnmanaged(File, void, File.MapContext, false),23files: std.ArrayHashMapUnmanaged(File, void, File.MapContext, false),
24string_bytes: std.ArrayListUnmanaged(u8),24string_bytes: std.ArrayList(u8),
25/// Protects the other fields.25/// Protects the other fields.
26mutex: std.Thread.Mutex,26mutex: std.Thread.Mutex,
2727
lib/std/debug/Dwarf/expression.zig+1-1
...@@ -158,7 +158,7 @@ pub fn StackMachine(comptime options: Options) type {...@@ -158,7 +158,7 @@ pub fn StackMachine(comptime options: Options) type {
158 }158 }
159 };159 };
160160
161 stack: std.ArrayListUnmanaged(Value) = .empty,161 stack: std.ArrayList(Value) = .empty,
162162
163 pub fn reset(self: *Self) void {163 pub fn reset(self: *Self) void {
164 self.stack.clearRetainingCapacity();164 self.stack.clearRetainingCapacity();
lib/std/debug/SelfInfo/Windows.zig+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1mutex: std.Thread.Mutex,1mutex: std.Thread.Mutex,
2modules: std.ArrayListUnmanaged(Module),2modules: std.ArrayList(Module),
3module_name_arena: std.heap.ArenaAllocator.State,3module_name_arena: std.heap.ArenaAllocator.State,
44
5pub const init: SelfInfo = .{5pub const init: SelfInfo = .{
lib/std/fs/Dir.zig+4-4
...@@ -667,8 +667,8 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator {...@@ -667,8 +667,8 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator {
667}667}
668668
669pub const SelectiveWalker = struct {669pub const SelectiveWalker = struct {
670 stack: std.ArrayListUnmanaged(Walker.StackItem),670 stack: std.ArrayList(Walker.StackItem),
671 name_buffer: std.ArrayListUnmanaged(u8),671 name_buffer: std.ArrayList(u8),
672 allocator: Allocator,672 allocator: Allocator,
673673
674 pub const Error = IteratorError || Allocator.Error;674 pub const Error = IteratorError || Allocator.Error;
...@@ -767,7 +767,7 @@ pub const SelectiveWalker = struct {...@@ -767,7 +767,7 @@ pub const SelectiveWalker = struct {
767///767///
768/// See also `walk`.768/// See also `walk`.
769pub fn walkSelectively(self: Dir, allocator: Allocator) !SelectiveWalker {769pub fn walkSelectively(self: Dir, allocator: Allocator) !SelectiveWalker {
770 var stack: std.ArrayListUnmanaged(Walker.StackItem) = .empty;770 var stack: std.ArrayList(Walker.StackItem) = .empty;
771771
772 try stack.append(allocator, .{772 try stack.append(allocator, .{
773 .iter = self.iterate(),773 .iter = self.iterate(),
...@@ -1521,7 +1521,7 @@ pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {...@@ -1521,7 +1521,7 @@ pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {
1521 };1521 };
15221522
1523 var stack_buffer: [16]StackItem = undefined;1523 var stack_buffer: [16]StackItem = undefined;
1524 var stack = std.ArrayListUnmanaged(StackItem).initBuffer(&stack_buffer);1524 var stack = std.ArrayList(StackItem).initBuffer(&stack_buffer);
1525 defer StackItem.closeAll(stack.items);1525 defer StackItem.closeAll(stack.items);
15261526
1527 stack.appendAssumeCapacity(.{1527 stack.appendAssumeCapacity(.{
lib/std/fs/wasi.zig+1-1
...@@ -24,7 +24,7 @@ pub const Preopens = struct {...@@ -24,7 +24,7 @@ pub const Preopens = struct {
24};24};
2525
26pub fn preopensAlloc(gpa: Allocator) Allocator.Error!Preopens {26pub fn preopensAlloc(gpa: Allocator) Allocator.Error!Preopens {
27 var names: std.ArrayListUnmanaged([]const u8) = .empty;27 var names: std.ArrayList([]const u8) = .empty;
28 defer names.deinit(gpa);28 defer names.deinit(gpa);
2929
30 try names.ensureUnusedCapacity(gpa, 3);30 try names.ensureUnusedCapacity(gpa, 3);
lib/std/hash_map.zig+2-2
...@@ -91,7 +91,7 @@ pub fn hashString(s: []const u8) u64 {...@@ -91,7 +91,7 @@ pub fn hashString(s: []const u8) u64 {
91}91}
9292
93pub const StringIndexContext = struct {93pub const StringIndexContext = struct {
94 bytes: *const std.ArrayListUnmanaged(u8),94 bytes: *const std.ArrayList(u8),
9595
96 pub fn eql(_: @This(), a: u32, b: u32) bool {96 pub fn eql(_: @This(), a: u32, b: u32) bool {
97 return a == b;97 return a == b;
...@@ -103,7 +103,7 @@ pub const StringIndexContext = struct {...@@ -103,7 +103,7 @@ pub const StringIndexContext = struct {
103};103};
104104
105pub const StringIndexAdapter = struct {105pub const StringIndexAdapter = struct {
106 bytes: *const std.ArrayListUnmanaged(u8),106 bytes: *const std.ArrayList(u8),
107107
108 pub fn eql(ctx: @This(), a: []const u8, b: u32) bool {108 pub fn eql(ctx: @This(), a: []const u8, b: u32) bool {
109 return mem.eql(u8, a, mem.sliceTo(ctx.bytes.items[b..], 0));109 return mem.eql(u8, a, mem.sliceTo(ctx.bytes.items[b..], 0));
lib/std/tar.zig+1-1
...@@ -27,7 +27,7 @@ pub const Writer = @import("tar/Writer.zig");...@@ -27,7 +27,7 @@ pub const Writer = @import("tar/Writer.zig");
27/// the errors in diagnostics to know whether the operation succeeded or failed.27/// the errors in diagnostics to know whether the operation succeeded or failed.
28pub const Diagnostics = struct {28pub const Diagnostics = struct {
29 allocator: std.mem.Allocator,29 allocator: std.mem.Allocator,
30 errors: std.ArrayListUnmanaged(Error) = .empty,30 errors: std.ArrayList(Error) = .empty,
3131
32 entries: usize = 0,32 entries: usize = 0,
33 root_dir: []const u8 = "",33 root_dir: []const u8 = "",
lib/std/zig/AstGen.zig+22-22
...@@ -6,7 +6,7 @@ const Ast = std.zig.Ast;...@@ -6,7 +6,7 @@ const Ast = std.zig.Ast;
6const mem = std.mem;6const mem = std.mem;
7const Allocator = std.mem.Allocator;7const Allocator = std.mem.Allocator;
8const assert = std.debug.assert;8const assert = std.debug.assert;
9const ArrayListUnmanaged = std.ArrayListUnmanaged;9const ArrayList = std.ArrayList;
10const StringIndexAdapter = std.hash_map.StringIndexAdapter;10const StringIndexAdapter = std.hash_map.StringIndexAdapter;
11const StringIndexContext = std.hash_map.StringIndexContext;11const StringIndexContext = std.hash_map.StringIndexContext;
1212
...@@ -22,8 +22,8 @@ tree: *const Ast,...@@ -22,8 +22,8 @@ tree: *const Ast,
22/// sub-expressions. See `AstRlAnnotate` for details.22/// sub-expressions. See `AstRlAnnotate` for details.
23nodes_need_rl: *const AstRlAnnotate.RlNeededSet,23nodes_need_rl: *const AstRlAnnotate.RlNeededSet,
24instructions: std.MultiArrayList(Zir.Inst) = .{},24instructions: std.MultiArrayList(Zir.Inst) = .{},
25extra: ArrayListUnmanaged(u32) = .empty,25extra: ArrayList(u32) = .empty,
26string_bytes: ArrayListUnmanaged(u8) = .empty,26string_bytes: ArrayList(u8) = .empty,
27/// Tracks the current byte offset within the source file.27/// Tracks the current byte offset within the source file.
28/// Used to populate line deltas in the ZIR. AstGen maintains28/// Used to populate line deltas in the ZIR. AstGen maintains
29/// this "cursor" throughout the entire AST lowering process in order29/// this "cursor" throughout the entire AST lowering process in order
...@@ -40,7 +40,7 @@ source_column: u32 = 0,...@@ -40,7 +40,7 @@ source_column: u32 = 0,
40/// The resulting ZIR code has no references to anything in this arena.40/// The resulting ZIR code has no references to anything in this arena.
41arena: Allocator,41arena: Allocator,
42string_table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty,42string_table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty,
43compile_errors: ArrayListUnmanaged(Zir.Inst.CompileErrors.Item) = .empty,43compile_errors: ArrayList(Zir.Inst.CompileErrors.Item) = .empty,
44/// The topmost block of the current function.44/// The topmost block of the current function.
45fn_block: ?*GenZir = null,45fn_block: ?*GenZir = null,
46fn_var_args: bool = false,46fn_var_args: bool = false,
...@@ -54,7 +54,7 @@ fn_ret_ty: Zir.Inst.Ref = .none,...@@ -54,7 +54,7 @@ fn_ret_ty: Zir.Inst.Ref = .none,
54/// that uses this string as the operand.54/// that uses this string as the operand.
55imports: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, Ast.TokenIndex) = .empty,55imports: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, Ast.TokenIndex) = .empty,
56/// Used for temporary storage when building payloads.56/// Used for temporary storage when building payloads.
57scratch: std.ArrayListUnmanaged(u32) = .empty,57scratch: std.ArrayList(u32) = .empty,
58/// Whenever a `ref` instruction is needed, it is created and saved in this58/// Whenever a `ref` instruction is needed, it is created and saved in this
59/// table instead of being immediately appended to the current block body.59/// table instead of being immediately appended to the current block body.
60/// Then, when the instruction is being added to the parent block (typically from60/// Then, when the instruction is being added to the parent block (typically from
...@@ -173,7 +173,7 @@ pub fn generate(gpa: Allocator, tree: Ast) Allocator.Error!Zir {...@@ -173,7 +173,7 @@ pub fn generate(gpa: Allocator, tree: Ast) Allocator.Error!Zir {
173173
174 var top_scope: Scope.Top = .{};174 var top_scope: Scope.Top = .{};
175175
176 var gz_instructions: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty;176 var gz_instructions: std.ArrayList(Zir.Inst.Index) = .empty;
177 var gen_scope: GenZir = .{177 var gen_scope: GenZir = .{
178 .is_comptime = true,178 .is_comptime = true,
179 .parent = &top_scope.base,179 .parent = &top_scope.base,
...@@ -1766,7 +1766,7 @@ fn structInitExpr(...@@ -1766,7 +1766,7 @@ fn structInitExpr(
1766 var sfba = std.heap.stackFallback(256, astgen.arena);1766 var sfba = std.heap.stackFallback(256, astgen.arena);
1767 const sfba_allocator = sfba.get();1767 const sfba_allocator = sfba.get();
17681768
1769 var duplicate_names = std.AutoArrayHashMap(Zir.NullTerminatedString, ArrayListUnmanaged(Ast.TokenIndex)).init(sfba_allocator);1769 var duplicate_names = std.AutoArrayHashMap(Zir.NullTerminatedString, ArrayList(Ast.TokenIndex)).init(sfba_allocator);
1770 try duplicate_names.ensureTotalCapacity(@intCast(struct_init.ast.fields.len));1770 try duplicate_names.ensureTotalCapacity(@intCast(struct_init.ast.fields.len));
17711771
1772 // When there aren't errors, use this to avoid a second iteration.1772 // When there aren't errors, use this to avoid a second iteration.
...@@ -3996,7 +3996,7 @@ fn arrayTypeSentinel(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node....@@ -3996,7 +3996,7 @@ fn arrayTypeSentinel(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.
3996}3996}
39973997
3998const WipMembers = struct {3998const WipMembers = struct {
3999 payload: *ArrayListUnmanaged(u32),3999 payload: *ArrayList(u32),
4000 payload_top: usize,4000 payload_top: usize,
4001 field_bits_start: u32,4001 field_bits_start: u32,
4002 fields_start: u32,4002 fields_start: u32,
...@@ -4006,7 +4006,7 @@ const WipMembers = struct {...@@ -4006,7 +4006,7 @@ const WipMembers = struct {
40064006
4007 const Self = @This();4007 const Self = @This();
40084008
4009 fn init(gpa: Allocator, payload: *ArrayListUnmanaged(u32), decl_count: u32, field_count: u32, comptime bits_per_field: u32, comptime max_field_size: u32) Allocator.Error!Self {4009 fn init(gpa: Allocator, payload: *ArrayList(u32), decl_count: u32, field_count: u32, comptime bits_per_field: u32, comptime max_field_size: u32) Allocator.Error!Self {
4010 const payload_top: u32 = @intCast(payload.items.len);4010 const payload_top: u32 = @intCast(payload.items.len);
4011 const field_bits_start = payload_top + decl_count;4011 const field_bits_start = payload_top + decl_count;
4012 const fields_start = field_bits_start + if (bits_per_field > 0) blk: {4012 const fields_start = field_bits_start + if (bits_per_field > 0) blk: {
...@@ -4260,7 +4260,7 @@ fn fnDeclInner(...@@ -4260,7 +4260,7 @@ fn fnDeclInner(
4260 const is_inferred_error = tree.tokenTag(maybe_bang) == .bang;4260 const is_inferred_error = tree.tokenTag(maybe_bang) == .bang;
42614261
4262 // Note that the capacity here may not be sufficient, as this does not include `anytype` parameters.4262 // Note that the capacity here may not be sufficient, as this does not include `anytype` parameters.
4263 var param_insts: std.ArrayListUnmanaged(Zir.Inst.Index) = try .initCapacity(astgen.arena, fn_proto.ast.params.len);4263 var param_insts: std.ArrayList(Zir.Inst.Index) = try .initCapacity(astgen.arena, fn_proto.ast.params.len);
42644264
4265 // We use this as `is_used_or_discarded` to figure out if parameters / return types are generic.4265 // We use this as `is_used_or_discarded` to figure out if parameters / return types are generic.
4266 var any_param_used = false;4266 var any_param_used = false;
...@@ -11311,7 +11311,7 @@ fn identifierTokenString(astgen: *AstGen, token: Ast.TokenIndex) InnerError![]co...@@ -11311,7 +11311,7 @@ fn identifierTokenString(astgen: *AstGen, token: Ast.TokenIndex) InnerError![]co
11311 if (!mem.startsWith(u8, ident_name, "@")) {11311 if (!mem.startsWith(u8, ident_name, "@")) {
11312 return ident_name;11312 return ident_name;
11313 }11313 }
11314 var buf: ArrayListUnmanaged(u8) = .empty;11314 var buf: ArrayList(u8) = .empty;
11315 defer buf.deinit(astgen.gpa);11315 defer buf.deinit(astgen.gpa);
11316 try astgen.parseStrLit(token, &buf, ident_name, 1);11316 try astgen.parseStrLit(token, &buf, ident_name, 1);
11317 if (mem.indexOfScalar(u8, buf.items, 0) != null) {11317 if (mem.indexOfScalar(u8, buf.items, 0) != null) {
...@@ -11329,7 +11329,7 @@ fn identifierTokenString(astgen: *AstGen, token: Ast.TokenIndex) InnerError![]co...@@ -11329,7 +11329,7 @@ fn identifierTokenString(astgen: *AstGen, token: Ast.TokenIndex) InnerError![]co
11329fn appendIdentStr(11329fn appendIdentStr(
11330 astgen: *AstGen,11330 astgen: *AstGen,
11331 token: Ast.TokenIndex,11331 token: Ast.TokenIndex,
11332 buf: *ArrayListUnmanaged(u8),11332 buf: *ArrayList(u8),
11333) InnerError!void {11333) InnerError!void {
11334 const tree = astgen.tree;11334 const tree = astgen.tree;
11335 assert(tree.tokenTag(token) == .identifier);11335 assert(tree.tokenTag(token) == .identifier);
...@@ -11352,7 +11352,7 @@ fn appendIdentStr(...@@ -11352,7 +11352,7 @@ fn appendIdentStr(
11352fn parseStrLit(11352fn parseStrLit(
11353 astgen: *AstGen,11353 astgen: *AstGen,
11354 token: Ast.TokenIndex,11354 token: Ast.TokenIndex,
11355 buf: *ArrayListUnmanaged(u8),11355 buf: *ArrayList(u8),
11356 bytes: []const u8,11356 bytes: []const u8,
11357 offset: u32,11357 offset: u32,
11358) InnerError!void {11358) InnerError!void {
...@@ -11833,7 +11833,7 @@ const GenZir = struct {...@@ -11833,7 +11833,7 @@ const GenZir = struct {
11833 astgen: *AstGen,11833 astgen: *AstGen,
11834 /// Keeps track of the list of instructions in this scope. Possibly shared.11834 /// Keeps track of the list of instructions in this scope. Possibly shared.
11835 /// Indexes to instructions in `astgen`.11835 /// Indexes to instructions in `astgen`.
11836 instructions: *ArrayListUnmanaged(Zir.Inst.Index),11836 instructions: *ArrayList(Zir.Inst.Index),
11837 /// A sub-block may share its instructions ArrayList with containing GenZir,11837 /// A sub-block may share its instructions ArrayList with containing GenZir,
11838 /// if use is strictly nested. This saves prior size of list for unstacking.11838 /// if use is strictly nested. This saves prior size of list for unstacking.
11839 instructions_top: usize,11839 instructions_top: usize,
...@@ -13641,7 +13641,7 @@ fn scanContainer(...@@ -13641,7 +13641,7 @@ fn scanContainer(
1364113641
13642 for (names.keys(), names.values()) |name, first| {13642 for (names.keys(), names.values()) |name, first| {
13643 if (first.next == null) continue;13643 if (first.next == null) continue;
13644 var notes: std.ArrayListUnmanaged(u32) = .empty;13644 var notes: std.ArrayList(u32) = .empty;
13645 var prev: NameEntry = first;13645 var prev: NameEntry = first;
13646 while (prev.next) |cur| : (prev = cur.*) {13646 while (prev.next) |cur| : (prev = cur.*) {
13647 try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate name here", .{}));13647 try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate name here", .{}));
...@@ -13654,7 +13654,7 @@ fn scanContainer(...@@ -13654,7 +13654,7 @@ fn scanContainer(
1365413654
13655 for (test_names.keys(), test_names.values()) |name, first| {13655 for (test_names.keys(), test_names.values()) |name, first| {
13656 if (first.next == null) continue;13656 if (first.next == null) continue;
13657 var notes: std.ArrayListUnmanaged(u32) = .empty;13657 var notes: std.ArrayList(u32) = .empty;
13658 var prev: NameEntry = first;13658 var prev: NameEntry = first;
13659 while (prev.next) |cur| : (prev = cur.*) {13659 while (prev.next) |cur| : (prev = cur.*) {
13660 try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate test here", .{}));13660 try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate test here", .{}));
...@@ -13667,7 +13667,7 @@ fn scanContainer(...@@ -13667,7 +13667,7 @@ fn scanContainer(
1366713667
13668 for (decltest_names.keys(), decltest_names.values()) |name, first| {13668 for (decltest_names.keys(), decltest_names.values()) |name, first| {
13669 if (first.next == null) continue;13669 if (first.next == null) continue;
13670 var notes: std.ArrayListUnmanaged(u32) = .empty;13670 var notes: std.ArrayList(u32) = .empty;
13671 var prev: NameEntry = first;13671 var prev: NameEntry = first;
13672 while (prev.next) |cur| : (prev = cur.*) {13672 while (prev.next) |cur| : (prev = cur.*) {
13673 try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate decltest here", .{}));13673 try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate decltest here", .{}));
...@@ -13690,7 +13690,7 @@ fn appendBodyWithFixups(astgen: *AstGen, body: []const Zir.Inst.Index) void {...@@ -13690,7 +13690,7 @@ fn appendBodyWithFixups(astgen: *AstGen, body: []const Zir.Inst.Index) void {
1369013690
13691fn appendBodyWithFixupsArrayList(13691fn appendBodyWithFixupsArrayList(
13692 astgen: *AstGen,13692 astgen: *AstGen,
13693 list: *std.ArrayListUnmanaged(u32),13693 list: *std.ArrayList(u32),
13694 body: []const Zir.Inst.Index,13694 body: []const Zir.Inst.Index,
13695) void {13695) void {
13696 astgen.appendBodyWithFixupsExtraRefsArrayList(list, body, &.{});13696 astgen.appendBodyWithFixupsExtraRefsArrayList(list, body, &.{});
...@@ -13698,7 +13698,7 @@ fn appendBodyWithFixupsArrayList(...@@ -13698,7 +13698,7 @@ fn appendBodyWithFixupsArrayList(
1369813698
13699fn appendBodyWithFixupsExtraRefsArrayList(13699fn appendBodyWithFixupsExtraRefsArrayList(
13700 astgen: *AstGen,13700 astgen: *AstGen,
13701 list: *std.ArrayListUnmanaged(u32),13701 list: *std.ArrayList(u32),
13702 body: []const Zir.Inst.Index,13702 body: []const Zir.Inst.Index,
13703 extra_refs: []const Zir.Inst.Index,13703 extra_refs: []const Zir.Inst.Index,
13704) void {13704) void {
...@@ -13714,7 +13714,7 @@ fn appendBodyWithFixupsExtraRefsArrayList(...@@ -13714,7 +13714,7 @@ fn appendBodyWithFixupsExtraRefsArrayList(
1371413714
13715fn appendPossiblyRefdBodyInst(13715fn appendPossiblyRefdBodyInst(
13716 astgen: *AstGen,13716 astgen: *AstGen,
13717 list: *std.ArrayListUnmanaged(u32),13717 list: *std.ArrayList(u32),
13718 body_inst: Zir.Inst.Index,13718 body_inst: Zir.Inst.Index,
13719) void {13719) void {
13720 list.appendAssumeCapacity(@intFromEnum(body_inst));13720 list.appendAssumeCapacity(@intFromEnum(body_inst));
...@@ -13808,7 +13808,7 @@ fn lowerAstErrors(astgen: *AstGen) error{OutOfMemory}!void {...@@ -13808,7 +13808,7 @@ fn lowerAstErrors(astgen: *AstGen) error{OutOfMemory}!void {
13808 defer msg.deinit();13808 defer msg.deinit();
13809 const msg_w = &msg.writer;13809 const msg_w = &msg.writer;
1381013810
13811 var notes: std.ArrayListUnmanaged(u32) = .empty;13811 var notes: std.ArrayList(u32) = .empty;
13812 defer notes.deinit(gpa);13812 defer notes.deinit(gpa);
1381313813
13814 const token_starts = tree.tokens.items(.start);13814 const token_starts = tree.tokens.items(.start);
...@@ -14104,7 +14104,7 @@ fn setDeclaration(...@@ -14104,7 +14104,7 @@ fn setDeclaration(
14104/// *all* of the bodies into a big `GenZir` stack. Therefore, we use this function to pull out these per-body `ref`14104/// *all* of the bodies into a big `GenZir` stack. Therefore, we use this function to pull out these per-body `ref`
14105/// instructions which must be emitted.14105/// instructions which must be emitted.
14106fn fetchRemoveRefEntries(astgen: *AstGen, param_insts: []const Zir.Inst.Index) ![]Zir.Inst.Index {14106fn fetchRemoveRefEntries(astgen: *AstGen, param_insts: []const Zir.Inst.Index) ![]Zir.Inst.Index {
14107 var refs: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty;14107 var refs: std.ArrayList(Zir.Inst.Index) = .empty;
14108 for (param_insts) |param_inst| {14108 for (param_insts) |param_inst| {
14109 if (astgen.ref_table.fetchRemove(param_inst)) |kv| {14109 if (astgen.ref_table.fetchRemove(param_inst)) |kv| {
14110 try refs.append(astgen.arena, kv.value);14110 try refs.append(astgen.arena, kv.value);
lib/std/zig/ErrorBundle.zig+4-4
...@@ -320,10 +320,10 @@ fn writeMsg(eb: ErrorBundle, err_msg: ErrorMessage, w: *Writer, indent: usize) !...@@ -320,10 +320,10 @@ fn writeMsg(eb: ErrorBundle, err_msg: ErrorMessage, w: *Writer, indent: usize) !
320320
321pub const Wip = struct {321pub const Wip = struct {
322 gpa: Allocator,322 gpa: Allocator,
323 string_bytes: std.ArrayListUnmanaged(u8),323 string_bytes: std.ArrayList(u8),
324 /// The first thing in this array is a ErrorMessageList.324 /// The first thing in this array is a ErrorMessageList.
325 extra: std.ArrayListUnmanaged(u32),325 extra: std.ArrayList(u32),
326 root_list: std.ArrayListUnmanaged(MessageIndex),326 root_list: std.ArrayList(MessageIndex),
327327
328 pub fn init(wip: *Wip, gpa: Allocator) !void {328 pub fn init(wip: *Wip, gpa: Allocator) !void {
329 wip.* = .{329 wip.* = .{
...@@ -666,7 +666,7 @@ pub const Wip = struct {...@@ -666,7 +666,7 @@ pub const Wip = struct {
666 if (index == .none) return .none;666 if (index == .none) return .none;
667 const other_sl = other.getSourceLocation(index);667 const other_sl = other.getSourceLocation(index);
668668
669 var ref_traces: std.ArrayListUnmanaged(ReferenceTrace) = .empty;669 var ref_traces: std.ArrayList(ReferenceTrace) = .empty;
670 defer ref_traces.deinit(wip.gpa);670 defer ref_traces.deinit(wip.gpa);
671671
672 if (other_sl.reference_trace_len > 0) {672 if (other_sl.reference_trace_len > 0) {
lib/std/zig/Parse.zig+3-3
...@@ -6,10 +6,10 @@ gpa: Allocator,...@@ -6,10 +6,10 @@ gpa: Allocator,
6source: []const u8,6source: []const u8,
7tokens: Ast.TokenList.Slice,7tokens: Ast.TokenList.Slice,
8tok_i: TokenIndex,8tok_i: TokenIndex,
9errors: std.ArrayListUnmanaged(AstError),9errors: std.ArrayList(AstError),
10nodes: Ast.NodeList,10nodes: Ast.NodeList,
11extra_data: std.ArrayListUnmanaged(u32),11extra_data: std.ArrayList(u32),
12scratch: std.ArrayListUnmanaged(Node.Index),12scratch: std.ArrayList(Node.Index),
1313
14fn tokenTag(p: *const Parse, token_index: TokenIndex) Token.Tag {14fn tokenTag(p: *const Parse, token_index: TokenIndex) Token.Tag {
15 return p.tokens.items(.tag)[token_index];15 return p.tokens.items(.tag)[token_index];
lib/std/zig/WindowsSdk.zig+1-1
...@@ -752,7 +752,7 @@ const MsvcLibDir = struct {...@@ -752,7 +752,7 @@ const MsvcLibDir = struct {
752 defer instances_dir.close();752 defer instances_dir.close();
753753
754 var state_subpath_buf: [std.fs.max_name_bytes + 32]u8 = undefined;754 var state_subpath_buf: [std.fs.max_name_bytes + 32]u8 = undefined;
755 var latest_version_lib_dir: std.ArrayListUnmanaged(u8) = .empty;755 var latest_version_lib_dir: std.ArrayList(u8) = .empty;
756 errdefer latest_version_lib_dir.deinit(allocator);756 errdefer latest_version_lib_dir.deinit(allocator);
757757
758 var latest_version: u64 = 0;758 var latest_version: u64 = 0;
lib/std/zig/Zir.zig+3-3
...@@ -4093,8 +4093,8 @@ pub const DeclContents = struct {...@@ -4093,8 +4093,8 @@ pub const DeclContents = struct {
4093 /// This is a simple optional because ZIR guarantees that a `func`/`func_inferred`/`func_fancy` instruction4093 /// This is a simple optional because ZIR guarantees that a `func`/`func_inferred`/`func_fancy` instruction
4094 /// can only occur once per `declaration`.4094 /// can only occur once per `declaration`.
4095 func_decl: ?Inst.Index,4095 func_decl: ?Inst.Index,
4096 explicit_types: std.ArrayListUnmanaged(Inst.Index),4096 explicit_types: std.ArrayList(Inst.Index),
4097 other: std.ArrayListUnmanaged(Inst.Index),4097 other: std.ArrayList(Inst.Index),
40984098
4099 pub const init: DeclContents = .{4099 pub const init: DeclContents = .{
4100 .func_decl = null,4100 .func_decl = null,
...@@ -4118,7 +4118,7 @@ pub const DeclContents = struct {...@@ -4118,7 +4118,7 @@ pub const DeclContents = struct {
4118/// nested declarations; to find all declarations, call this function recursively on the type declarations discovered4118/// nested declarations; to find all declarations, call this function recursively on the type declarations discovered
4119/// in `contents.explicit_types`.4119/// in `contents.explicit_types`.
4120///4120///
4121/// This populates an `ArrayListUnmanaged` because an iterator would need to allocate memory anyway.4121/// This populates an `ArrayList` because an iterator would need to allocate memory anyway.
4122pub fn findTrackable(zir: Zir, gpa: Allocator, contents: *DeclContents, decl_inst: Zir.Inst.Index) !void {4122pub fn findTrackable(zir: Zir, gpa: Allocator, contents: *DeclContents, decl_inst: Zir.Inst.Index) !void {
4123 contents.clear();4123 contents.clear();
41244124
lib/std/zig/ZonGen.zig+6-6
...@@ -17,13 +17,13 @@ tree: Ast,...@@ -17,13 +17,13 @@ tree: Ast,
17options: Options,17options: Options,
1818
19nodes: std.MultiArrayList(Zoir.Node.Repr),19nodes: std.MultiArrayList(Zoir.Node.Repr),
20extra: std.ArrayListUnmanaged(u32),20extra: std.ArrayList(u32),
21limbs: std.ArrayListUnmanaged(std.math.big.Limb),21limbs: std.ArrayList(std.math.big.Limb),
22string_bytes: std.ArrayListUnmanaged(u8),22string_bytes: std.ArrayList(u8),
23string_table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage),23string_table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage),
2424
25compile_errors: std.ArrayListUnmanaged(Zoir.CompileError),25compile_errors: std.ArrayList(Zoir.CompileError),
26error_notes: std.ArrayListUnmanaged(Zoir.CompileError.Note),26error_notes: std.ArrayList(Zoir.CompileError.Note),
2727
28pub const Options = struct {28pub const Options = struct {
29 /// When false, string literals are not parsed. `string_literal` nodes will contain empty29 /// When false, string literals are not parsed. `string_literal` nodes will contain empty
...@@ -889,7 +889,7 @@ fn lowerAstErrors(zg: *ZonGen) Allocator.Error!void {...@@ -889,7 +889,7 @@ fn lowerAstErrors(zg: *ZonGen) Allocator.Error!void {
889 defer msg.deinit();889 defer msg.deinit();
890 const msg_bw = &msg.writer;890 const msg_bw = &msg.writer;
891891
892 var notes: std.ArrayListUnmanaged(Zoir.CompileError.Note) = .empty;892 var notes: std.ArrayList(Zoir.CompileError.Note) = .empty;
893 defer notes.deinit(gpa);893 defer notes.deinit(gpa);
894894
895 var cur_err = tree.errors[0];895 var cur_err = tree.errors[0];
lib/std/zig/llvm/BitcodeReader.zig+2-2
...@@ -9,7 +9,7 @@ reader: *std.Io.Reader,...@@ -9,7 +9,7 @@ reader: *std.Io.Reader,
9keep_names: bool,9keep_names: bool,
10bit_buffer: u32,10bit_buffer: u32,
11bit_offset: u5,11bit_offset: u5,
12stack: std.ArrayListUnmanaged(State),12stack: std.ArrayList(State),
13block_info: std.AutoHashMapUnmanaged(u32, Block.Info),13block_info: std.AutoHashMapUnmanaged(u32, Block.Info),
1414
15pub const Item = union(enum) {15pub const Item = union(enum) {
...@@ -488,7 +488,7 @@ const Abbrev = struct {...@@ -488,7 +488,7 @@ const Abbrev = struct {
488 };488 };
489489
490 const Store = struct {490 const Store = struct {
491 abbrevs: std.ArrayListUnmanaged(Abbrev),491 abbrevs: std.ArrayList(Abbrev),
492492
493 fn deinit(store: *Store, allocator: std.mem.Allocator) void {493 fn deinit(store: *Store, allocator: std.mem.Allocator) void {
494 for (store.abbrevs.items) |abbrev| allocator.free(abbrev.operands);494 for (store.abbrevs.items) |abbrev| allocator.free(abbrev.operands);
lib/std/zig/llvm/Builder.zig+25-25
...@@ -15,23 +15,23 @@ strip: bool,...@@ -15,23 +15,23 @@ strip: bool,
15source_filename: String,15source_filename: String,
16data_layout: String,16data_layout: String,
17target_triple: String,17target_triple: String,
18module_asm: std.ArrayListUnmanaged(u8),18module_asm: std.ArrayList(u8),
1919
20string_map: std.AutoArrayHashMapUnmanaged(void, void),20string_map: std.AutoArrayHashMapUnmanaged(void, void),
21string_indices: std.ArrayListUnmanaged(u32),21string_indices: std.ArrayList(u32),
22string_bytes: std.ArrayListUnmanaged(u8),22string_bytes: std.ArrayList(u8),
2323
24types: std.AutoArrayHashMapUnmanaged(String, Type),24types: std.AutoArrayHashMapUnmanaged(String, Type),
25next_unnamed_type: String,25next_unnamed_type: String,
26next_unique_type_id: std.AutoHashMapUnmanaged(String, u32),26next_unique_type_id: std.AutoHashMapUnmanaged(String, u32),
27type_map: std.AutoArrayHashMapUnmanaged(void, void),27type_map: std.AutoArrayHashMapUnmanaged(void, void),
28type_items: std.ArrayListUnmanaged(Type.Item),28type_items: std.ArrayList(Type.Item),
29type_extra: std.ArrayListUnmanaged(u32),29type_extra: std.ArrayList(u32),
3030
31attributes: std.AutoArrayHashMapUnmanaged(Attribute.Storage, void),31attributes: std.AutoArrayHashMapUnmanaged(Attribute.Storage, void),
32attributes_map: std.AutoArrayHashMapUnmanaged(void, void),32attributes_map: std.AutoArrayHashMapUnmanaged(void, void),
33attributes_indices: std.ArrayListUnmanaged(u32),33attributes_indices: std.ArrayList(u32),
34attributes_extra: std.ArrayListUnmanaged(u32),34attributes_extra: std.ArrayList(u32),
3535
36function_attributes_set: std.AutoArrayHashMapUnmanaged(FunctionAttributes, void),36function_attributes_set: std.AutoArrayHashMapUnmanaged(FunctionAttributes, void),
3737
...@@ -39,32 +39,32 @@ globals: std.AutoArrayHashMapUnmanaged(StrtabString, Global),...@@ -39,32 +39,32 @@ globals: std.AutoArrayHashMapUnmanaged(StrtabString, Global),
39next_unnamed_global: StrtabString,39next_unnamed_global: StrtabString,
40next_replaced_global: StrtabString,40next_replaced_global: StrtabString,
41next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32),41next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32),
42aliases: std.ArrayListUnmanaged(Alias),42aliases: std.ArrayList(Alias),
43variables: std.ArrayListUnmanaged(Variable),43variables: std.ArrayList(Variable),
44functions: std.ArrayListUnmanaged(Function),44functions: std.ArrayList(Function),
4545
46strtab_string_map: std.AutoArrayHashMapUnmanaged(void, void),46strtab_string_map: std.AutoArrayHashMapUnmanaged(void, void),
47strtab_string_indices: std.ArrayListUnmanaged(u32),47strtab_string_indices: std.ArrayList(u32),
48strtab_string_bytes: std.ArrayListUnmanaged(u8),48strtab_string_bytes: std.ArrayList(u8),
4949
50constant_map: std.AutoArrayHashMapUnmanaged(void, void),50constant_map: std.AutoArrayHashMapUnmanaged(void, void),
51constant_items: std.MultiArrayList(Constant.Item),51constant_items: std.MultiArrayList(Constant.Item),
52constant_extra: std.ArrayListUnmanaged(u32),52constant_extra: std.ArrayList(u32),
53constant_limbs: std.ArrayListUnmanaged(std.math.big.Limb),53constant_limbs: std.ArrayList(std.math.big.Limb),
5454
55metadata_map: std.AutoArrayHashMapUnmanaged(void, void),55metadata_map: std.AutoArrayHashMapUnmanaged(void, void),
56metadata_items: std.MultiArrayList(Metadata.Item),56metadata_items: std.MultiArrayList(Metadata.Item),
57metadata_extra: std.ArrayListUnmanaged(u32),57metadata_extra: std.ArrayList(u32),
58metadata_limbs: std.ArrayListUnmanaged(std.math.big.Limb),58metadata_limbs: std.ArrayList(std.math.big.Limb),
59metadata_forward_references: std.ArrayListUnmanaged(Metadata.Optional),59metadata_forward_references: std.ArrayList(Metadata.Optional),
60metadata_named: std.AutoArrayHashMapUnmanaged(String, struct {60metadata_named: std.AutoArrayHashMapUnmanaged(String, struct {
61 len: u32,61 len: u32,
62 index: Metadata.Item.ExtraIndex,62 index: Metadata.Item.ExtraIndex,
63}),63}),
6464
65metadata_string_map: std.AutoArrayHashMapUnmanaged(void, void),65metadata_string_map: std.AutoArrayHashMapUnmanaged(void, void),
66metadata_string_indices: std.ArrayListUnmanaged(u32),66metadata_string_indices: std.ArrayList(u32),
67metadata_string_bytes: std.ArrayListUnmanaged(u8),67metadata_string_bytes: std.ArrayList(u8),
6868
69pub const expected_args_len = 16;69pub const expected_args_len = 16;
70pub const expected_attrs_len = 16;70pub const expected_attrs_len = 16;
...@@ -1627,7 +1627,7 @@ pub const FunctionAttributes = enum(u32) {...@@ -1627,7 +1627,7 @@ pub const FunctionAttributes = enum(u32) {
1627 maps: Maps = .{},1627 maps: Maps = .{},
16281628
1629 const Map = std.AutoArrayHashMapUnmanaged(Attribute.Kind, Attribute.Index);1629 const Map = std.AutoArrayHashMapUnmanaged(Attribute.Kind, Attribute.Index);
1630 const Maps = std.ArrayListUnmanaged(Map);1630 const Maps = std.ArrayList(Map);
16311631
1632 pub fn deinit(self: *Wip, builder: *const Builder) void {1632 pub fn deinit(self: *Wip, builder: *const Builder) void {
1633 for (self.maps.items) |*map| map.deinit(builder.gpa);1633 for (self.maps.items) |*map| map.deinit(builder.gpa);
...@@ -5173,13 +5173,13 @@ pub const WipFunction = struct {...@@ -5173,13 +5173,13 @@ pub const WipFunction = struct {
5173 prev_debug_location: DebugLocation,5173 prev_debug_location: DebugLocation,
5174 debug_location: DebugLocation,5174 debug_location: DebugLocation,
5175 cursor: Cursor,5175 cursor: Cursor,
5176 blocks: std.ArrayListUnmanaged(Block),5176 blocks: std.ArrayList(Block),
5177 instructions: std.MultiArrayList(Instruction),5177 instructions: std.MultiArrayList(Instruction),
5178 names: std.ArrayListUnmanaged(String),5178 names: std.ArrayList(String),
5179 strip: bool,5179 strip: bool,
5180 debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation),5180 debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation),
5181 debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void),5181 debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void),
5182 extra: std.ArrayListUnmanaged(u32),5182 extra: std.ArrayList(u32),
51835183
5184 pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 };5184 pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 };
51855185
...@@ -5187,7 +5187,7 @@ pub const WipFunction = struct {...@@ -5187,7 +5187,7 @@ pub const WipFunction = struct {
5187 name: String,5187 name: String,
5188 incoming: u32,5188 incoming: u32,
5189 branches: u32 = 0,5189 branches: u32 = 0,
5190 instructions: std.ArrayListUnmanaged(Instruction.Index),5190 instructions: std.ArrayList(Instruction.Index),
51915191
5192 const Index = enum(u32) {5192 const Index = enum(u32) {
5193 entry,5193 entry,
...@@ -13193,7 +13193,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13193,7 +13193,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13193 // Write LLVM IR magic13193 // Write LLVM IR magic
13194 try bitcode.writeBits(ir.MAGIC, 32);13194 try bitcode.writeBits(ir.MAGIC, 32);
1319513195
13196 var record: std.ArrayListUnmanaged(u64) = .empty;13196 var record: std.ArrayList(u64) = .empty;
13197 defer record.deinit(self.gpa);13197 defer record.deinit(self.gpa);
1319813198
13199 // IDENTIFICATION_BLOCK13199 // IDENTIFICATION_BLOCK
lib/std/zig/system/NativePaths.zig+5-5
...@@ -7,11 +7,11 @@ const mem = std.mem;...@@ -7,11 +7,11 @@ const mem = std.mem;
7const NativePaths = @This();7const NativePaths = @This();
88
9arena: Allocator,9arena: Allocator,
10include_dirs: std.ArrayListUnmanaged([]const u8) = .empty,10include_dirs: std.ArrayList([]const u8) = .empty,
11lib_dirs: std.ArrayListUnmanaged([]const u8) = .empty,11lib_dirs: std.ArrayList([]const u8) = .empty,
12framework_dirs: std.ArrayListUnmanaged([]const u8) = .empty,12framework_dirs: std.ArrayList([]const u8) = .empty,
13rpaths: std.ArrayListUnmanaged([]const u8) = .empty,13rpaths: std.ArrayList([]const u8) = .empty,
14warnings: std.ArrayListUnmanaged([]const u8) = .empty,14warnings: std.ArrayList([]const u8) = .empty,
1515
16pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths {16pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths {
17 var self: NativePaths = .{ .arena = arena };17 var self: NativePaths = .{ .arena = arena };
lib/std/zon/parse.zig+2-2
...@@ -19,7 +19,7 @@ const Base = std.zig.number_literal.Base;...@@ -19,7 +19,7 @@ const Base = std.zig.number_literal.Base;
19const StrLitErr = std.zig.string_literal.Error;19const StrLitErr = std.zig.string_literal.Error;
20const NumberLiteralError = std.zig.number_literal.Error;20const NumberLiteralError = std.zig.number_literal.Error;
21const assert = std.debug.assert;21const assert = std.debug.assert;
22const ArrayListUnmanaged = std.ArrayListUnmanaged;22const ArrayList = std.ArrayList;
2323
24/// Rename when adding or removing support for a type.24/// Rename when adding or removing support for a type.
25const valid_types = {};25const valid_types = {};
...@@ -1115,7 +1115,7 @@ const Parser = struct {...@@ -1115,7 +1115,7 @@ const Parser = struct {
1115 };1115 };
1116 } else b: {1116 } else b: {
1117 const msg = "supported: ";1117 const msg = "supported: ";
1118 var buf: std.ArrayListUnmanaged(u8) = try .initCapacity(gpa, 64);1118 var buf: std.ArrayList(u8) = try .initCapacity(gpa, 64);
1119 defer buf.deinit(gpa);1119 defer buf.deinit(gpa);
1120 try buf.appendSlice(gpa, msg);1120 try buf.appendSlice(gpa, msg);
1121 inline for (info.fields, 0..) |field_info, i| {1121 inline for (info.fields, 0..) |field_info, i| {
src/Air.zig+1-1
...@@ -22,7 +22,7 @@ pub const Liveness = @import("Air/Liveness.zig");...@@ -22,7 +22,7 @@ pub const Liveness = @import("Air/Liveness.zig");
22instructions: std.MultiArrayList(Inst).Slice,22instructions: std.MultiArrayList(Inst).Slice,
23/// The meaning of this data is determined by `Inst.Tag` value.23/// The meaning of this data is determined by `Inst.Tag` value.
24/// The first few indexes are reserved. See `ExtraIndex` for the values.24/// The first few indexes are reserved. See `ExtraIndex` for the values.
25extra: std.ArrayListUnmanaged(u32),25extra: std.ArrayList(u32),
2626
27pub const ExtraIndex = enum(u32) {27pub const ExtraIndex = enum(u32) {
28 /// Payload index of the main `Block` in the `extra` array.28 /// Payload index of the main `Block` in the `extra` array.
src/Air/Legalize.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1pt: Zcu.PerThread,1pt: Zcu.PerThread,
2air_instructions: std.MultiArrayList(Air.Inst),2air_instructions: std.MultiArrayList(Air.Inst),
3air_extra: std.ArrayListUnmanaged(u32),3air_extra: std.ArrayList(u32),
4features: if (switch (dev.env) {4features: if (switch (dev.env) {
5 .bootstrap => @import("../codegen/c.zig").legalizeFeatures(undefined),5 .bootstrap => @import("../codegen/c.zig").legalizeFeatures(undefined),
6 else => null,6 else => null,
src/Air/Liveness.zig+5-5
...@@ -117,7 +117,7 @@ fn LivenessPassData(comptime pass: LivenessPass) type {...@@ -117,7 +117,7 @@ fn LivenessPassData(comptime pass: LivenessPass) type {
117117
118 /// The extra data initialized by the `loop_analysis` pass for this pass to consume.118 /// The extra data initialized by the `loop_analysis` pass for this pass to consume.
119 /// Owned by this struct during this pass.119 /// Owned by this struct during this pass.
120 old_extra: std.ArrayListUnmanaged(u32) = .empty,120 old_extra: std.ArrayList(u32) = .empty,
121121
122 const BlockScope = struct {122 const BlockScope = struct {
123 /// If this is a `block`, these instructions are alive upon a `br` to this block.123 /// If this is a `block`, these instructions are alive upon a `br` to this block.
...@@ -347,7 +347,7 @@ const Analysis = struct {...@@ -347,7 +347,7 @@ const Analysis = struct {
347 intern_pool: *InternPool,347 intern_pool: *InternPool,
348 tomb_bits: []usize,348 tomb_bits: []usize,
349 special: std.AutoHashMapUnmanaged(Air.Inst.Index, u32),349 special: std.AutoHashMapUnmanaged(Air.Inst.Index, u32),
350 extra: std.ArrayListUnmanaged(u32),350 extra: std.ArrayList(u32),
351351
352 fn addExtra(a: *Analysis, extra: anytype) Allocator.Error!u32 {352 fn addExtra(a: *Analysis, extra: anytype) Allocator.Error!u32 {
353 const fields = std.meta.fields(@TypeOf(extra));353 const fields = std.meta.fields(@TypeOf(extra));
...@@ -1235,10 +1235,10 @@ fn analyzeInstCondBr(...@@ -1235,10 +1235,10 @@ fn analyzeInstCondBr(
1235 // Operands which are alive in one branch but not the other need to die at the start of1235 // Operands which are alive in one branch but not the other need to die at the start of
1236 // the peer branch.1236 // the peer branch.
12371237
1238 var then_mirrored_deaths: std.ArrayListUnmanaged(Air.Inst.Index) = .empty;1238 var then_mirrored_deaths: std.ArrayList(Air.Inst.Index) = .empty;
1239 defer then_mirrored_deaths.deinit(gpa);1239 defer then_mirrored_deaths.deinit(gpa);
12401240
1241 var else_mirrored_deaths: std.ArrayListUnmanaged(Air.Inst.Index) = .empty;1241 var else_mirrored_deaths: std.ArrayList(Air.Inst.Index) = .empty;
1242 defer else_mirrored_deaths.deinit(gpa);1242 defer else_mirrored_deaths.deinit(gpa);
12431243
1244 // Note: this invalidates `else_live`, but expands `then_live` to be their union1244 // Note: this invalidates `else_live`, but expands `then_live` to be their union
...@@ -1351,7 +1351,7 @@ fn analyzeInstSwitchBr(...@@ -1351,7 +1351,7 @@ fn analyzeInstSwitchBr(
1351 // to understand it, I encourage looking at `analyzeInstCondBr` first.1351 // to understand it, I encourage looking at `analyzeInstCondBr` first.
13521352
1353 const DeathSet = std.AutoHashMapUnmanaged(Air.Inst.Index, void);1353 const DeathSet = std.AutoHashMapUnmanaged(Air.Inst.Index, void);
1354 const DeathList = std.ArrayListUnmanaged(Air.Inst.Index);1354 const DeathList = std.ArrayList(Air.Inst.Index);
13551355
1356 var case_live_sets = try gpa.alloc(std.AutoHashMapUnmanaged(Air.Inst.Index, void), ncases + 1); // +1 for else1356 var case_live_sets = try gpa.alloc(std.AutoHashMapUnmanaged(Air.Inst.Index, void), ncases + 1); // +1 for else
1357 defer gpa.free(case_live_sets);1357 defer gpa.free(case_live_sets);
src/Compilation.zig+13-13
...@@ -263,7 +263,7 @@ llvm_opt_bisect_limit: c_int,...@@ -263,7 +263,7 @@ llvm_opt_bisect_limit: c_int,
263263
264time_report: ?TimeReport,264time_report: ?TimeReport,
265265
266file_system_inputs: ?*std.ArrayListUnmanaged(u8),266file_system_inputs: ?*std.ArrayList(u8),
267267
268/// This is the digest of the cache for the current compilation.268/// This is the digest of the cache for the current compilation.
269/// This digest will be known after update() is called.269/// This digest will be known after update() is called.
...@@ -1166,8 +1166,8 @@ pub const CObject = struct {...@@ -1166,8 +1166,8 @@ pub const CObject = struct {
1166 category: u32 = 0,1166 category: u32 = 0,
1167 msg: []const u8 = &.{},1167 msg: []const u8 = &.{},
1168 src_loc: SrcLoc = .{},1168 src_loc: SrcLoc = .{},
1169 src_ranges: std.ArrayListUnmanaged(SrcRange) = .empty,1169 src_ranges: std.ArrayList(SrcRange) = .empty,
1170 sub_diags: std.ArrayListUnmanaged(Diag) = .empty,1170 sub_diags: std.ArrayList(Diag) = .empty,
11711171
1172 fn deinit(wip_diag: *@This(), allocator: Allocator) void {1172 fn deinit(wip_diag: *@This(), allocator: Allocator) void {
1173 allocator.free(wip_diag.msg);1173 allocator.free(wip_diag.msg);
...@@ -1197,7 +1197,7 @@ pub const CObject = struct {...@@ -1197,7 +1197,7 @@ pub const CObject = struct {
1197 category_names.deinit(gpa);1197 category_names.deinit(gpa);
1198 }1198 }
11991199
1200 var stack: std.ArrayListUnmanaged(WipDiag) = .empty;1200 var stack: std.ArrayList(WipDiag) = .empty;
1201 defer {1201 defer {
1202 for (stack.items) |*wip_diag| wip_diag.deinit(gpa);1202 for (stack.items) |*wip_diag| wip_diag.deinit(gpa);
1203 stack.deinit(gpa);1203 stack.deinit(gpa);
...@@ -1784,7 +1784,7 @@ pub const CreateOptions = struct {...@@ -1784,7 +1784,7 @@ pub const CreateOptions = struct {
1784 global_cc_argv: []const []const u8 = &.{},1784 global_cc_argv: []const []const u8 = &.{},
17851785
1786 /// Tracks all files that can cause the Compilation to be invalidated and need a rebuild.1786 /// Tracks all files that can cause the Compilation to be invalidated and need a rebuild.
1787 file_system_inputs: ?*std.ArrayListUnmanaged(u8) = null,1787 file_system_inputs: ?*std.ArrayList(u8) = null,
17881788
1789 parent_whole_cache: ?ParentWholeCache = null,1789 parent_whole_cache: ?ParentWholeCache = null,
17901790
...@@ -4150,7 +4150,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {...@@ -4150,7 +4150,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {
41504150
4151 const refs = try zcu.resolveReferences();4151 const refs = try zcu.resolveReferences();
41524152
4153 var messages: std.ArrayListUnmanaged(Zcu.ErrorMsg) = .empty;4153 var messages: std.ArrayList(Zcu.ErrorMsg) = .empty;
4154 defer messages.deinit(gpa);4154 defer messages.deinit(gpa);
4155 for (zcu.compile_logs.keys(), zcu.compile_logs.values()) |logging_unit, compile_log| {4155 for (zcu.compile_logs.keys(), zcu.compile_logs.values()) |logging_unit, compile_log| {
4156 if (!refs.contains(logging_unit)) continue;4156 if (!refs.contains(logging_unit)) continue;
...@@ -4197,7 +4197,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {...@@ -4197,7 +4197,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {
4197 }4197 }
4198 }4198 }
41994199
4200 var log_text: std.ArrayListUnmanaged(u8) = .empty;4200 var log_text: std.ArrayList(u8) = .empty;
4201 defer log_text.deinit(gpa);4201 defer log_text.deinit(gpa);
42024202
4203 // Index 0 will be the root message; the rest will be notes.4203 // Index 0 will be the root message; the rest will be notes.
...@@ -4250,7 +4250,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {...@@ -4250,7 +4250,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {
4250}4250}
42514251
4252/// Writes all compile log lines belonging to `logging_unit` into `log_text` using `zcu.gpa`.4252/// Writes all compile log lines belonging to `logging_unit` into `log_text` using `zcu.gpa`.
4253fn appendCompileLogLines(log_text: *std.ArrayListUnmanaged(u8), zcu: *Zcu, logging_unit: InternPool.AnalUnit) Allocator.Error!void {4253fn appendCompileLogLines(log_text: *std.ArrayList(u8), zcu: *Zcu, logging_unit: InternPool.AnalUnit) Allocator.Error!void {
4254 const gpa = zcu.gpa;4254 const gpa = zcu.gpa;
4255 const ip = &zcu.intern_pool;4255 const ip = &zcu.intern_pool;
4256 var opt_line_idx = zcu.compile_logs.get(logging_unit).?.first_line.toOptional();4256 var opt_line_idx = zcu.compile_logs.get(logging_unit).?.first_line.toOptional();
...@@ -4336,7 +4336,7 @@ pub fn addModuleErrorMsg(...@@ -4336,7 +4336,7 @@ pub fn addModuleErrorMsg(
4336 };4336 };
4337 const err_loc = std.zig.findLineColumn(err_source, err_span.main);4337 const err_loc = std.zig.findLineColumn(err_source, err_span.main);
43384338
4339 var ref_traces: std.ArrayListUnmanaged(ErrorBundle.ReferenceTrace) = .empty;4339 var ref_traces: std.ArrayList(ErrorBundle.ReferenceTrace) = .empty;
4340 defer ref_traces.deinit(gpa);4340 defer ref_traces.deinit(gpa);
43414341
4342 rt: {4342 rt: {
...@@ -4470,7 +4470,7 @@ pub fn addModuleErrorMsg(...@@ -4470,7 +4470,7 @@ pub fn addModuleErrorMsg(
4470fn addReferenceTraceFrame(4470fn addReferenceTraceFrame(
4471 zcu: *Zcu,4471 zcu: *Zcu,
4472 eb: *ErrorBundle.Wip,4472 eb: *ErrorBundle.Wip,
4473 ref_traces: *std.ArrayListUnmanaged(ErrorBundle.ReferenceTrace),4473 ref_traces: *std.ArrayList(ErrorBundle.ReferenceTrace),
4474 name: []const u8,4474 name: []const u8,
4475 lazy_src: Zcu.LazySrcLoc,4475 lazy_src: Zcu.LazySrcLoc,
4476 inlined: bool,4476 inlined: bool,
...@@ -5678,7 +5678,7 @@ pub fn translateC(...@@ -5678,7 +5678,7 @@ pub fn translateC(
5678 try argv.appendSlice(&[_][]const u8{ "-target", try target.zigTriple(arena) });5678 try argv.appendSlice(&[_][]const u8{ "-target", try target.zigTriple(arena) });
56795679
5680 const mcpu = mcpu: {5680 const mcpu = mcpu: {
5681 var buf: std.ArrayListUnmanaged(u8) = .empty;5681 var buf: std.ArrayList(u8) = .empty;
5682 defer buf.deinit(gpa);5682 defer buf.deinit(gpa);
56835683
5684 try buf.print(gpa, "-mcpu={s}", .{target.cpu.model.name});5684 try buf.print(gpa, "-mcpu={s}", .{target.cpu.model.name});
...@@ -6671,7 +6671,7 @@ fn spawnZigRc(...@@ -6671,7 +6671,7 @@ fn spawnZigRc(
6671 argv: []const []const u8,6671 argv: []const []const u8,
6672 child_progress_node: std.Progress.Node,6672 child_progress_node: std.Progress.Node,
6673) !void {6673) !void {
6674 var node_name: std.ArrayListUnmanaged(u8) = .empty;6674 var node_name: std.ArrayList(u8) = .empty;
6675 defer node_name.deinit(arena);6675 defer node_name.deinit(arena);
66766676
6677 var child = std.process.Child.init(argv, arena);6677 var child = std.process.Child.init(argv, arena);
...@@ -6986,7 +6986,7 @@ fn addCommonCCArgs(...@@ -6986,7 +6986,7 @@ fn addCommonCCArgs(
6986 }6986 }
69876987
6988 if (is_clang) {6988 if (is_clang) {
6989 var san_arg: std.ArrayListUnmanaged(u8) = .empty;6989 var san_arg: std.ArrayList(u8) = .empty;
6990 const prefix = "-fsanitize=";6990 const prefix = "-fsanitize=";
6991 if (mod.sanitize_c != .off) {6991 if (mod.sanitize_c != .off) {
6992 if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix);6992 if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix);
src/IncrementalDebugServer.zig+1-1
...@@ -47,7 +47,7 @@ fn runThread(ids: *IncrementalDebugServer) void {...@@ -47,7 +47,7 @@ fn runThread(ids: *IncrementalDebugServer) void {
47 const io = ids.zcu.comp.io;47 const io = ids.zcu.comp.io;
4848
49 var cmd_buf: [1024]u8 = undefined;49 var cmd_buf: [1024]u8 = undefined;
50 var text_out: std.ArrayListUnmanaged(u8) = .empty;50 var text_out: std.ArrayList(u8) = .empty;
51 defer text_out.deinit(gpa);51 defer text_out.deinit(gpa);
5252
53 const addr: std.Io.net.IpAddress = .{ .ip6 = .loopback(port) };53 const addr: std.Io.net.IpAddress = .{ .ip6 = .loopback(port) };
src/InternPool.zig+4-4
...@@ -79,10 +79,10 @@ first_dependency: std.AutoArrayHashMapUnmanaged(AnalUnit, DepEntry.Index),...@@ -79,10 +79,10 @@ first_dependency: std.AutoArrayHashMapUnmanaged(AnalUnit, DepEntry.Index),
79/// up entries in this list as required. This is not stored in `extra` so that79/// up entries in this list as required. This is not stored in `extra` so that
80/// we can use `free_dep_entries` to track free indices, since dependencies are80/// we can use `free_dep_entries` to track free indices, since dependencies are
81/// removed frequently.81/// removed frequently.
82dep_entries: std.ArrayListUnmanaged(DepEntry),82dep_entries: std.ArrayList(DepEntry),
83/// Stores unused indices in `dep_entries` which can be reused without a full83/// Stores unused indices in `dep_entries` which can be reused without a full
84/// garbage collection pass.84/// garbage collection pass.
85free_dep_entries: std.ArrayListUnmanaged(DepEntry.Index),85free_dep_entries: std.ArrayList(DepEntry.Index),
8686
87/// Whether a multi-threaded intern pool is useful.87/// Whether a multi-threaded intern pool is useful.
88/// Currently `false` until the intern pool is actually accessed88/// Currently `false` until the intern pool is actually accessed
...@@ -11436,7 +11436,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator)...@@ -11436,7 +11436,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator)
11436 defer arena_allocator.deinit();11436 defer arena_allocator.deinit();
11437 const arena = arena_allocator.allocator();11437 const arena = arena_allocator.allocator();
1143811438
11439 var instances: std.AutoArrayHashMapUnmanaged(Index, std.ArrayListUnmanaged(Index)) = .empty;11439 var instances: std.AutoArrayHashMapUnmanaged(Index, std.ArrayList(Index)) = .empty;
11440 for (ip.locals, 0..) |*local, tid| {11440 for (ip.locals, 0..) |*local, tid| {
11441 const items = local.shared.items.view().slice();11441 const items = local.shared.items.view().slice();
11442 const extra_list = local.shared.extra;11442 const extra_list = local.shared.extra;
...@@ -11463,7 +11463,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator)...@@ -11463,7 +11463,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator)
11463 defer std.debug.unlockStderrWriter();11463 defer std.debug.unlockStderrWriter();
1146411464
11465 const SortContext = struct {11465 const SortContext = struct {
11466 values: []std.ArrayListUnmanaged(Index),11466 values: []std.ArrayList(Index),
11467 pub fn lessThan(ctx: @This(), a_index: usize, b_index: usize) bool {11467 pub fn lessThan(ctx: @This(), a_index: usize, b_index: usize) bool {
11468 return ctx.values[a_index].items.len > ctx.values[b_index].items.len;11468 return ctx.values[a_index].items.len > ctx.values[b_index].items.len;
11469 }11469 }
src/Package.zig+1-1
...@@ -105,7 +105,7 @@ pub const Hash = struct {...@@ -105,7 +105,7 @@ pub const Hash = struct {
105 assert(name.len <= 32);105 assert(name.len <= 32);
106 assert(ver.len <= 32);106 assert(ver.len <= 32);
107 var result: Hash = undefined;107 var result: Hash = undefined;
108 var buf: std.ArrayListUnmanaged(u8) = .initBuffer(&result.bytes);108 var buf: std.ArrayList(u8) = .initBuffer(&result.bytes);
109 buf.appendSliceAssumeCapacity(name);109 buf.appendSliceAssumeCapacity(name);
110 buf.appendAssumeCapacity('-');110 buf.appendAssumeCapacity('-');
111 buf.appendSliceAssumeCapacity(ver);111 buf.appendSliceAssumeCapacity(ver);
src/Package/Fetch.zig+2-2
...@@ -112,7 +112,7 @@ pub const JobQueue = struct {...@@ -112,7 +112,7 @@ pub const JobQueue = struct {
112 /// `table` may be missing some tasks such as ones that failed, so this112 /// `table` may be missing some tasks such as ones that failed, so this
113 /// field contains references to all of them.113 /// field contains references to all of them.
114 /// Protected by `mutex`.114 /// Protected by `mutex`.
115 all_fetches: std.ArrayListUnmanaged(*Fetch) = .empty,115 all_fetches: std.ArrayList(*Fetch) = .empty,
116116
117 http_client: *std.http.Client,117 http_client: *std.http.Client,
118 thread_pool: *ThreadPool,118 thread_pool: *ThreadPool,
...@@ -2323,7 +2323,7 @@ const TestFetchBuilder = struct {...@@ -2323,7 +2323,7 @@ const TestFetchBuilder = struct {
2323 var package_dir = try self.packageDir();2323 var package_dir = try self.packageDir();
2324 defer package_dir.close();2324 defer package_dir.close();
23252325
2326 var actual_files: std.ArrayListUnmanaged([]u8) = .empty;2326 var actual_files: std.ArrayList([]u8) = .empty;
2327 defer actual_files.deinit(std.testing.allocator);2327 defer actual_files.deinit(std.testing.allocator);
2328 defer for (actual_files.items) |file| std.testing.allocator.free(file);2328 defer for (actual_files.items) |file| std.testing.allocator.free(file);
2329 var walker = try package_dir.walk(std.testing.allocator);2329 var walker = try package_dir.walk(std.testing.allocator);
src/Package/Fetch/git.zig+8-8
...@@ -160,7 +160,7 @@ pub const Oid = union(Format) {...@@ -160,7 +160,7 @@ pub const Oid = union(Format) {
160160
161pub const Diagnostics = struct {161pub const Diagnostics = struct {
162 allocator: Allocator,162 allocator: Allocator,
163 errors: std.ArrayListUnmanaged(Error) = .empty,163 errors: std.ArrayList(Error) = .empty,
164164
165 pub const Error = union(enum) {165 pub const Error = union(enum) {
166 unable_to_create_sym_link: struct {166 unable_to_create_sym_link: struct {
...@@ -405,7 +405,7 @@ const Odb = struct {...@@ -405,7 +405,7 @@ const Odb = struct {
405 fn readObject(odb: *Odb) !Object {405 fn readObject(odb: *Odb) !Object {
406 var base_offset = odb.pack_file.logicalPos();406 var base_offset = odb.pack_file.logicalPos();
407 var base_header: EntryHeader = undefined;407 var base_header: EntryHeader = undefined;
408 var delta_offsets: std.ArrayListUnmanaged(u64) = .empty;408 var delta_offsets: std.ArrayList(u64) = .empty;
409 defer delta_offsets.deinit(odb.allocator);409 defer delta_offsets.deinit(odb.allocator);
410 const base_object = while (true) {410 const base_object = while (true) {
411 if (odb.cache.get(base_offset)) |base_object| break base_object;411 if (odb.cache.get(base_offset)) |base_object| break base_object;
...@@ -1277,7 +1277,7 @@ pub fn indexPack(...@@ -1277,7 +1277,7 @@ pub fn indexPack(
12771277
1278 var index_entries: std.AutoHashMapUnmanaged(Oid, IndexEntry) = .empty;1278 var index_entries: std.AutoHashMapUnmanaged(Oid, IndexEntry) = .empty;
1279 defer index_entries.deinit(allocator);1279 defer index_entries.deinit(allocator);
1280 var pending_deltas: std.ArrayListUnmanaged(IndexEntry) = .empty;1280 var pending_deltas: std.ArrayList(IndexEntry) = .empty;
1281 defer pending_deltas.deinit(allocator);1281 defer pending_deltas.deinit(allocator);
12821282
1283 const pack_checksum = try indexPackFirstPass(allocator, format, pack, &index_entries, &pending_deltas);1283 const pack_checksum = try indexPackFirstPass(allocator, format, pack, &index_entries, &pending_deltas);
...@@ -1299,7 +1299,7 @@ pub fn indexPack(...@@ -1299,7 +1299,7 @@ pub fn indexPack(
1299 remaining_deltas = pending_deltas.items.len;1299 remaining_deltas = pending_deltas.items.len;
1300 }1300 }
13011301
1302 var oids: std.ArrayListUnmanaged(Oid) = .empty;1302 var oids: std.ArrayList(Oid) = .empty;
1303 defer oids.deinit(allocator);1303 defer oids.deinit(allocator);
1304 try oids.ensureTotalCapacityPrecise(allocator, index_entries.count());1304 try oids.ensureTotalCapacityPrecise(allocator, index_entries.count());
1305 var index_entries_iter = index_entries.iterator();1305 var index_entries_iter = index_entries.iterator();
...@@ -1341,7 +1341,7 @@ pub fn indexPack(...@@ -1341,7 +1341,7 @@ pub fn indexPack(
1341 try writer.writeInt(u32, index_entries.get(oid).?.crc32, .big);1341 try writer.writeInt(u32, index_entries.get(oid).?.crc32, .big);
1342 }1342 }
13431343
1344 var big_offsets: std.ArrayListUnmanaged(u64) = .empty;1344 var big_offsets: std.ArrayList(u64) = .empty;
1345 defer big_offsets.deinit(allocator);1345 defer big_offsets.deinit(allocator);
1346 for (oids.items) |oid| {1346 for (oids.items) |oid| {
1347 const offset = index_entries.get(oid).?.offset;1347 const offset = index_entries.get(oid).?.offset;
...@@ -1372,7 +1372,7 @@ fn indexPackFirstPass(...@@ -1372,7 +1372,7 @@ fn indexPackFirstPass(
1372 format: Oid.Format,1372 format: Oid.Format,
1373 pack: *std.fs.File.Reader,1373 pack: *std.fs.File.Reader,
1374 index_entries: *std.AutoHashMapUnmanaged(Oid, IndexEntry),1374 index_entries: *std.AutoHashMapUnmanaged(Oid, IndexEntry),
1375 pending_deltas: *std.ArrayListUnmanaged(IndexEntry),1375 pending_deltas: *std.ArrayList(IndexEntry),
1376) !Oid {1376) !Oid {
1377 var flate_buffer: [std.compress.flate.max_window_len]u8 = undefined;1377 var flate_buffer: [std.compress.flate.max_window_len]u8 = undefined;
1378 var pack_buffer: [2048]u8 = undefined; // Reasonably large buffer for file system.1378 var pack_buffer: [2048]u8 = undefined; // Reasonably large buffer for file system.
...@@ -1431,7 +1431,7 @@ fn indexPackHashDelta(...@@ -1431,7 +1431,7 @@ fn indexPackHashDelta(
1431 // Figure out the chain of deltas to resolve1431 // Figure out the chain of deltas to resolve
1432 var base_offset = delta.offset;1432 var base_offset = delta.offset;
1433 var base_header: EntryHeader = undefined;1433 var base_header: EntryHeader = undefined;
1434 var delta_offsets: std.ArrayListUnmanaged(u64) = .empty;1434 var delta_offsets: std.ArrayList(u64) = .empty;
1435 defer delta_offsets.deinit(allocator);1435 defer delta_offsets.deinit(allocator);
1436 const base_object = while (true) {1436 const base_object = while (true) {
1437 if (cache.get(base_offset)) |base_object| break base_object;1437 if (cache.get(base_offset)) |base_object| break base_object;
...@@ -1641,7 +1641,7 @@ fn runRepositoryTest(io: Io, comptime format: Oid.Format, head_commit: []const u...@@ -1641,7 +1641,7 @@ fn runRepositoryTest(io: Io, comptime format: Oid.Format, head_commit: []const u
1641 "file8",1641 "file8",
1642 "file9",1642 "file9",
1643 };1643 };
1644 var actual_files: std.ArrayListUnmanaged([]u8) = .empty;1644 var actual_files: std.ArrayList([]u8) = .empty;
1645 defer actual_files.deinit(testing.allocator);1645 defer actual_files.deinit(testing.allocator);
1646 defer for (actual_files.items) |file| testing.allocator.free(file);1646 defer for (actual_files.items) |file| testing.allocator.free(file);
1647 var walker = try worktree.dir.walk(testing.allocator);1647 var walker = try worktree.dir.walk(testing.allocator);
src/Package/Manifest.zig+3-3
...@@ -140,8 +140,8 @@ const Parse = struct {...@@ -140,8 +140,8 @@ const Parse = struct {
140 gpa: Allocator,140 gpa: Allocator,
141 ast: Ast,141 ast: Ast,
142 arena: Allocator,142 arena: Allocator,
143 buf: std.ArrayListUnmanaged(u8),143 buf: std.ArrayList(u8),
144 errors: std.ArrayListUnmanaged(ErrorMessage),144 errors: std.ArrayList(ErrorMessage),
145145
146 name: []const u8,146 name: []const u8,
147 id: u32,147 id: u32,
...@@ -466,7 +466,7 @@ const Parse = struct {...@@ -466,7 +466,7 @@ const Parse = struct {
466 fn parseStrLit(466 fn parseStrLit(
467 p: *Parse,467 p: *Parse,
468 token: Ast.TokenIndex,468 token: Ast.TokenIndex,
469 buf: *std.ArrayListUnmanaged(u8),469 buf: *std.ArrayList(u8),
470 bytes: []const u8,470 bytes: []const u8,
471 offset: u32,471 offset: u32,
472 ) InnerError!void {472 ) InnerError!void {
src/Sema.zig+26-26
...@@ -46,7 +46,7 @@ gpa: Allocator,...@@ -46,7 +46,7 @@ gpa: Allocator,
46arena: Allocator,46arena: Allocator,
47code: Zir,47code: Zir,
48air_instructions: std.MultiArrayList(Air.Inst) = .{},48air_instructions: std.MultiArrayList(Air.Inst) = .{},
49air_extra: std.ArrayListUnmanaged(u32) = .empty,49air_extra: std.ArrayList(u32) = .empty,
50/// Maps ZIR to AIR.50/// Maps ZIR to AIR.
51inst_map: InstMap = .{},51inst_map: InstMap = .{},
52/// The "owner" of a `Sema` represents the root "thing" that is being analyzed.52/// The "owner" of a `Sema` represents the root "thing" that is being analyzed.
...@@ -111,11 +111,11 @@ maybe_comptime_allocs: std.AutoHashMapUnmanaged(Air.Inst.Index, MaybeComptimeAll...@@ -111,11 +111,11 @@ maybe_comptime_allocs: std.AutoHashMapUnmanaged(Air.Inst.Index, MaybeComptimeAll
111/// stored as elements of this array.111/// stored as elements of this array.
112/// Pointers to such memory are represented via an index into this array.112/// Pointers to such memory are represented via an index into this array.
113/// Backed by gpa.113/// Backed by gpa.
114comptime_allocs: std.ArrayListUnmanaged(ComptimeAlloc) = .empty,114comptime_allocs: std.ArrayList(ComptimeAlloc) = .empty,
115115
116/// A list of exports performed by this analysis. After this `Sema` terminates,116/// A list of exports performed by this analysis. After this `Sema` terminates,
117/// these are flushed to `Zcu.single_exports` or `Zcu.multi_exports`.117/// these are flushed to `Zcu.single_exports` or `Zcu.multi_exports`.
118exports: std.ArrayListUnmanaged(Zcu.Export) = .empty,118exports: std.ArrayList(Zcu.Export) = .empty,
119119
120/// All references registered so far by this `Sema`. This is a temporary duplicate120/// All references registered so far by this `Sema`. This is a temporary duplicate
121/// of data stored in `Zcu.all_references`. It exists to avoid adding references to121/// of data stored in `Zcu.all_references`. It exists to avoid adding references to
...@@ -343,7 +343,7 @@ pub const Block = struct {...@@ -343,7 +343,7 @@ pub const Block = struct {
343 /// The namespace to use for lookups from this source block343 /// The namespace to use for lookups from this source block
344 namespace: InternPool.NamespaceIndex,344 namespace: InternPool.NamespaceIndex,
345 /// The AIR instructions generated for this block.345 /// The AIR instructions generated for this block.
346 instructions: std.ArrayListUnmanaged(Air.Inst.Index),346 instructions: std.ArrayList(Air.Inst.Index),
347 // `param` instructions are collected here to be used by the `func` instruction.347 // `param` instructions are collected here to be used by the `func` instruction.
348 /// When doing a generic function instantiation, this array collects a type348 /// When doing a generic function instantiation, this array collects a type
349 /// for each *runtime-known* parameter. This array corresponds to the instance349 /// for each *runtime-known* parameter. This array corresponds to the instance
...@@ -475,23 +475,23 @@ pub const Block = struct {...@@ -475,23 +475,23 @@ pub const Block = struct {
475 block_inst: Air.Inst.Index,475 block_inst: Air.Inst.Index,
476 /// Separate array list from break_inst_list so that it can be passed directly476 /// Separate array list from break_inst_list so that it can be passed directly
477 /// to resolvePeerTypes.477 /// to resolvePeerTypes.
478 results: std.ArrayListUnmanaged(Air.Inst.Ref),478 results: std.ArrayList(Air.Inst.Ref),
479 /// Keeps track of the break instructions so that the operand can be replaced479 /// Keeps track of the break instructions so that the operand can be replaced
480 /// if we need to add type coercion at the end of block analysis.480 /// if we need to add type coercion at the end of block analysis.
481 /// Same indexes, capacity, length as `results`.481 /// Same indexes, capacity, length as `results`.
482 br_list: std.ArrayListUnmanaged(Air.Inst.Index),482 br_list: std.ArrayList(Air.Inst.Index),
483 /// Keeps the source location of the rhs operand of the break instruction,483 /// Keeps the source location of the rhs operand of the break instruction,
484 /// to enable more precise compile errors.484 /// to enable more precise compile errors.
485 /// Same indexes, capacity, length as `results`.485 /// Same indexes, capacity, length as `results`.
486 src_locs: std.ArrayListUnmanaged(?LazySrcLoc),486 src_locs: std.ArrayList(?LazySrcLoc),
487 /// Most blocks do not utilize this field. When it is used, its use is487 /// Most blocks do not utilize this field. When it is used, its use is
488 /// contextual. The possible uses are as follows:488 /// contextual. The possible uses are as follows:
489 /// * for a `switch_block[_ref]`, this refers to dummy `br` instructions489 /// * for a `switch_block[_ref]`, this refers to dummy `br` instructions
490 /// which correspond to `switch_continue` ZIR. The switch logic will490 /// which correspond to `switch_continue` ZIR. The switch logic will
491 /// rewrite these to appropriate AIR switch dispatches.491 /// rewrite these to appropriate AIR switch dispatches.
492 extra_insts: std.ArrayListUnmanaged(Air.Inst.Index) = .empty,492 extra_insts: std.ArrayList(Air.Inst.Index) = .empty,
493 /// Same indexes, capacity, length as `extra_insts`.493 /// Same indexes, capacity, length as `extra_insts`.
494 extra_src_locs: std.ArrayListUnmanaged(LazySrcLoc) = .empty,494 extra_src_locs: std.ArrayList(LazySrcLoc) = .empty,
495495
496 pub fn deinit(merges: *@This(), allocator: Allocator) void {496 pub fn deinit(merges: *@This(), allocator: Allocator) void {
497 merges.results.deinit(allocator);497 merges.results.deinit(allocator);
...@@ -985,7 +985,7 @@ const InferredAlloc = struct {...@@ -985,7 +985,7 @@ const InferredAlloc = struct {
985 /// is known. These should be rewritten to perform any required coercions985 /// is known. These should be rewritten to perform any required coercions
986 /// when the type is resolved.986 /// when the type is resolved.
987 /// Allocated from `sema.arena`.987 /// Allocated from `sema.arena`.
988 prongs: std.ArrayListUnmanaged(Air.Inst.Index) = .empty,988 prongs: std.ArrayList(Air.Inst.Index) = .empty,
989};989};
990990
991pub fn deinit(sema: *Sema) void {991pub fn deinit(sema: *Sema) void {
...@@ -7547,8 +7547,8 @@ fn analyzeCall(...@@ -7547,8 +7547,8 @@ fn analyzeCall(
75477547
7548 // This may be an overestimate, but it's definitely sufficient.7548 // This may be an overestimate, but it's definitely sufficient.
7549 const max_runtime_args = args_info.count() - @popCount(func_ty_info.comptime_bits);7549 const max_runtime_args = args_info.count() - @popCount(func_ty_info.comptime_bits);
7550 var runtime_args: std.ArrayListUnmanaged(Air.Inst.Ref) = try .initCapacity(arena, max_runtime_args);7550 var runtime_args: std.ArrayList(Air.Inst.Ref) = try .initCapacity(arena, max_runtime_args);
7551 var runtime_param_tys: std.ArrayListUnmanaged(InternPool.Index) = try .initCapacity(arena, max_runtime_args);7551 var runtime_param_tys: std.ArrayList(InternPool.Index) = try .initCapacity(arena, max_runtime_args);
75527552
7553 const comptime_args = try arena.alloc(InternPool.Index, args_info.count());7553 const comptime_args = try arena.alloc(InternPool.Index, args_info.count());
75547554
...@@ -11107,7 +11107,7 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp...@@ -11107,7 +11107,7 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp
11107 break :blk err_capture_inst;11107 break :blk err_capture_inst;
11108 } else undefined;11108 } else undefined;
1110911109
11110 var case_vals = try std.ArrayListUnmanaged(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len);11110 var case_vals = try std.ArrayList(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len);
11111 defer case_vals.deinit(gpa);11111 defer case_vals.deinit(gpa);
1111211112
11113 const NonError = struct {11113 const NonError = struct {
...@@ -11490,7 +11490,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index, operand_is_r...@@ -11490,7 +11490,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index, operand_is_r
11490 break :blk tag_capture_inst;11490 break :blk tag_capture_inst;
11491 } else undefined;11491 } else undefined;
1149211492
11493 var case_vals = try std.ArrayListUnmanaged(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len);11493 var case_vals = try std.ArrayList(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len);
11494 defer case_vals.deinit(gpa);11494 defer case_vals.deinit(gpa);
1149511495
11496 var single_absorbed_item: Zir.Inst.Ref = .none;11496 var single_absorbed_item: Zir.Inst.Ref = .none;
...@@ -12144,8 +12144,8 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index, operand_is_r...@@ -12144,8 +12144,8 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index, operand_is_r
12144 }12144 }
1214512145
12146 var extra_case_vals: struct {12146 var extra_case_vals: struct {
12147 items: std.ArrayListUnmanaged(Air.Inst.Ref),12147 items: std.ArrayList(Air.Inst.Ref),
12148 ranges: std.ArrayListUnmanaged([2]Air.Inst.Ref),12148 ranges: std.ArrayList([2]Air.Inst.Ref),
12149 } = .{ .items = .empty, .ranges = .empty };12149 } = .{ .items = .empty, .ranges = .empty };
12150 defer {12150 defer {
12151 extra_case_vals.items.deinit(gpa);12151 extra_case_vals.items.deinit(gpa);
...@@ -12337,7 +12337,7 @@ fn analyzeSwitchRuntimeBlock(...@@ -12337,7 +12337,7 @@ fn analyzeSwitchRuntimeBlock(
12337 operand: Air.Inst.Ref,12337 operand: Air.Inst.Ref,
12338 operand_ty: Type,12338 operand_ty: Type,
12339 operand_src: LazySrcLoc,12339 operand_src: LazySrcLoc,
12340 case_vals: std.ArrayListUnmanaged(Air.Inst.Ref),12340 case_vals: std.ArrayList(Air.Inst.Ref),
12341 else_prong: SpecialProng,12341 else_prong: SpecialProng,
12342 scalar_cases_len: usize,12342 scalar_cases_len: usize,
12343 multi_cases_len: usize,12343 multi_cases_len: usize,
...@@ -12369,10 +12369,10 @@ fn analyzeSwitchRuntimeBlock(...@@ -12369,10 +12369,10 @@ fn analyzeSwitchRuntimeBlock(
1236912369
12370 const estimated_cases_extra = (scalar_cases_len + multi_cases_len) *12370 const estimated_cases_extra = (scalar_cases_len + multi_cases_len) *
12371 @typeInfo(Air.SwitchBr.Case).@"struct".fields.len + 2;12371 @typeInfo(Air.SwitchBr.Case).@"struct".fields.len + 2;
12372 var cases_extra = try std.ArrayListUnmanaged(u32).initCapacity(gpa, estimated_cases_extra);12372 var cases_extra = try std.ArrayList(u32).initCapacity(gpa, estimated_cases_extra);
12373 defer cases_extra.deinit(gpa);12373 defer cases_extra.deinit(gpa);
1237412374
12375 var branch_hints = try std.ArrayListUnmanaged(std.builtin.BranchHint).initCapacity(gpa, scalar_cases_len);12375 var branch_hints = try std.ArrayList(std.builtin.BranchHint).initCapacity(gpa, scalar_cases_len);
12376 defer branch_hints.deinit(gpa);12376 defer branch_hints.deinit(gpa);
1237712377
12378 var case_block = child_block.makeSubBlock();12378 var case_block = child_block.makeSubBlock();
...@@ -13022,7 +13022,7 @@ fn resolveSwitchComptimeLoop(...@@ -13022,7 +13022,7 @@ fn resolveSwitchComptimeLoop(
13022 special_members_only: ?SpecialProng,13022 special_members_only: ?SpecialProng,
13023 special_generic: SpecialProng,13023 special_generic: SpecialProng,
13024 special_generic_is_under: bool,13024 special_generic_is_under: bool,
13025 case_vals: std.ArrayListUnmanaged(Air.Inst.Ref),13025 case_vals: std.ArrayList(Air.Inst.Ref),
13026 scalar_cases_len: u32,13026 scalar_cases_len: u32,
13027 multi_cases_len: u32,13027 multi_cases_len: u32,
13028 err_set: bool,13028 err_set: bool,
...@@ -13094,7 +13094,7 @@ fn resolveSwitchComptime(...@@ -13094,7 +13094,7 @@ fn resolveSwitchComptime(
13094 special_members_only: ?SpecialProng,13094 special_members_only: ?SpecialProng,
13095 special_generic: SpecialProng,13095 special_generic: SpecialProng,
13096 special_generic_is_under: bool,13096 special_generic_is_under: bool,
13097 case_vals: std.ArrayListUnmanaged(Air.Inst.Ref),13097 case_vals: std.ArrayList(Air.Inst.Ref),
13098 scalar_cases_len: u32,13098 scalar_cases_len: u32,
13099 multi_cases_len: u32,13099 multi_cases_len: u32,
13100 err_set: bool,13100 err_set: bool,
...@@ -13350,7 +13350,7 @@ fn validateErrSetSwitch(...@@ -13350,7 +13350,7 @@ fn validateErrSetSwitch(
13350 sema: *Sema,13350 sema: *Sema,
13351 block: *Block,13351 block: *Block,
13352 seen_errors: *SwitchErrorSet,13352 seen_errors: *SwitchErrorSet,
13353 case_vals: *std.ArrayListUnmanaged(Air.Inst.Ref),13353 case_vals: *std.ArrayList(Air.Inst.Ref),
13354 operand_ty: Type,13354 operand_ty: Type,
13355 inst_data: @FieldType(Zir.Inst.Data, "pl_node"),13355 inst_data: @FieldType(Zir.Inst.Data, "pl_node"),
13356 scalar_cases_len: u32,13356 scalar_cases_len: u32,
...@@ -35678,8 +35678,8 @@ fn unionFields(...@@ -35678,8 +35678,8 @@ fn unionFields(
35678 enum_field_names = try sema.arena.alloc(InternPool.NullTerminatedString, fields_len);35678 enum_field_names = try sema.arena.alloc(InternPool.NullTerminatedString, fields_len);
35679 }35679 }
3568035680
35681 var field_types: std.ArrayListUnmanaged(InternPool.Index) = .empty;35681 var field_types: std.ArrayList(InternPool.Index) = .empty;
35682 var field_aligns: std.ArrayListUnmanaged(InternPool.Alignment) = .empty;35682 var field_aligns: std.ArrayList(InternPool.Alignment) = .empty;
3568335683
35684 try field_types.ensureTotalCapacityPrecise(sema.arena, fields_len);35684 try field_types.ensureTotalCapacityPrecise(sema.arena, fields_len);
35685 if (small.any_aligned_fields)35685 if (small.any_aligned_fields)
...@@ -37056,7 +37056,7 @@ fn notePathToComptimeAllocPtr(...@@ -37056,7 +37056,7 @@ fn notePathToComptimeAllocPtr(
37056 const zcu = pt.zcu;37056 const zcu = pt.zcu;
37057 const ip = &zcu.intern_pool;37057 const ip = &zcu.intern_pool;
3705837058
37059 var first_path: std.ArrayListUnmanaged(u8) = .empty;37059 var first_path: std.ArrayList(u8) = .empty;
37060 if (intermediate_value_count == 0) {37060 if (intermediate_value_count == 0) {
37061 try first_path.print(arena, "{f}", .{start_value_name.fmt(ip)});37061 try first_path.print(arena, "{f}", .{start_value_name.fmt(ip)});
37062 } else {37062 } else {
...@@ -37127,7 +37127,7 @@ fn notePathToComptimeAllocPtr(...@@ -37127,7 +37127,7 @@ fn notePathToComptimeAllocPtr(
37127 }37127 }
37128}37128}
3712937129
37130fn notePathToComptimeAllocPtrInner(sema: *Sema, val: Value, path: *std.ArrayListUnmanaged(u8)) Allocator.Error!Value {37130fn notePathToComptimeAllocPtrInner(sema: *Sema, val: Value, path: *std.ArrayList(u8)) Allocator.Error!Value {
37131 const pt = sema.pt;37131 const pt = sema.pt;
37132 const zcu = pt.zcu;37132 const zcu = pt.zcu;
37133 const ip = &zcu.intern_pool;37133 const ip = &zcu.intern_pool;
src/Zcu.zig+20-20
...@@ -87,10 +87,10 @@ local_zir_cache: Cache.Directory,...@@ -87,10 +87,10 @@ local_zir_cache: Cache.Directory,
8787
88/// This is where all `Export` values are stored. Not all values here are necessarily valid exports;88/// This is where all `Export` values are stored. Not all values here are necessarily valid exports;
89/// to enumerate all exports, `single_exports` and `multi_exports` must be consulted.89/// to enumerate all exports, `single_exports` and `multi_exports` must be consulted.
90all_exports: std.ArrayListUnmanaged(Export) = .empty,90all_exports: std.ArrayList(Export) = .empty,
91/// This is a list of free indices in `all_exports`. These indices may be reused by exports from91/// This is a list of free indices in `all_exports`. These indices may be reused by exports from
92/// future semantic analysis.92/// future semantic analysis.
93free_exports: std.ArrayListUnmanaged(Export.Index) = .empty,93free_exports: std.ArrayList(Export.Index) = .empty,
94/// Maps from an `AnalUnit` which performs a single export, to the index into `all_exports` of94/// Maps from an `AnalUnit` which performs a single export, to the index into `all_exports` of
95/// the export it performs. Note that the key is not the `Decl` being exported, but the `AnalUnit`95/// the export it performs. Note that the key is not the `Decl` being exported, but the `AnalUnit`
96/// whose analysis triggered the export.96/// whose analysis triggered the export.
...@@ -201,8 +201,8 @@ compile_logs: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct {...@@ -201,8 +201,8 @@ compile_logs: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct {
201 };201 };
202 }202 }
203}) = .empty,203}) = .empty,
204compile_log_lines: std.ArrayListUnmanaged(CompileLogLine) = .empty,204compile_log_lines: std.ArrayList(CompileLogLine) = .empty,
205free_compile_log_lines: std.ArrayListUnmanaged(CompileLogLine.Index) = .empty,205free_compile_log_lines: std.ArrayList(CompileLogLine.Index) = .empty,
206/// This tracks files which triggered errors when generating AST/ZIR/ZOIR.206/// This tracks files which triggered errors when generating AST/ZIR/ZOIR.
207/// If not `null`, the value is a retryable error (the file status is guaranteed207/// If not `null`, the value is a retryable error (the file status is guaranteed
208/// to be `.retryable_failure`). Otherwise, the file status is `.astgen_failure`208/// to be `.retryable_failure`). Otherwise, the file status is `.astgen_failure`
...@@ -232,7 +232,7 @@ failed_files: std.AutoArrayHashMapUnmanaged(File.Index, ?[]u8) = .empty,...@@ -232,7 +232,7 @@ failed_files: std.AutoArrayHashMapUnmanaged(File.Index, ?[]u8) = .empty,
232/// semantic analysis this update.232/// semantic analysis this update.
233///233///
234/// Allocated into gpa.234/// Allocated into gpa.
235failed_imports: std.ArrayListUnmanaged(struct {235failed_imports: std.ArrayList(struct {
236 file_index: File.Index,236 file_index: File.Index,
237 import_string: Zir.NullTerminatedString,237 import_string: Zir.NullTerminatedString,
238 import_token: Ast.TokenIndex,238 import_token: Ast.TokenIndex,
...@@ -261,7 +261,7 @@ outdated_ready: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,...@@ -261,7 +261,7 @@ outdated_ready: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,
261/// failure was something like running out of disk space, and trying again may261/// failure was something like running out of disk space, and trying again may
262/// succeed. On the next update, we will flush this list, marking all members of262/// succeed. On the next update, we will flush this list, marking all members of
263/// it as outdated.263/// it as outdated.
264retryable_failures: std.ArrayListUnmanaged(AnalUnit) = .empty,264retryable_failures: std.ArrayList(AnalUnit) = .empty,
265265
266func_body_analysis_queued: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,266func_body_analysis_queued: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,
267nav_val_analysis_queued: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,267nav_val_analysis_queued: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,
...@@ -290,12 +290,12 @@ global_assembly: std.AutoArrayHashMapUnmanaged(AnalUnit, []u8) = .empty,...@@ -290,12 +290,12 @@ global_assembly: std.AutoArrayHashMapUnmanaged(AnalUnit, []u8) = .empty,
290/// The `next` field on the `Reference` forms a linked list of all references290/// The `next` field on the `Reference` forms a linked list of all references
291/// triggered by the key `AnalUnit`.291/// triggered by the key `AnalUnit`.
292reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,292reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,
293all_references: std.ArrayListUnmanaged(Reference) = .empty,293all_references: std.ArrayList(Reference) = .empty,
294/// Freelist of indices in `all_references`.294/// Freelist of indices in `all_references`.
295free_references: std.ArrayListUnmanaged(u32) = .empty,295free_references: std.ArrayList(u32) = .empty,
296296
297inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame) = .empty,297inline_reference_frames: std.ArrayList(InlineReferenceFrame) = .empty,
298free_inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame.Index) = .empty,298free_inline_reference_frames: std.ArrayList(InlineReferenceFrame.Index) = .empty,
299299
300/// Key is the `AnalUnit` *performing* the reference. This representation allows300/// Key is the `AnalUnit` *performing* the reference. This representation allows
301/// incremental updates to quickly delete references caused by a specific `AnalUnit`.301/// incremental updates to quickly delete references caused by a specific `AnalUnit`.
...@@ -303,9 +303,9 @@ free_inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame.Index)...@@ -303,9 +303,9 @@ free_inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame.Index)
303/// The `next` field on the `TypeReference` forms a linked list of all type references303/// The `next` field on the `TypeReference` forms a linked list of all type references
304/// triggered by the key `AnalUnit`.304/// triggered by the key `AnalUnit`.
305type_reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,305type_reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,
306all_type_references: std.ArrayListUnmanaged(TypeReference) = .empty,306all_type_references: std.ArrayList(TypeReference) = .empty,
307/// Freelist of indices in `all_type_references`.307/// Freelist of indices in `all_type_references`.
308free_type_references: std.ArrayListUnmanaged(u32) = .empty,308free_type_references: std.ArrayList(u32) = .empty,
309309
310/// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = s })`, where `s` depends on the element.310/// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = s })`, where `s` depends on the element.
311builtin_decl_values: BuiltinDecl.Memoized = .initFill(.none),311builtin_decl_values: BuiltinDecl.Memoized = .initFill(.none),
...@@ -346,7 +346,7 @@ pub const IncrementalDebugState = struct {...@@ -346,7 +346,7 @@ pub const IncrementalDebugState = struct {
346 pub const UnitInfo = struct {346 pub const UnitInfo = struct {
347 last_update_gen: u32,347 last_update_gen: u32,
348 /// This information isn't easily recoverable from `InternPool`'s dependency storage format.348 /// This information isn't easily recoverable from `InternPool`'s dependency storage format.
349 deps: std.ArrayListUnmanaged(InternPool.Dependee),349 deps: std.ArrayList(InternPool.Dependee),
350 };350 };
351 pub fn getUnitInfo(ids: *IncrementalDebugState, gpa: Allocator, unit: AnalUnit) Allocator.Error!*UnitInfo {351 pub fn getUnitInfo(ids: *IncrementalDebugState, gpa: Allocator, unit: AnalUnit) Allocator.Error!*UnitInfo {
352 const gop = try ids.units.getOrPut(gpa, unit);352 const gop = try ids.units.getOrPut(gpa, unit);
...@@ -812,10 +812,10 @@ pub const Namespace = struct {...@@ -812,10 +812,10 @@ pub const Namespace = struct {
812 priv_decls: std.ArrayHashMapUnmanaged(InternPool.Nav.Index, void, NavNameContext, true) = .empty,812 priv_decls: std.ArrayHashMapUnmanaged(InternPool.Nav.Index, void, NavNameContext, true) = .empty,
813 /// All `comptime` declarations in this namespace. We store these purely so that incremental813 /// All `comptime` declarations in this namespace. We store these purely so that incremental
814 /// compilation can re-use the existing `ComptimeUnit`s when a namespace changes.814 /// compilation can re-use the existing `ComptimeUnit`s when a namespace changes.
815 comptime_decls: std.ArrayListUnmanaged(InternPool.ComptimeUnit.Id) = .empty,815 comptime_decls: std.ArrayList(InternPool.ComptimeUnit.Id) = .empty,
816 /// All `test` declarations in this namespace. We store these purely so that incremental816 /// All `test` declarations in this namespace. We store these purely so that incremental
817 /// compilation can re-use the existing `Nav`s when a namespace changes.817 /// compilation can re-use the existing `Nav`s when a namespace changes.
818 test_decls: std.ArrayListUnmanaged(InternPool.Nav.Index) = .empty,818 test_decls: std.ArrayList(InternPool.Nav.Index) = .empty,
819819
820 pub const Index = InternPool.NamespaceIndex;820 pub const Index = InternPool.NamespaceIndex;
821 pub const OptionalIndex = InternPool.OptionalNamespaceIndex;821 pub const OptionalIndex = InternPool.OptionalNamespaceIndex;
...@@ -3292,7 +3292,7 @@ pub fn mapOldZirToNew(...@@ -3292,7 +3292,7 @@ pub fn mapOldZirToNew(
3292 old_inst: Zir.Inst.Index,3292 old_inst: Zir.Inst.Index,
3293 new_inst: Zir.Inst.Index,3293 new_inst: Zir.Inst.Index,
3294 };3294 };
3295 var match_stack: std.ArrayListUnmanaged(MatchedZirDecl) = .empty;3295 var match_stack: std.ArrayList(MatchedZirDecl) = .empty;
3296 defer match_stack.deinit(gpa);3296 defer match_stack.deinit(gpa);
32973297
3298 // Used as temporary buffers for namespace declaration instructions3298 // Used as temporary buffers for namespace declaration instructions
...@@ -3358,10 +3358,10 @@ pub fn mapOldZirToNew(...@@ -3358,10 +3358,10 @@ pub fn mapOldZirToNew(
3358 var named_decltests: std.StringHashMapUnmanaged(Zir.Inst.Index) = .empty;3358 var named_decltests: std.StringHashMapUnmanaged(Zir.Inst.Index) = .empty;
3359 defer named_decltests.deinit(gpa);3359 defer named_decltests.deinit(gpa);
3360 // All unnamed tests, in order, for a best-effort match.3360 // All unnamed tests, in order, for a best-effort match.
3361 var unnamed_tests: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty;3361 var unnamed_tests: std.ArrayList(Zir.Inst.Index) = .empty;
3362 defer unnamed_tests.deinit(gpa);3362 defer unnamed_tests.deinit(gpa);
3363 // All comptime declarations, in order, for a best-effort match.3363 // All comptime declarations, in order, for a best-effort match.
3364 var comptime_decls: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty;3364 var comptime_decls: std.ArrayList(Zir.Inst.Index) = .empty;
3365 defer comptime_decls.deinit(gpa);3365 defer comptime_decls.deinit(gpa);
33663366
3367 {3367 {
...@@ -4636,7 +4636,7 @@ pub fn addFileInMultipleModulesError(...@@ -4636,7 +4636,7 @@ pub fn addFileInMultipleModulesError(
4636 info.modules[1].fully_qualified_name,4636 info.modules[1].fully_qualified_name,
4637 });4637 });
46384638
4639 var notes: std.ArrayListUnmanaged(std.zig.ErrorBundle.MessageIndex) = .empty;4639 var notes: std.ArrayList(std.zig.ErrorBundle.MessageIndex) = .empty;
4640 defer notes.deinit(gpa);4640 defer notes.deinit(gpa);
46414641
4642 try notes.append(gpa, try eb.addErrorMessage(.{4642 try notes.append(gpa, try eb.addErrorMessage(.{
...@@ -4660,7 +4660,7 @@ pub fn addFileInMultipleModulesError(...@@ -4660,7 +4660,7 @@ pub fn addFileInMultipleModulesError(
4660fn explainWhyFileIsInModule(4660fn explainWhyFileIsInModule(
4661 zcu: *Zcu,4661 zcu: *Zcu,
4662 eb: *std.zig.ErrorBundle.Wip,4662 eb: *std.zig.ErrorBundle.Wip,
4663 notes_out: *std.ArrayListUnmanaged(std.zig.ErrorBundle.MessageIndex),4663 notes_out: *std.ArrayList(std.zig.ErrorBundle.MessageIndex),
4664 file: File.Index,4664 file: File.Index,
4665 in_module: *Package.Module,4665 in_module: *Package.Module,
4666 ref: File.Reference,4666 ref: File.Reference,
src/Zcu/PerThread.zig+2-2
...@@ -3091,8 +3091,8 @@ pub fn processExports(pt: Zcu.PerThread) !void {...@@ -3091,8 +3091,8 @@ pub fn processExports(pt: Zcu.PerThread) !void {
3091 }3091 }
30923092
3093 // First, construct a mapping of every exported value and Nav to the indices of all its different exports.3093 // First, construct a mapping of every exported value and Nav to the indices of all its different exports.
3094 var nav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, std.ArrayListUnmanaged(Zcu.Export.Index)) = .empty;3094 var nav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
3095 var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Index, std.ArrayListUnmanaged(Zcu.Export.Index)) = .empty;3095 var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
3096 defer {3096 defer {
3097 for (nav_exports.values()) |*exports| {3097 for (nav_exports.values()) |*exports| {
3098 exports.deinit(gpa);3098 exports.deinit(gpa);
src/codegen/aarch64/Select.zig+12-12
...@@ -7,24 +7,24 @@ nav_index: InternPool.Nav.Index,...@@ -7,24 +7,24 @@ nav_index: InternPool.Nav.Index,
7def_order: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, void),7def_order: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, void),
8blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Block),8blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Block),
9loops: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Loop),9loops: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Loop),
10active_loops: std.ArrayListUnmanaged(Loop.Index),10active_loops: std.ArrayList(Loop.Index),
11loop_live: struct {11loop_live: struct {
12 set: std.AutoArrayHashMapUnmanaged(struct { Loop.Index, Air.Inst.Index }, void),12 set: std.AutoArrayHashMapUnmanaged(struct { Loop.Index, Air.Inst.Index }, void),
13 list: std.ArrayListUnmanaged(Air.Inst.Index),13 list: std.ArrayList(Air.Inst.Index),
14},14},
15dom_start: u32,15dom_start: u32,
16dom_len: u32,16dom_len: u32,
17dom: std.ArrayListUnmanaged(DomInt),17dom: std.ArrayList(DomInt),
1818
19// Wip Mir19// Wip Mir
20saved_registers: std.enums.EnumSet(Register.Alias),20saved_registers: std.enums.EnumSet(Register.Alias),
21instructions: std.ArrayListUnmanaged(codegen.aarch64.encoding.Instruction),21instructions: std.ArrayList(codegen.aarch64.encoding.Instruction),
22literals: std.ArrayListUnmanaged(u32),22literals: std.ArrayList(u32),
23nav_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Nav),23nav_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Nav),
24uav_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Uav),24uav_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Uav),
25lazy_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Lazy),25lazy_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Lazy),
26global_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Global),26global_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Global),
27literal_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Literal),27literal_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Literal),
2828
29// Stack Frame29// Stack Frame
30returns: bool,30returns: bool,
...@@ -44,7 +44,7 @@ stack_align: InternPool.Alignment,...@@ -44,7 +44,7 @@ stack_align: InternPool.Alignment,
44// Value Tracking44// Value Tracking
45live_registers: LiveRegisters,45live_registers: LiveRegisters,
46live_values: std.AutoHashMapUnmanaged(Air.Inst.Index, Value.Index),46live_values: std.AutoHashMapUnmanaged(Air.Inst.Index, Value.Index),
47values: std.ArrayListUnmanaged(Value),47values: std.ArrayList(Value),
4848
49pub const LiveRegisters = std.enums.EnumArray(Register.Alias, Value.Index);49pub const LiveRegisters = std.enums.EnumArray(Register.Alias, Value.Index);
5050
...@@ -11274,7 +11274,7 @@ pub fn dumpValues(isel: *Select, which: enum { only_referenced, all }) void {...@@ -11274,7 +11274,7 @@ pub fn dumpValues(isel: *Select, which: enum { only_referenced, all }) void {
11274 const ip = &zcu.intern_pool;11274 const ip = &zcu.intern_pool;
11275 const nav = ip.getNav(isel.nav_index);11275 const nav = ip.getNav(isel.nav_index);
1127611276
11277 var reverse_live_values: std.AutoArrayHashMapUnmanaged(Value.Index, std.ArrayListUnmanaged(Air.Inst.Index)) = .empty;11277 var reverse_live_values: std.AutoArrayHashMapUnmanaged(Value.Index, std.ArrayList(Air.Inst.Index)) = .empty;
11278 defer {11278 defer {
11279 for (reverse_live_values.values()) |*list| list.deinit(gpa);11279 for (reverse_live_values.values()) |*list| list.deinit(gpa);
11280 reverse_live_values.deinit(gpa);11280 reverse_live_values.deinit(gpa);
src/codegen/c.zig+2-2
...@@ -431,7 +431,7 @@ pub const Function = struct {...@@ -431,7 +431,7 @@ pub const Function = struct {
431 lazy_fns: LazyFnMap,431 lazy_fns: LazyFnMap,
432 func_index: InternPool.Index,432 func_index: InternPool.Index,
433 /// All the locals, to be emitted at the top of the function.433 /// All the locals, to be emitted at the top of the function.
434 locals: std.ArrayListUnmanaged(Local) = .empty,434 locals: std.ArrayList(Local) = .empty,
435 /// Which locals are available for reuse, based on Type.435 /// Which locals are available for reuse, based on Type.
436 free_locals_map: LocalsMap = .{},436 free_locals_map: LocalsMap = .{},
437 /// Locals which will not be freed by Liveness. This is used after a437 /// Locals which will not be freed by Liveness. This is used after a
...@@ -752,7 +752,7 @@ pub const DeclGen = struct {...@@ -752,7 +752,7 @@ pub const DeclGen = struct {
752 fwd_decl: Writer.Allocating,752 fwd_decl: Writer.Allocating,
753 error_msg: ?*Zcu.ErrorMsg,753 error_msg: ?*Zcu.ErrorMsg,
754 ctype_pool: CType.Pool,754 ctype_pool: CType.Pool,
755 scratch: std.ArrayListUnmanaged(u32),755 scratch: std.ArrayList(u32),
756 /// This map contains all the UAVs we saw generating this function.756 /// This map contains all the UAVs we saw generating this function.
757 /// `link.C` will merge them into its `uavs`/`aligned_uavs` fields.757 /// `link.C` will merge them into its `uavs`/`aligned_uavs` fields.
758 /// Key is the value of the UAV; value is the UAV's alignment, or758 /// Key is the value of the UAV; value is the UAV's alignment, or
src/codegen/c/Type.zig+6-6
...@@ -971,11 +971,11 @@ pub const Info = union(enum) {...@@ -971,11 +971,11 @@ pub const Info = union(enum) {
971pub const Pool = struct {971pub const Pool = struct {
972 map: Map,972 map: Map,
973 items: std.MultiArrayList(Item),973 items: std.MultiArrayList(Item),
974 extra: std.ArrayListUnmanaged(u32),974 extra: std.ArrayList(u32),
975975
976 string_map: Map,976 string_map: Map,
977 string_indices: std.ArrayListUnmanaged(u32),977 string_indices: std.ArrayList(u32),
978 string_bytes: std.ArrayListUnmanaged(u8),978 string_bytes: std.ArrayList(u8),
979979
980 const Map = std.AutoArrayHashMapUnmanaged(void, void);980 const Map = std.AutoArrayHashMapUnmanaged(void, void);
981981
...@@ -1396,7 +1396,7 @@ pub const Pool = struct {...@@ -1396,7 +1396,7 @@ pub const Pool = struct {
1396 pub fn fromType(1396 pub fn fromType(
1397 pool: *Pool,1397 pool: *Pool,
1398 allocator: std.mem.Allocator,1398 allocator: std.mem.Allocator,
1399 scratch: *std.ArrayListUnmanaged(u32),1399 scratch: *std.ArrayList(u32),
1400 ty: Type,1400 ty: Type,
1401 pt: Zcu.PerThread,1401 pt: Zcu.PerThread,
1402 mod: *Module,1402 mod: *Module,
...@@ -3271,7 +3271,7 @@ pub const Pool = struct {...@@ -3271,7 +3271,7 @@ pub const Pool = struct {
3271 addExtraAssumeCapacityTo(&pool.extra, Extra, extra);3271 addExtraAssumeCapacityTo(&pool.extra, Extra, extra);
3272 }3272 }
3273 fn addExtraAssumeCapacityTo(3273 fn addExtraAssumeCapacityTo(
3274 array: *std.ArrayListUnmanaged(u32),3274 array: *std.ArrayList(u32),
3275 comptime Extra: type,3275 comptime Extra: type,
3276 extra: Extra,3276 extra: Extra,
3277 ) void {3277 ) void {
...@@ -3309,7 +3309,7 @@ pub const Pool = struct {...@@ -3309,7 +3309,7 @@ pub const Pool = struct {
3309 }3309 }
3310 fn addHashedExtraAssumeCapacityTo(3310 fn addHashedExtraAssumeCapacityTo(
3311 pool: *Pool,3311 pool: *Pool,
3312 array: *std.ArrayListUnmanaged(u32),3312 array: *std.ArrayList(u32),
3313 hasher: *Hasher,3313 hasher: *Hasher,
3314 comptime Extra: type,3314 comptime Extra: type,
3315 extra: Extra,3315 extra: Extra,
src/codegen/llvm.zig+13-13
...@@ -523,8 +523,8 @@ pub const Object = struct {...@@ -523,8 +523,8 @@ pub const Object = struct {
523 debug_enums_fwd_ref: Builder.Metadata.Optional,523 debug_enums_fwd_ref: Builder.Metadata.Optional,
524 debug_globals_fwd_ref: Builder.Metadata.Optional,524 debug_globals_fwd_ref: Builder.Metadata.Optional,
525525
526 debug_enums: std.ArrayListUnmanaged(Builder.Metadata),526 debug_enums: std.ArrayList(Builder.Metadata),
527 debug_globals: std.ArrayListUnmanaged(Builder.Metadata),527 debug_globals: std.ArrayList(Builder.Metadata),
528528
529 debug_file_map: std.AutoHashMapUnmanaged(Zcu.File.Index, Builder.Metadata),529 debug_file_map: std.AutoHashMapUnmanaged(Zcu.File.Index, Builder.Metadata),
530 debug_type_map: std.AutoHashMapUnmanaged(InternPool.Index, Builder.Metadata),530 debug_type_map: std.AutoHashMapUnmanaged(InternPool.Index, Builder.Metadata),
...@@ -571,7 +571,7 @@ pub const Object = struct {...@@ -571,7 +571,7 @@ pub const Object = struct {
571 struct_field_map: std.AutoHashMapUnmanaged(ZigStructField, c_uint),571 struct_field_map: std.AutoHashMapUnmanaged(ZigStructField, c_uint),
572572
573 /// Values for `@llvm.used`.573 /// Values for `@llvm.used`.
574 used: std.ArrayListUnmanaged(Builder.Constant),574 used: std.ArrayList(Builder.Constant),
575575
576 const ZigStructField = struct {576 const ZigStructField = struct {
577 struct_ty: InternPool.Index,577 struct_ty: InternPool.Index,
...@@ -1298,7 +1298,7 @@ pub const Object = struct {...@@ -1298,7 +1298,7 @@ pub const Object = struct {
1298 // instructions. Depending on the calling convention, this list is not necessarily1298 // instructions. Depending on the calling convention, this list is not necessarily
1299 // a bijection with the actual LLVM parameters of the function.1299 // a bijection with the actual LLVM parameters of the function.
1300 const gpa = o.gpa;1300 const gpa = o.gpa;
1301 var args: std.ArrayListUnmanaged(Builder.Value) = .empty;1301 var args: std.ArrayList(Builder.Value) = .empty;
1302 defer args.deinit(gpa);1302 defer args.deinit(gpa);
13031303
1304 {1304 {
...@@ -2318,7 +2318,7 @@ pub const Object = struct {...@@ -2318,7 +2318,7 @@ pub const Object = struct {
23182318
2319 switch (ip.indexToKey(ty.toIntern())) {2319 switch (ip.indexToKey(ty.toIntern())) {
2320 .tuple_type => |tuple| {2320 .tuple_type => |tuple| {
2321 var fields: std.ArrayListUnmanaged(Builder.Metadata) = .empty;2321 var fields: std.ArrayList(Builder.Metadata) = .empty;
2322 defer fields.deinit(gpa);2322 defer fields.deinit(gpa);
23232323
2324 try fields.ensureUnusedCapacity(gpa, tuple.types.len);2324 try fields.ensureUnusedCapacity(gpa, tuple.types.len);
...@@ -2392,7 +2392,7 @@ pub const Object = struct {...@@ -2392,7 +2392,7 @@ pub const Object = struct {
23922392
2393 const struct_type = zcu.typeToStruct(ty).?;2393 const struct_type = zcu.typeToStruct(ty).?;
23942394
2395 var fields: std.ArrayListUnmanaged(Builder.Metadata) = .empty;2395 var fields: std.ArrayList(Builder.Metadata) = .empty;
2396 defer fields.deinit(gpa);2396 defer fields.deinit(gpa);
23972397
2398 try fields.ensureUnusedCapacity(gpa, struct_type.field_types.len);2398 try fields.ensureUnusedCapacity(gpa, struct_type.field_types.len);
...@@ -2484,7 +2484,7 @@ pub const Object = struct {...@@ -2484,7 +2484,7 @@ pub const Object = struct {
2484 return debug_union_type;2484 return debug_union_type;
2485 }2485 }
24862486
2487 var fields: std.ArrayListUnmanaged(Builder.Metadata) = .empty;2487 var fields: std.ArrayList(Builder.Metadata) = .empty;
2488 defer fields.deinit(gpa);2488 defer fields.deinit(gpa);
24892489
2490 try fields.ensureUnusedCapacity(gpa, union_type.loadTagType(ip).names.len);2490 try fields.ensureUnusedCapacity(gpa, union_type.loadTagType(ip).names.len);
...@@ -3273,7 +3273,7 @@ pub const Object = struct {...@@ -3273,7 +3273,7 @@ pub const Object = struct {
3273 return int_ty;3273 return int_ty;
3274 }3274 }
32753275
3276 var llvm_field_types: std.ArrayListUnmanaged(Builder.Type) = .empty;3276 var llvm_field_types: std.ArrayList(Builder.Type) = .empty;
3277 defer llvm_field_types.deinit(o.gpa);3277 defer llvm_field_types.deinit(o.gpa);
3278 // Although we can estimate how much capacity to add, these cannot be3278 // Although we can estimate how much capacity to add, these cannot be
3279 // relied upon because of the recursive calls to lowerType below.3279 // relied upon because of the recursive calls to lowerType below.
...@@ -3342,7 +3342,7 @@ pub const Object = struct {...@@ -3342,7 +3342,7 @@ pub const Object = struct {
3342 return ty;3342 return ty;
3343 },3343 },
3344 .tuple_type => |tuple_type| {3344 .tuple_type => |tuple_type| {
3345 var llvm_field_types: std.ArrayListUnmanaged(Builder.Type) = .empty;3345 var llvm_field_types: std.ArrayList(Builder.Type) = .empty;
3346 defer llvm_field_types.deinit(o.gpa);3346 defer llvm_field_types.deinit(o.gpa);
3347 // Although we can estimate how much capacity to add, these cannot be3347 // Although we can estimate how much capacity to add, these cannot be
3348 // relied upon because of the recursive calls to lowerType below.3348 // relied upon because of the recursive calls to lowerType below.
...@@ -3531,7 +3531,7 @@ pub const Object = struct {...@@ -3531,7 +3531,7 @@ pub const Object = struct {
3531 const target = zcu.getTarget();3531 const target = zcu.getTarget();
3532 const ret_ty = try lowerFnRetTy(o, pt, fn_info);3532 const ret_ty = try lowerFnRetTy(o, pt, fn_info);
35333533
3534 var llvm_params: std.ArrayListUnmanaged(Builder.Type) = .empty;3534 var llvm_params: std.ArrayList(Builder.Type) = .empty;
3535 defer llvm_params.deinit(o.gpa);3535 defer llvm_params.deinit(o.gpa);
35363536
3537 if (firstParamSRet(fn_info, zcu, target)) {3537 if (firstParamSRet(fn_info, zcu, target)) {
...@@ -4741,7 +4741,7 @@ pub const FuncGen = struct {...@@ -4741,7 +4741,7 @@ pub const FuncGen = struct {
47414741
4742 const Fuzz = struct {4742 const Fuzz = struct {
4743 counters_variable: Builder.Variable.Index,4743 counters_variable: Builder.Variable.Index,
4744 pcs: std.ArrayListUnmanaged(Builder.Constant),4744 pcs: std.ArrayList(Builder.Constant),
47454745
4746 fn deinit(f: *Fuzz, gpa: Allocator) void {4746 fn deinit(f: *Fuzz, gpa: Allocator) void {
4747 f.pcs.deinit(gpa);4747 f.pcs.deinit(gpa);
...@@ -7251,7 +7251,7 @@ pub const FuncGen = struct {...@@ -7251,7 +7251,7 @@ pub const FuncGen = struct {
7251 const inputs: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[extra_i..][0..extra.data.inputs_len]);7251 const inputs: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[extra_i..][0..extra.data.inputs_len]);
7252 extra_i += inputs.len;7252 extra_i += inputs.len;
72537253
7254 var llvm_constraints: std.ArrayListUnmanaged(u8) = .empty;7254 var llvm_constraints: std.ArrayList(u8) = .empty;
7255 defer llvm_constraints.deinit(gpa);7255 defer llvm_constraints.deinit(gpa);
72567256
7257 var arena_allocator = std.heap.ArenaAllocator.init(gpa);7257 var arena_allocator = std.heap.ArenaAllocator.init(gpa);
...@@ -13133,7 +13133,7 @@ fn maxIntConst(b: *Builder, max_ty: Type, as_ty: Builder.Type, zcu: *const Zcu)...@@ -13133,7 +13133,7 @@ fn maxIntConst(b: *Builder, max_ty: Type, as_ty: Builder.Type, zcu: *const Zcu)
13133/// Appends zero or more LLVM constraints to `llvm_constraints`, returning how many were added.13133/// Appends zero or more LLVM constraints to `llvm_constraints`, returning how many were added.
13134fn appendConstraints(13134fn appendConstraints(
13135 gpa: Allocator,13135 gpa: Allocator,
13136 llvm_constraints: *std.ArrayListUnmanaged(u8),13136 llvm_constraints: *std.ArrayList(u8),
13137 zig_name: []const u8,13137 zig_name: []const u8,
13138 target: *const std.Target,13138 target: *const std.Target,
13139) error{OutOfMemory}!usize {13139) error{OutOfMemory}!usize {
src/codegen/riscv64/CodeGen.zig+3-3
...@@ -90,7 +90,7 @@ scope_generation: u32,...@@ -90,7 +90,7 @@ scope_generation: u32,
90/// The value is an offset into the `Function` `code` from the beginning.90/// The value is an offset into the `Function` `code` from the beginning.
91/// To perform the reloc, write 32-bit signed little-endian integer91/// To perform the reloc, write 32-bit signed little-endian integer
92/// which is a relative jump, based on the address following the reloc.92/// which is a relative jump, based on the address following the reloc.
93exitlude_jump_relocs: std.ArrayListUnmanaged(usize) = .empty,93exitlude_jump_relocs: std.ArrayList(usize) = .empty,
9494
95reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,95reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
9696
...@@ -609,7 +609,7 @@ const FrameAlloc = struct {...@@ -609,7 +609,7 @@ const FrameAlloc = struct {
609};609};
610610
611const BlockData = struct {611const BlockData = struct {
612 relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty,612 relocs: std.ArrayList(Mir.Inst.Index) = .empty,
613 state: State,613 state: State,
614614
615 fn deinit(bd: *BlockData, gpa: Allocator) void {615 fn deinit(bd: *BlockData, gpa: Allocator) void {
...@@ -6200,7 +6200,7 @@ fn airAsm(func: *Func, inst: Air.Inst.Index) !void {...@@ -6200,7 +6200,7 @@ fn airAsm(func: *Func, inst: Air.Inst.Index) !void {
62006200
6201 const Label = struct {6201 const Label = struct {
6202 target: Mir.Inst.Index = undefined,6202 target: Mir.Inst.Index = undefined,
6203 pending_relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty,6203 pending_relocs: std.ArrayList(Mir.Inst.Index) = .empty,
62046204
6205 const Kind = enum { definition, reference };6205 const Kind = enum { definition, reference };
62066206
src/codegen/riscv64/Emit.zig+1-1
...@@ -11,7 +11,7 @@ prev_di_column: u32,...@@ -11,7 +11,7 @@ prev_di_column: u32,
11prev_di_pc: usize,11prev_di_pc: usize,
1212
13code_offset_mapping: std.AutoHashMapUnmanaged(Mir.Inst.Index, usize) = .empty,13code_offset_mapping: std.AutoHashMapUnmanaged(Mir.Inst.Index, usize) = .empty,
14relocs: std.ArrayListUnmanaged(Reloc) = .empty,14relocs: std.ArrayList(Reloc) = .empty,
1515
16pub const Error = Lower.Error || std.Io.Writer.Error || error{16pub const Error = Lower.Error || std.Io.Writer.Error || error{
17 EmitFail,17 EmitFail,
src/codegen/sparc64/CodeGen.zig+3-3
...@@ -68,7 +68,7 @@ stack_align: Alignment,...@@ -68,7 +68,7 @@ stack_align: Alignment,
68/// MIR Instructions68/// MIR Instructions
69mir_instructions: std.MultiArrayList(Mir.Inst) = .{},69mir_instructions: std.MultiArrayList(Mir.Inst) = .{},
70/// MIR extra data70/// MIR extra data
71mir_extra: std.ArrayListUnmanaged(u32) = .empty,71mir_extra: std.ArrayList(u32) = .empty,
7272
73/// Byte offset within the source file of the ending curly.73/// Byte offset within the source file of the ending curly.
74end_di_line: u32,74end_di_line: u32,
...@@ -77,7 +77,7 @@ end_di_column: u32,...@@ -77,7 +77,7 @@ end_di_column: u32,
77/// The value is an offset into the `Function` `code` from the beginning.77/// The value is an offset into the `Function` `code` from the beginning.
78/// To perform the reloc, write 32-bit signed little-endian integer78/// To perform the reloc, write 32-bit signed little-endian integer
79/// which is a relative jump, based on the address following the reloc.79/// which is a relative jump, based on the address following the reloc.
80exitlude_jump_relocs: std.ArrayListUnmanaged(usize) = .empty,80exitlude_jump_relocs: std.ArrayList(usize) = .empty,
8181
82reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,82reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
8383
...@@ -218,7 +218,7 @@ const StackAllocation = struct {...@@ -218,7 +218,7 @@ const StackAllocation = struct {
218};218};
219219
220const BlockData = struct {220const BlockData = struct {
221 relocs: std.ArrayListUnmanaged(Mir.Inst.Index),221 relocs: std.ArrayList(Mir.Inst.Index),
222 /// The first break instruction encounters `null` here and chooses a222 /// The first break instruction encounters `null` here and chooses a
223 /// machine code value for the block result, populating this field.223 /// machine code value for the block result, populating this field.
224 /// Following break instructions encounter that value and use it for224 /// Following break instructions encounter that value and use it for
src/codegen/sparc64/Emit.zig+2-2
...@@ -32,7 +32,7 @@ prev_di_pc: usize,...@@ -32,7 +32,7 @@ prev_di_pc: usize,
32branch_types: std.AutoHashMapUnmanaged(Mir.Inst.Index, BranchType) = .empty,32branch_types: std.AutoHashMapUnmanaged(Mir.Inst.Index, BranchType) = .empty,
33/// For every forward branch, maps the target instruction to a list of33/// For every forward branch, maps the target instruction to a list of
34/// branches which branch to this target instruction34/// branches which branch to this target instruction
35branch_forward_origins: std.AutoHashMapUnmanaged(Mir.Inst.Index, std.ArrayListUnmanaged(Mir.Inst.Index)) = .empty,35branch_forward_origins: std.AutoHashMapUnmanaged(Mir.Inst.Index, std.ArrayList(Mir.Inst.Index)) = .empty,
36/// For backward branches: stores the code offset of the target36/// For backward branches: stores the code offset of the target
37/// instruction37/// instruction
38///38///
...@@ -568,7 +568,7 @@ fn lowerBranches(emit: *Emit) !void {...@@ -568,7 +568,7 @@ fn lowerBranches(emit: *Emit) !void {
568 if (emit.branch_forward_origins.getPtr(target_inst)) |origin_list| {568 if (emit.branch_forward_origins.getPtr(target_inst)) |origin_list| {
569 try origin_list.append(gpa, inst);569 try origin_list.append(gpa, inst);
570 } else {570 } else {
571 var origin_list: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty;571 var origin_list: std.ArrayList(Mir.Inst.Index) = .empty;
572 try origin_list.append(gpa, inst);572 try origin_list.append(gpa, inst);
573 try emit.branch_forward_origins.put(gpa, target_inst, origin_list);573 try emit.branch_forward_origins.put(gpa, target_inst, origin_list);
574 }574 }
src/codegen/spirv/Assembler.zig+4-4
...@@ -14,16 +14,16 @@ const StorageClass = spec.StorageClass;...@@ -14,16 +14,16 @@ const StorageClass = spec.StorageClass;
14const Assembler = @This();14const Assembler = @This();
1515
16cg: *CodeGen,16cg: *CodeGen,
17errors: std.ArrayListUnmanaged(ErrorMsg) = .empty,17errors: std.ArrayList(ErrorMsg) = .empty,
18src: []const u8 = undefined,18src: []const u8 = undefined,
19/// `ass.src` tokenized.19/// `ass.src` tokenized.
20tokens: std.ArrayListUnmanaged(Token) = .empty,20tokens: std.ArrayList(Token) = .empty,
21current_token: u32 = 0,21current_token: u32 = 0,
22/// The instruction that is currently being parsed or has just been parsed.22/// The instruction that is currently being parsed or has just been parsed.
23inst: struct {23inst: struct {
24 opcode: Opcode = undefined,24 opcode: Opcode = undefined,
25 operands: std.ArrayListUnmanaged(Operand) = .empty,25 operands: std.ArrayList(Operand) = .empty,
26 string_bytes: std.ArrayListUnmanaged(u8) = .empty,26 string_bytes: std.ArrayList(u8) = .empty,
2727
28 fn result(ass: @This()) ?AsmValue.Ref {28 fn result(ass: @This()) ?AsmValue.Ref {
29 for (ass.operands.items[0..@min(ass.operands.items.len, 2)]) |op| {29 for (ass.operands.items[0..@min(ass.operands.items.len, 2)]) |op| {
src/codegen/spirv/CodeGen.zig+7-7
...@@ -83,7 +83,7 @@ const ControlFlow = union(enum) {...@@ -83,7 +83,7 @@ const ControlFlow = union(enum) {
83 selection: struct {83 selection: struct {
84 /// In order to know which merges we still need to do, we need to keep84 /// In order to know which merges we still need to do, we need to keep
85 /// a stack of those.85 /// a stack of those.
86 merge_stack: std.ArrayListUnmanaged(SelectionMerge) = .empty,86 merge_stack: std.ArrayList(SelectionMerge) = .empty,
87 },87 },
88 /// For a `loop` type block, we can early-exit the block by88 /// For a `loop` type block, we can early-exit the block by
89 /// jumping to the loop exit node, and we don't need to generate89 /// jumping to the loop exit node, and we don't need to generate
...@@ -91,7 +91,7 @@ const ControlFlow = union(enum) {...@@ -91,7 +91,7 @@ const ControlFlow = union(enum) {
91 loop: struct {91 loop: struct {
92 /// The next block to jump to can be determined from any number92 /// The next block to jump to can be determined from any number
93 /// of conditions that jump to the loop exit.93 /// of conditions that jump to the loop exit.
94 merges: std.ArrayListUnmanaged(Incoming) = .empty,94 merges: std.ArrayList(Incoming) = .empty,
95 /// The label id of the loop's merge block.95 /// The label id of the loop's merge block.
96 merge_block: Id,96 merge_block: Id,
97 },97 },
...@@ -105,7 +105,7 @@ const ControlFlow = union(enum) {...@@ -105,7 +105,7 @@ const ControlFlow = union(enum) {
105 }105 }
106 };106 };
107 /// This determines how exits from the current block must be handled.107 /// This determines how exits from the current block must be handled.
108 block_stack: std.ArrayListUnmanaged(*Structured.Block) = .empty,108 block_stack: std.ArrayList(*Structured.Block) = .empty,
109 block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,109 block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
110 };110 };
111111
...@@ -117,7 +117,7 @@ const ControlFlow = union(enum) {...@@ -117,7 +117,7 @@ const ControlFlow = union(enum) {
117117
118 const Block = struct {118 const Block = struct {
119 label: ?Id = null,119 label: ?Id = null,
120 incoming_blocks: std.ArrayListUnmanaged(Incoming) = .empty,120 incoming_blocks: std.ArrayList(Incoming) = .empty,
121 };121 };
122122
123 /// We need to keep track of result ids for block labels, as well as the 'incoming'123 /// We need to keep track of result ids for block labels, as well as the 'incoming'
...@@ -151,9 +151,9 @@ control_flow: ControlFlow,...@@ -151,9 +151,9 @@ control_flow: ControlFlow,
151base_line: u32,151base_line: u32,
152block_label: Id = .none,152block_label: Id = .none,
153next_arg_index: u32 = 0,153next_arg_index: u32 = 0,
154args: std.ArrayListUnmanaged(Id) = .empty,154args: std.ArrayList(Id) = .empty,
155inst_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,155inst_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
156id_scratch: std.ArrayListUnmanaged(Id) = .empty,156id_scratch: std.ArrayList(Id) = .empty,
157prologue: Section = .{},157prologue: Section = .{},
158body: Section = .{},158body: Section = .{},
159error_msg: ?*Zcu.ErrorMsg = null,159error_msg: ?*Zcu.ErrorMsg = null,
...@@ -5783,7 +5783,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index) !void {...@@ -5783,7 +5783,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5783 }5783 }
5784 }5784 }
57855785
5786 var incoming_structured_blocks: std.ArrayListUnmanaged(ControlFlow.Structured.Block.Incoming) = .empty;5786 var incoming_structured_blocks: std.ArrayList(ControlFlow.Structured.Block.Incoming) = .empty;
5787 defer incoming_structured_blocks.deinit(gpa);5787 defer incoming_structured_blocks.deinit(gpa);
57885788
5789 if (cg.control_flow == .structured) {5789 if (cg.control_flow == .structured) {
src/codegen/spirv/Module.zig+2-2
...@@ -26,8 +26,8 @@ zcu: *Zcu,...@@ -26,8 +26,8 @@ zcu: *Zcu,
26nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty,26nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty,
27uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty,27uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty,
28intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,28intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
29decls: std.ArrayListUnmanaged(Decl) = .empty,29decls: std.ArrayList(Decl) = .empty,
30decl_deps: std.ArrayListUnmanaged(Decl.Index) = .empty,30decl_deps: std.ArrayList(Decl.Index) = .empty,
31entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,31entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
32/// This map serves a dual purpose:32/// This map serves a dual purpose:
33/// - It keeps track of pointers that are currently being emitted, so that we can tell33/// - It keeps track of pointers that are currently being emitted, so that we can tell
src/codegen/spirv/Section.zig+1-1
...@@ -13,7 +13,7 @@ const Log2Word = std.math.Log2Int(Word);...@@ -13,7 +13,7 @@ const Log2Word = std.math.Log2Int(Word);
1313
14const Opcode = spec.Opcode;14const Opcode = spec.Opcode;
1515
16instructions: std.ArrayListUnmanaged(Word) = .empty,16instructions: std.ArrayList(Word) = .empty,
1717
18pub fn deinit(section: *Section, allocator: Allocator) void {18pub fn deinit(section: *Section, allocator: Allocator) void {
19 section.instructions.deinit(allocator);19 section.instructions.deinit(allocator);
src/codegen/wasm/CodeGen.zig+9-9
...@@ -53,7 +53,7 @@ func_index: InternPool.Index,...@@ -53,7 +53,7 @@ func_index: InternPool.Index,
53/// When we return from a branch, the branch will be popped from this list,53/// When we return from a branch, the branch will be popped from this list,
54/// which means branches can only contain references from within its own branch,54/// which means branches can only contain references from within its own branch,
55/// or a branch higher (lower index) in the tree.55/// or a branch higher (lower index) in the tree.
56branches: std.ArrayListUnmanaged(Branch) = .empty,56branches: std.ArrayList(Branch) = .empty,
57/// Table to save `WValue`'s generated by an `Air.Inst`57/// Table to save `WValue`'s generated by an `Air.Inst`
58// values: ValueTable,58// values: ValueTable,
59/// Mapping from Air.Inst.Index to block ids59/// Mapping from Air.Inst.Index to block ids
...@@ -73,7 +73,7 @@ arg_index: u32 = 0,...@@ -73,7 +73,7 @@ arg_index: u32 = 0,
73/// List of simd128 immediates. Each value is stored as an array of bytes.73/// List of simd128 immediates. Each value is stored as an array of bytes.
74/// This list will only be populated for 128bit-simd values when the target features74/// This list will only be populated for 128bit-simd values when the target features
75/// are enabled also.75/// are enabled also.
76simd_immediates: std.ArrayListUnmanaged([16]u8) = .empty,76simd_immediates: std.ArrayList([16]u8) = .empty,
77/// The Target we're emitting (used to call intInfo)77/// The Target we're emitting (used to call intInfo)
78target: *const std.Target,78target: *const std.Target,
79ptr_size: enum { wasm32, wasm64 },79ptr_size: enum { wasm32, wasm64 },
...@@ -81,10 +81,10 @@ pt: Zcu.PerThread,...@@ -81,10 +81,10 @@ pt: Zcu.PerThread,
81/// List of MIR Instructions81/// List of MIR Instructions
82mir_instructions: std.MultiArrayList(Mir.Inst),82mir_instructions: std.MultiArrayList(Mir.Inst),
83/// Contains extra data for MIR83/// Contains extra data for MIR
84mir_extra: std.ArrayListUnmanaged(u32),84mir_extra: std.ArrayList(u32),
85/// List of all locals' types generated throughout this declaration85/// List of all locals' types generated throughout this declaration
86/// used to emit locals count at start of 'code' section.86/// used to emit locals count at start of 'code' section.
87mir_locals: std.ArrayListUnmanaged(std.wasm.Valtype),87mir_locals: std.ArrayList(std.wasm.Valtype),
88/// Set of all UAVs referenced by this function. Key is the UAV value, value is the alignment.88/// Set of all UAVs referenced by this function. Key is the UAV value, value is the alignment.
89/// `.none` means naturally aligned. An explicit alignment is never less than the natural alignment.89/// `.none` means naturally aligned. An explicit alignment is never less than the natural alignment.
90mir_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),90mir_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
...@@ -121,19 +121,19 @@ stack_alignment: Alignment = .@"16",...@@ -121,19 +121,19 @@ stack_alignment: Alignment = .@"16",
121// allows us to re-use locals that are no longer used. e.g. a temporary local.121// allows us to re-use locals that are no longer used. e.g. a temporary local.
122/// A list of indexes which represents a local of valtype `i32`.122/// A list of indexes which represents a local of valtype `i32`.
123/// It is illegal to store a non-i32 valtype in this list.123/// It is illegal to store a non-i32 valtype in this list.
124free_locals_i32: std.ArrayListUnmanaged(u32) = .empty,124free_locals_i32: std.ArrayList(u32) = .empty,
125/// A list of indexes which represents a local of valtype `i64`.125/// A list of indexes which represents a local of valtype `i64`.
126/// It is illegal to store a non-i64 valtype in this list.126/// It is illegal to store a non-i64 valtype in this list.
127free_locals_i64: std.ArrayListUnmanaged(u32) = .empty,127free_locals_i64: std.ArrayList(u32) = .empty,
128/// A list of indexes which represents a local of valtype `f32`.128/// A list of indexes which represents a local of valtype `f32`.
129/// It is illegal to store a non-f32 valtype in this list.129/// It is illegal to store a non-f32 valtype in this list.
130free_locals_f32: std.ArrayListUnmanaged(u32) = .empty,130free_locals_f32: std.ArrayList(u32) = .empty,
131/// A list of indexes which represents a local of valtype `f64`.131/// A list of indexes which represents a local of valtype `f64`.
132/// It is illegal to store a non-f64 valtype in this list.132/// It is illegal to store a non-f64 valtype in this list.
133free_locals_f64: std.ArrayListUnmanaged(u32) = .empty,133free_locals_f64: std.ArrayList(u32) = .empty,
134/// A list of indexes which represents a local of valtype `v127`.134/// A list of indexes which represents a local of valtype `v127`.
135/// It is illegal to store a non-v128 valtype in this list.135/// It is illegal to store a non-v128 valtype in this list.
136free_locals_v128: std.ArrayListUnmanaged(u32) = .empty,136free_locals_v128: std.ArrayList(u32) = .empty,
137137
138/// When in debug mode, this tracks if no `finishAir` was missed.138/// When in debug mode, this tracks if no `finishAir` was missed.
139/// Forgetting to call `finishAir` will cause the result to not be139/// Forgetting to call `finishAir` will cause the result to not be
src/codegen/wasm/Mir.zig+1-1
...@@ -669,7 +669,7 @@ pub fn deinit(mir: *Mir, gpa: std.mem.Allocator) void {...@@ -669,7 +669,7 @@ pub fn deinit(mir: *Mir, gpa: std.mem.Allocator) void {
669 mir.* = undefined;669 mir.* = undefined;
670}670}
671671
672pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayListUnmanaged(u8)) std.mem.Allocator.Error!void {672pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayList(u8)) std.mem.Allocator.Error!void {
673 const gpa = wasm.base.comp.gpa;673 const gpa = wasm.base.comp.gpa;
674674
675 // Write the locals in the prologue of the function body.675 // Write the locals in the prologue of the function body.
src/codegen/x86_64/CodeGen.zig+8-8
...@@ -113,21 +113,21 @@ eflags_inst: ?Air.Inst.Index = null,...@@ -113,21 +113,21 @@ eflags_inst: ?Air.Inst.Index = null,
113/// MIR Instructions113/// MIR Instructions
114mir_instructions: std.MultiArrayList(Mir.Inst) = .empty,114mir_instructions: std.MultiArrayList(Mir.Inst) = .empty,
115/// MIR extra data115/// MIR extra data
116mir_extra: std.ArrayListUnmanaged(u32) = .empty,116mir_extra: std.ArrayList(u32) = .empty,
117mir_string_bytes: std.ArrayListUnmanaged(u8) = .empty,117mir_string_bytes: std.ArrayList(u8) = .empty,
118mir_strings: std.HashMapUnmanaged(118mir_strings: std.HashMapUnmanaged(
119 u32,119 u32,
120 void,120 void,
121 std.hash_map.StringIndexContext,121 std.hash_map.StringIndexContext,
122 std.hash_map.default_max_load_percentage,122 std.hash_map.default_max_load_percentage,
123) = .empty,123) = .empty,
124mir_locals: std.ArrayListUnmanaged(Mir.Local) = .empty,124mir_locals: std.ArrayList(Mir.Local) = .empty,
125mir_table: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty,125mir_table: std.ArrayList(Mir.Inst.Index) = .empty,
126126
127/// The value is an offset into the `Function` `code` from the beginning.127/// The value is an offset into the `Function` `code` from the beginning.
128/// To perform the reloc, write 32-bit signed little-endian integer128/// To perform the reloc, write 32-bit signed little-endian integer
129/// which is a relative jump, based on the address following the reloc.129/// which is a relative jump, based on the address following the reloc.
130epilogue_relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty,130epilogue_relocs: std.ArrayList(Mir.Inst.Index) = .empty,
131131
132reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,132reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
133inst_tracking: InstTrackingMap = .empty,133inst_tracking: InstTrackingMap = .empty,
...@@ -156,7 +156,7 @@ loop_switches: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {...@@ -156,7 +156,7 @@ loop_switches: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
156 min: Value,156 min: Value,
157 else_relocs: union(enum) {157 else_relocs: union(enum) {
158 @"unreachable",158 @"unreachable",
159 forward: std.ArrayListUnmanaged(Mir.Inst.Index),159 forward: std.ArrayList(Mir.Inst.Index),
160 backward: Mir.Inst.Index,160 backward: Mir.Inst.Index,
161 },161 },
162}) = .empty,162}) = .empty,
...@@ -855,7 +855,7 @@ const FrameAlloc = struct {...@@ -855,7 +855,7 @@ const FrameAlloc = struct {
855};855};
856856
857const BlockData = struct {857const BlockData = struct {
858 relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty,858 relocs: std.ArrayList(Mir.Inst.Index) = .empty,
859 state: State,859 state: State,
860860
861 fn deinit(self: *BlockData, gpa: Allocator) void {861 fn deinit(self: *BlockData, gpa: Allocator) void {
...@@ -177329,7 +177329,7 @@ fn airAsm(self: *CodeGen, inst: Air.Inst.Index) !void {...@@ -177329,7 +177329,7 @@ fn airAsm(self: *CodeGen, inst: Air.Inst.Index) !void {
177329177329
177330 const Label = struct {177330 const Label = struct {
177331 target: Mir.Inst.Index = undefined,177331 target: Mir.Inst.Index = undefined,
177332 pending_relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty,177332 pending_relocs: std.ArrayList(Mir.Inst.Index) = .empty,
177333177333
177334 const Kind = enum { definition, reference };177334 const Kind = enum { definition, reference };
177335177335
src/codegen/x86_64/Emit.zig+3-3
...@@ -12,9 +12,9 @@ prev_di_loc: Loc,...@@ -12,9 +12,9 @@ prev_di_loc: Loc,
12/// Relative to the beginning of `code`.12/// Relative to the beginning of `code`.
13prev_di_pc: usize,13prev_di_pc: usize,
1414
15code_offset_mapping: std.ArrayListUnmanaged(u32),15code_offset_mapping: std.ArrayList(u32),
16relocs: std.ArrayListUnmanaged(Reloc),16relocs: std.ArrayList(Reloc),
17table_relocs: std.ArrayListUnmanaged(TableReloc),17table_relocs: std.ArrayList(TableReloc),
1818
19pub const Error = Lower.Error || error{19pub const Error = Lower.Error || error{
20 EmitFail,20 EmitFail,
src/link.zig+18-18
...@@ -35,9 +35,9 @@ pub const Diags = struct {...@@ -35,9 +35,9 @@ pub const Diags = struct {
35 /// needing an allocator for things besides error reporting.35 /// needing an allocator for things besides error reporting.
36 gpa: Allocator,36 gpa: Allocator,
37 mutex: std.Thread.Mutex,37 mutex: std.Thread.Mutex,
38 msgs: std.ArrayListUnmanaged(Msg),38 msgs: std.ArrayList(Msg),
39 flags: Flags,39 flags: Flags,
40 lld: std.ArrayListUnmanaged(Lld),40 lld: std.ArrayList(Lld),
4141
42 pub const SourceLocation = union(enum) {42 pub const SourceLocation = union(enum) {
43 none,43 none,
...@@ -1775,19 +1775,19 @@ pub fn resolveInputs(...@@ -1775,19 +1775,19 @@ pub fn resolveInputs(
1775 target: *const std.Target,1775 target: *const std.Target,
1776 /// This function mutates this array but does not take ownership.1776 /// This function mutates this array but does not take ownership.
1777 /// Allocated with `gpa`.1777 /// Allocated with `gpa`.
1778 unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput),1778 unresolved_inputs: *std.ArrayList(UnresolvedInput),
1779 /// Allocated with `gpa`.1779 /// Allocated with `gpa`.
1780 resolved_inputs: *std.ArrayListUnmanaged(Input),1780 resolved_inputs: *std.ArrayList(Input),
1781 lib_directories: []const Cache.Directory,1781 lib_directories: []const Cache.Directory,
1782 color: std.zig.Color,1782 color: std.zig.Color,
1783) Allocator.Error!void {1783) Allocator.Error!void {
1784 var checked_paths: std.ArrayListUnmanaged(u8) = .empty;1784 var checked_paths: std.ArrayList(u8) = .empty;
1785 defer checked_paths.deinit(gpa);1785 defer checked_paths.deinit(gpa);
17861786
1787 var ld_script_bytes: std.ArrayListUnmanaged(u8) = .empty;1787 var ld_script_bytes: std.ArrayList(u8) = .empty;
1788 defer ld_script_bytes.deinit(gpa);1788 defer ld_script_bytes.deinit(gpa);
17891789
1790 var failed_libs: std.ArrayListUnmanaged(struct {1790 var failed_libs: std.ArrayList(struct {
1791 name: []const u8,1791 name: []const u8,
1792 strategy: UnresolvedInput.SearchStrategy,1792 strategy: UnresolvedInput.SearchStrategy,
1793 checked_paths: []const u8,1793 checked_paths: []const u8,
...@@ -2007,13 +2007,13 @@ fn resolveLibInput(...@@ -2007,13 +2007,13 @@ fn resolveLibInput(
2007 gpa: Allocator,2007 gpa: Allocator,
2008 arena: Allocator,2008 arena: Allocator,
2009 /// Allocated via `gpa`.2009 /// Allocated via `gpa`.
2010 unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput),2010 unresolved_inputs: *std.ArrayList(UnresolvedInput),
2011 /// Allocated via `gpa`.2011 /// Allocated via `gpa`.
2012 resolved_inputs: *std.ArrayListUnmanaged(Input),2012 resolved_inputs: *std.ArrayList(Input),
2013 /// Allocated via `gpa`.2013 /// Allocated via `gpa`.
2014 checked_paths: *std.ArrayListUnmanaged(u8),2014 checked_paths: *std.ArrayList(u8),
2015 /// Allocated via `gpa`.2015 /// Allocated via `gpa`.
2016 ld_script_bytes: *std.ArrayListUnmanaged(u8),2016 ld_script_bytes: *std.ArrayList(u8),
2017 lib_directory: Directory,2017 lib_directory: Directory,
2018 name_query: UnresolvedInput.NameQuery,2018 name_query: UnresolvedInput.NameQuery,
2019 target: *const std.Target,2019 target: *const std.Target,
...@@ -2097,7 +2097,7 @@ fn resolveLibInput(...@@ -2097,7 +2097,7 @@ fn resolveLibInput(
2097}2097}
20982098
2099fn finishResolveLibInput(2099fn finishResolveLibInput(
2100 resolved_inputs: *std.ArrayListUnmanaged(Input),2100 resolved_inputs: *std.ArrayList(Input),
2101 path: Path,2101 path: Path,
2102 file: std.fs.File,2102 file: std.fs.File,
2103 link_mode: std.builtin.LinkMode,2103 link_mode: std.builtin.LinkMode,
...@@ -2125,11 +2125,11 @@ fn resolvePathInput(...@@ -2125,11 +2125,11 @@ fn resolvePathInput(
2125 gpa: Allocator,2125 gpa: Allocator,
2126 arena: Allocator,2126 arena: Allocator,
2127 /// Allocated with `gpa`.2127 /// Allocated with `gpa`.
2128 unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput),2128 unresolved_inputs: *std.ArrayList(UnresolvedInput),
2129 /// Allocated with `gpa`.2129 /// Allocated with `gpa`.
2130 resolved_inputs: *std.ArrayListUnmanaged(Input),2130 resolved_inputs: *std.ArrayList(Input),
2131 /// Allocated via `gpa`.2131 /// Allocated via `gpa`.
2132 ld_script_bytes: *std.ArrayListUnmanaged(u8),2132 ld_script_bytes: *std.ArrayList(u8),
2133 target: *const std.Target,2133 target: *const std.Target,
2134 pq: UnresolvedInput.PathQuery,2134 pq: UnresolvedInput.PathQuery,
2135 color: std.zig.Color,2135 color: std.zig.Color,
...@@ -2167,11 +2167,11 @@ fn resolvePathInputLib(...@@ -2167,11 +2167,11 @@ fn resolvePathInputLib(
2167 gpa: Allocator,2167 gpa: Allocator,
2168 arena: Allocator,2168 arena: Allocator,
2169 /// Allocated with `gpa`.2169 /// Allocated with `gpa`.
2170 unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput),2170 unresolved_inputs: *std.ArrayList(UnresolvedInput),
2171 /// Allocated with `gpa`.2171 /// Allocated with `gpa`.
2172 resolved_inputs: *std.ArrayListUnmanaged(Input),2172 resolved_inputs: *std.ArrayList(Input),
2173 /// Allocated via `gpa`.2173 /// Allocated via `gpa`.
2174 ld_script_bytes: *std.ArrayListUnmanaged(u8),2174 ld_script_bytes: *std.ArrayList(u8),
2175 target: *const std.Target,2175 target: *const std.Target,
2176 pq: UnresolvedInput.PathQuery,2176 pq: UnresolvedInput.PathQuery,
2177 link_mode: std.builtin.LinkMode,2177 link_mode: std.builtin.LinkMode,
src/link/C.zig+6-6
...@@ -29,7 +29,7 @@ navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvBlock),...@@ -29,7 +29,7 @@ navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvBlock),
29/// All the string bytes of rendered C code, all squished into one array.29/// All the string bytes of rendered C code, all squished into one array.
30/// While in progress, a separate buffer is used, and then when finished, the30/// While in progress, a separate buffer is used, and then when finished, the
31/// buffer is copied into this one.31/// buffer is copied into this one.
32string_bytes: std.ArrayListUnmanaged(u8),32string_bytes: std.ArrayList(u8),
33/// Tracks all the anonymous decls that are used by all the decls so they can33/// Tracks all the anonymous decls that are used by all the decls so they can
34/// be rendered during flush().34/// be rendered during flush().
35uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, AvBlock),35uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, AvBlock),
...@@ -519,16 +519,16 @@ pub fn flush(self: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.P...@@ -519,16 +519,16 @@ pub fn flush(self: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.P
519519
520const Flush = struct {520const Flush = struct {
521 ctype_pool: codegen.CType.Pool,521 ctype_pool: codegen.CType.Pool,
522 ctype_global_from_decl_map: std.ArrayListUnmanaged(codegen.CType),522 ctype_global_from_decl_map: std.ArrayList(codegen.CType),
523 ctypes: std.ArrayListUnmanaged(u8),523 ctypes: std.ArrayList(u8),
524524
525 lazy_ctype_pool: codegen.CType.Pool,525 lazy_ctype_pool: codegen.CType.Pool,
526 lazy_fns: LazyFns,526 lazy_fns: LazyFns,
527 lazy_fwd_decl: std.ArrayListUnmanaged(u8),527 lazy_fwd_decl: std.ArrayList(u8),
528 lazy_code: std.ArrayListUnmanaged(u8),528 lazy_code: std.ArrayList(u8),
529529
530 /// We collect a list of buffers to write, and write them all at once with pwritev 😎530 /// We collect a list of buffers to write, and write them all at once with pwritev 😎
531 all_buffers: std.ArrayListUnmanaged([]const u8),531 all_buffers: std.ArrayList([]const u8),
532 /// Keeps track of the total bytes of `all_buffers`.532 /// Keeps track of the total bytes of `all_buffers`.
533 file_size: u64,533 file_size: u64,
534534
src/link/Dwarf.zig+12-12
...@@ -211,7 +211,7 @@ const DebugRngLists = struct {...@@ -211,7 +211,7 @@ const DebugRngLists = struct {
211};211};
212212
213const StringSection = struct {213const StringSection = struct {
214 contents: std.ArrayListUnmanaged(u8),214 contents: std.ArrayList(u8),
215 map: std.AutoArrayHashMapUnmanaged(void, void),215 map: std.AutoArrayHashMapUnmanaged(void, void),
216 section: Section,216 section: Section,
217217
...@@ -275,7 +275,7 @@ pub const Section = struct {...@@ -275,7 +275,7 @@ pub const Section = struct {
275 first: Unit.Index.Optional,275 first: Unit.Index.Optional,
276 last: Unit.Index.Optional,276 last: Unit.Index.Optional,
277 len: u64,277 len: u64,
278 units: std.ArrayListUnmanaged(Unit),278 units: std.ArrayList(Unit),
279279
280 pub const Index = enum {280 pub const Index = enum {
281 debug_abbrev,281 debug_abbrev,
...@@ -511,9 +511,9 @@ const Unit = struct {...@@ -511,9 +511,9 @@ const Unit = struct {
511 trailer_len: u32,511 trailer_len: u32,
512 /// data length in bytes512 /// data length in bytes
513 len: u32,513 len: u32,
514 entries: std.ArrayListUnmanaged(Entry),514 entries: std.ArrayList(Entry),
515 cross_unit_relocs: std.ArrayListUnmanaged(CrossUnitReloc),515 cross_unit_relocs: std.ArrayList(CrossUnitReloc),
516 cross_section_relocs: std.ArrayListUnmanaged(CrossSectionReloc),516 cross_section_relocs: std.ArrayList(CrossSectionReloc),
517517
518 const Index = enum(u32) {518 const Index = enum(u32) {
519 main,519 main,
...@@ -790,10 +790,10 @@ const Entry = struct {...@@ -790,10 +790,10 @@ const Entry = struct {
790 off: u32,790 off: u32,
791 /// data length in bytes791 /// data length in bytes
792 len: u32,792 len: u32,
793 cross_entry_relocs: std.ArrayListUnmanaged(CrossEntryReloc),793 cross_entry_relocs: std.ArrayList(CrossEntryReloc),
794 cross_unit_relocs: std.ArrayListUnmanaged(CrossUnitReloc),794 cross_unit_relocs: std.ArrayList(CrossUnitReloc),
795 cross_section_relocs: std.ArrayListUnmanaged(CrossSectionReloc),795 cross_section_relocs: std.ArrayList(CrossSectionReloc),
796 external_relocs: std.ArrayListUnmanaged(ExternalReloc),796 external_relocs: std.ArrayList(ExternalReloc),
797797
798 fn clear(entry: *Entry) void {798 fn clear(entry: *Entry) void {
799 entry.cross_entry_relocs.clearRetainingCapacity();799 entry.cross_entry_relocs.clearRetainingCapacity();
...@@ -1474,7 +1474,7 @@ pub const WipNav = struct {...@@ -1474,7 +1474,7 @@ pub const WipNav = struct {
1474 func: InternPool.Index,1474 func: InternPool.Index,
1475 func_sym_index: u32,1475 func_sym_index: u32,
1476 func_high_pc: u32,1476 func_high_pc: u32,
1477 blocks: std.ArrayListUnmanaged(struct {1477 blocks: std.ArrayList(struct {
1478 abbrev_code: u32,1478 abbrev_code: u32,
1479 low_pc_off: u64,1479 low_pc_off: u64,
1480 high_pc: u32,1480 high_pc: u32,
...@@ -2300,8 +2300,8 @@ pub const WipNav = struct {...@@ -2300,8 +2300,8 @@ pub const WipNav = struct {
2300 }2300 }
23012301
2302 const PendingLazy = struct {2302 const PendingLazy = struct {
2303 types: std.ArrayListUnmanaged(InternPool.Index),2303 types: std.ArrayList(InternPool.Index),
2304 values: std.ArrayListUnmanaged(InternPool.Index),2304 values: std.ArrayList(InternPool.Index),
23052305
2306 const empty: PendingLazy = .{ .types = .empty, .values = .empty };2306 const empty: PendingLazy = .{ .types = .empty, .values = .empty };
2307 };2307 };
src/link/Elf.zig+22-22
...@@ -26,10 +26,10 @@ files: std.MultiArrayList(File.Entry) = .{},...@@ -26,10 +26,10 @@ files: std.MultiArrayList(File.Entry) = .{},
26/// Long-lived list of all file descriptors.26/// Long-lived list of all file descriptors.
27/// We store them globally rather than per actual File so that we can re-use27/// We store them globally rather than per actual File so that we can re-use
28/// one file handle per every object file within an archive.28/// one file handle per every object file within an archive.
29file_handles: std.ArrayListUnmanaged(File.Handle) = .empty,29file_handles: std.ArrayList(File.Handle) = .empty,
30zig_object_index: ?File.Index = null,30zig_object_index: ?File.Index = null,
31linker_defined_index: ?File.Index = null,31linker_defined_index: ?File.Index = null,
32objects: std.ArrayListUnmanaged(File.Index) = .empty,32objects: std.ArrayList(File.Index) = .empty,
33shared_objects: std.StringArrayHashMapUnmanaged(File.Index) = .empty,33shared_objects: std.StringArrayHashMapUnmanaged(File.Index) = .empty,
3434
35/// List of all output sections and their associated metadata.35/// List of all output sections and their associated metadata.
...@@ -49,23 +49,23 @@ page_size: u32,...@@ -49,23 +49,23 @@ page_size: u32,
49default_sym_version: elf.Versym,49default_sym_version: elf.Versym,
5050
51/// .shstrtab buffer51/// .shstrtab buffer
52shstrtab: std.ArrayListUnmanaged(u8) = .empty,52shstrtab: std.ArrayList(u8) = .empty,
53/// .symtab buffer53/// .symtab buffer
54symtab: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty,54symtab: std.ArrayList(elf.Elf64_Sym) = .empty,
55/// .strtab buffer55/// .strtab buffer
56strtab: std.ArrayListUnmanaged(u8) = .empty,56strtab: std.ArrayList(u8) = .empty,
57/// Dynamic symbol table. Only populated and emitted when linking dynamically.57/// Dynamic symbol table. Only populated and emitted when linking dynamically.
58dynsym: DynsymSection = .{},58dynsym: DynsymSection = .{},
59/// .dynstrtab buffer59/// .dynstrtab buffer
60dynstrtab: std.ArrayListUnmanaged(u8) = .empty,60dynstrtab: std.ArrayList(u8) = .empty,
61/// Version symbol table. Only populated and emitted when linking dynamically.61/// Version symbol table. Only populated and emitted when linking dynamically.
62versym: std.ArrayListUnmanaged(elf.Versym) = .empty,62versym: std.ArrayList(elf.Versym) = .empty,
63/// .verneed section63/// .verneed section
64verneed: VerneedSection = .{},64verneed: VerneedSection = .{},
65/// .got section65/// .got section
66got: GotSection = .{},66got: GotSection = .{},
67/// .rela.dyn section67/// .rela.dyn section
68rela_dyn: std.ArrayListUnmanaged(elf.Elf64_Rela) = .empty,68rela_dyn: std.ArrayList(elf.Elf64_Rela) = .empty,
69/// .dynamic section69/// .dynamic section
70dynamic: DynamicSection = .{},70dynamic: DynamicSection = .{},
71/// .hash section71/// .hash section
...@@ -81,10 +81,10 @@ plt_got: PltGotSection = .{},...@@ -81,10 +81,10 @@ plt_got: PltGotSection = .{},
81/// .copyrel section81/// .copyrel section
82copy_rel: CopyRelSection = .{},82copy_rel: CopyRelSection = .{},
83/// .rela.plt section83/// .rela.plt section
84rela_plt: std.ArrayListUnmanaged(elf.Elf64_Rela) = .empty,84rela_plt: std.ArrayList(elf.Elf64_Rela) = .empty,
85/// SHT_GROUP sections85/// SHT_GROUP sections
86/// Applies only to a relocatable.86/// Applies only to a relocatable.
87group_sections: std.ArrayListUnmanaged(GroupSection) = .empty,87group_sections: std.ArrayList(GroupSection) = .empty,
8888
89resolver: SymbolResolver = .{},89resolver: SymbolResolver = .{},
9090
...@@ -92,15 +92,15 @@ has_text_reloc: bool = false,...@@ -92,15 +92,15 @@ has_text_reloc: bool = false,
92num_ifunc_dynrelocs: usize = 0,92num_ifunc_dynrelocs: usize = 0,
9393
94/// List of range extension thunks.94/// List of range extension thunks.
95thunks: std.ArrayListUnmanaged(Thunk) = .empty,95thunks: std.ArrayList(Thunk) = .empty,
9696
97/// List of output merge sections with deduped contents.97/// List of output merge sections with deduped contents.
98merge_sections: std.ArrayListUnmanaged(Merge.Section) = .empty,98merge_sections: std.ArrayList(Merge.Section) = .empty,
99comment_merge_section_index: ?Merge.Section.Index = null,99comment_merge_section_index: ?Merge.Section.Index = null,
100100
101/// `--verbose-link` output.101/// `--verbose-link` output.
102/// Initialized on creation, appended to as inputs are added, printed during `flush`.102/// Initialized on creation, appended to as inputs are added, printed during `flush`.
103dump_argv_list: std.ArrayListUnmanaged([]const u8),103dump_argv_list: std.ArrayList([]const u8),
104104
105const SectionIndexes = struct {105const SectionIndexes = struct {
106 copy_rel: ?u32 = null,106 copy_rel: ?u32 = null,
...@@ -127,7 +127,7 @@ const SectionIndexes = struct {...@@ -127,7 +127,7 @@ const SectionIndexes = struct {
127 symtab: ?u32 = null,127 symtab: ?u32 = null,
128};128};
129129
130const ProgramHeaderList = std.ArrayListUnmanaged(elf.Elf64_Phdr);130const ProgramHeaderList = std.ArrayList(elf.Elf64_Phdr);
131131
132const OptionalProgramHeaderIndex = enum(u16) {132const OptionalProgramHeaderIndex = enum(u16) {
133 none = std.math.maxInt(u16),133 none = std.math.maxInt(u16),
...@@ -1098,12 +1098,12 @@ fn parseObject(self: *Elf, obj: link.Input.Object) !void {...@@ -1098,12 +1098,12 @@ fn parseObject(self: *Elf, obj: link.Input.Object) !void {
1098fn parseArchive(1098fn parseArchive(
1099 gpa: Allocator,1099 gpa: Allocator,
1100 diags: *Diags,1100 diags: *Diags,
1101 file_handles: *std.ArrayListUnmanaged(File.Handle),1101 file_handles: *std.ArrayList(File.Handle),
1102 files: *std.MultiArrayList(File.Entry),1102 files: *std.MultiArrayList(File.Entry),
1103 target: *const std.Target,1103 target: *const std.Target,
1104 debug_fmt_strip: bool,1104 debug_fmt_strip: bool,
1105 default_sym_version: elf.Versym,1105 default_sym_version: elf.Versym,
1106 objects: *std.ArrayListUnmanaged(File.Index),1106 objects: *std.ArrayList(File.Index),
1107 obj: link.Input.Object,1107 obj: link.Input.Object,
1108 is_static_lib: bool,1108 is_static_lib: bool,
1109) !void {1109) !void {
...@@ -1748,7 +1748,7 @@ pub fn deleteExport(...@@ -1748,7 +1748,7 @@ pub fn deleteExport(
1748fn checkDuplicates(self: *Elf) !void {1748fn checkDuplicates(self: *Elf) !void {
1749 const gpa = self.base.comp.gpa;1749 const gpa = self.base.comp.gpa;
17501750
1751 var dupes = std.AutoArrayHashMap(SymbolResolver.Index, std.ArrayListUnmanaged(File.Index)).init(gpa);1751 var dupes = std.AutoArrayHashMap(SymbolResolver.Index, std.ArrayList(File.Index)).init(gpa);
1752 defer {1752 defer {
1753 for (dupes.values()) |*list| {1753 for (dupes.values()) |*list| {
1754 list.deinit(gpa);1754 list.deinit(gpa);
...@@ -3647,7 +3647,7 @@ fn fileLookup(files: std.MultiArrayList(File.Entry), index: File.Index, zig_obje...@@ -3647,7 +3647,7 @@ fn fileLookup(files: std.MultiArrayList(File.Entry), index: File.Index, zig_obje
36473647
3648pub fn addFileHandle(3648pub fn addFileHandle(
3649 gpa: Allocator,3649 gpa: Allocator,
3650 file_handles: *std.ArrayListUnmanaged(File.Handle),3650 file_handles: *std.ArrayList(File.Handle),
3651 handle: fs.File,3651 handle: fs.File,
3652) Allocator.Error!File.HandleIndex {3652) Allocator.Error!File.HandleIndex {
3653 try file_handles.append(gpa, handle);3653 try file_handles.append(gpa, handle);
...@@ -4204,8 +4204,8 @@ pub const Ref = struct {...@@ -4204,8 +4204,8 @@ pub const Ref = struct {
4204};4204};
42054205
4206pub const SymbolResolver = struct {4206pub const SymbolResolver = struct {
4207 keys: std.ArrayListUnmanaged(Key) = .empty,4207 keys: std.ArrayList(Key) = .empty,
4208 values: std.ArrayListUnmanaged(Ref) = .empty,4208 values: std.ArrayList(Ref) = .empty,
4209 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,4209 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
42104210
4211 const Result = struct {4211 const Result = struct {
...@@ -4303,7 +4303,7 @@ const Section = struct {...@@ -4303,7 +4303,7 @@ const Section = struct {
4303 /// List of atoms contributing to this section.4303 /// List of atoms contributing to this section.
4304 /// TODO currently this is only used for relocations tracking in relocatable mode4304 /// TODO currently this is only used for relocations tracking in relocatable mode
4305 /// but will be merged with atom_list_2.4305 /// but will be merged with atom_list_2.
4306 atom_list: std.ArrayListUnmanaged(Ref) = .empty,4306 atom_list: std.ArrayList(Ref) = .empty,
43074307
4308 /// List of atoms contributing to this section.4308 /// List of atoms contributing to this section.
4309 /// This can be used by sections that require special handling such as init/fini array, etc.4309 /// This can be used by sections that require special handling such as init/fini array, etc.
...@@ -4327,7 +4327,7 @@ const Section = struct {...@@ -4327,7 +4327,7 @@ const Section = struct {
4327 /// overcapacity can be negative. A simple way to have negative overcapacity is to4327 /// overcapacity can be negative. A simple way to have negative overcapacity is to
4328 /// allocate a fresh text block, which will have ideal capacity, and then grow it4328 /// allocate a fresh text block, which will have ideal capacity, and then grow it
4329 /// by 1 byte. It will then have -1 overcapacity.4329 /// by 1 byte. It will then have -1 overcapacity.
4330 free_list: std.ArrayListUnmanaged(Ref) = .empty,4330 free_list: std.ArrayList(Ref) = .empty,
4331};4331};
43324332
4333pub fn sectionSize(self: *Elf, shndx: u32) u64 {4333pub fn sectionSize(self: *Elf, shndx: u32) u64 {
src/link/Elf/Archive.zig+5-5
...@@ -11,7 +11,7 @@ pub fn deinit(a: *Archive, gpa: Allocator) void {...@@ -11,7 +11,7 @@ pub fn deinit(a: *Archive, gpa: Allocator) void {
11pub fn parse(11pub fn parse(
12 gpa: Allocator,12 gpa: Allocator,
13 diags: *Diags,13 diags: *Diags,
14 file_handles: *const std.ArrayListUnmanaged(File.Handle),14 file_handles: *const std.ArrayList(File.Handle),
15 path: Path,15 path: Path,
16 handle_index: File.HandleIndex,16 handle_index: File.HandleIndex,
17) !Archive {17) !Archive {
...@@ -27,10 +27,10 @@ pub fn parse(...@@ -27,10 +27,10 @@ pub fn parse(
2727
28 const size = (try handle.stat()).size;28 const size = (try handle.stat()).size;
2929
30 var objects: std.ArrayListUnmanaged(Object) = .empty;30 var objects: std.ArrayList(Object) = .empty;
31 defer objects.deinit(gpa);31 defer objects.deinit(gpa);
3232
33 var strtab: std.ArrayListUnmanaged(u8) = .empty;33 var strtab: std.ArrayList(u8) = .empty;
34 defer strtab.deinit(gpa);34 defer strtab.deinit(gpa);
3535
36 while (pos < size) {36 while (pos < size) {
...@@ -145,7 +145,7 @@ const strtab_delimiter = '\n';...@@ -145,7 +145,7 @@ const strtab_delimiter = '\n';
145pub const max_member_name_len = 15;145pub const max_member_name_len = 15;
146146
147pub const ArSymtab = struct {147pub const ArSymtab = struct {
148 symtab: std.ArrayListUnmanaged(Entry) = .empty,148 symtab: std.ArrayList(Entry) = .empty,
149 strtab: StringTable = .{},149 strtab: StringTable = .{},
150150
151 pub fn deinit(ar: *ArSymtab, allocator: Allocator) void {151 pub fn deinit(ar: *ArSymtab, allocator: Allocator) void {
...@@ -239,7 +239,7 @@ pub const ArSymtab = struct {...@@ -239,7 +239,7 @@ pub const ArSymtab = struct {
239};239};
240240
241pub const ArStrtab = struct {241pub const ArStrtab = struct {
242 buffer: std.ArrayListUnmanaged(u8) = .empty,242 buffer: std.ArrayList(u8) = .empty,
243243
244 pub fn deinit(ar: *ArStrtab, allocator: Allocator) void {244 pub fn deinit(ar: *ArStrtab, allocator: Allocator) void {
245 ar.buffer.deinit(allocator);245 ar.buffer.deinit(allocator);
src/link/Elf/AtomList.zig+1-1
...@@ -2,7 +2,7 @@ value: i64 = 0,...@@ -2,7 +2,7 @@ value: i64 = 0,
2size: u64 = 0,2size: u64 = 0,
3alignment: Atom.Alignment = .@"1",3alignment: Atom.Alignment = .@"1",
4output_section_index: u32 = 0,4output_section_index: u32 = 0,
5// atoms: std.ArrayListUnmanaged(Elf.Ref) = .empty,5// atoms: std.ArrayList(Elf.Ref) = .empty,
6atoms: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,6atoms: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,
77
8dirty: bool = true,8dirty: bool = true,
src/link/Elf/LinkerDefined.zig+6-6
...@@ -1,11 +1,11 @@...@@ -1,11 +1,11 @@
1index: File.Index,1index: File.Index,
22
3symtab: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty,3symtab: std.ArrayList(elf.Elf64_Sym) = .empty,
4strtab: std.ArrayListUnmanaged(u8) = .empty,4strtab: std.ArrayList(u8) = .empty,
55
6symbols: std.ArrayListUnmanaged(Symbol) = .empty,6symbols: std.ArrayList(Symbol) = .empty,
7symbols_extra: std.ArrayListUnmanaged(u32) = .empty,7symbols_extra: std.ArrayList(u32) = .empty,
8symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index) = .empty,8symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index) = .empty,
99
10entry_index: ?Symbol.Index = null,10entry_index: ?Symbol.Index = null,
11dynamic_index: ?Symbol.Index = null,11dynamic_index: ?Symbol.Index = null,
...@@ -24,7 +24,7 @@ dso_handle_index: ?Symbol.Index = null,...@@ -24,7 +24,7 @@ dso_handle_index: ?Symbol.Index = null,
24rela_iplt_start_index: ?Symbol.Index = null,24rela_iplt_start_index: ?Symbol.Index = null,
25rela_iplt_end_index: ?Symbol.Index = null,25rela_iplt_end_index: ?Symbol.Index = null,
26global_pointer_index: ?Symbol.Index = null,26global_pointer_index: ?Symbol.Index = null,
27start_stop_indexes: std.ArrayListUnmanaged(u32) = .empty,27start_stop_indexes: std.ArrayList(u32) = .empty,
2828
29output_symtab_ctx: Elf.SymtabCtx = .{},29output_symtab_ctx: Elf.SymtabCtx = .{},
3030
src/link/Elf/Merge.zig+7-7
...@@ -7,15 +7,15 @@ pub const Section = struct {...@@ -7,15 +7,15 @@ pub const Section = struct {
7 type: u32 = 0,7 type: u32 = 0,
8 flags: u64 = 0,8 flags: u64 = 0,
9 output_section_index: u32 = 0,9 output_section_index: u32 = 0,
10 bytes: std.ArrayListUnmanaged(u8) = .empty,10 bytes: std.ArrayList(u8) = .empty,
11 table: std.HashMapUnmanaged(11 table: std.HashMapUnmanaged(
12 String,12 String,
13 Subsection.Index,13 Subsection.Index,
14 IndexContext,14 IndexContext,
15 std.hash_map.default_max_load_percentage,15 std.hash_map.default_max_load_percentage,
16 ) = .{},16 ) = .{},
17 subsections: std.ArrayListUnmanaged(Subsection) = .empty,17 subsections: std.ArrayList(Subsection) = .empty,
18 finalized_subsections: std.ArrayListUnmanaged(Subsection.Index) = .empty,18 finalized_subsections: std.ArrayList(Subsection.Index) = .empty,
1919
20 pub fn deinit(msec: *Section, allocator: Allocator) void {20 pub fn deinit(msec: *Section, allocator: Allocator) void {
21 msec.bytes.deinit(allocator);21 msec.bytes.deinit(allocator);
...@@ -240,10 +240,10 @@ pub const Subsection = struct {...@@ -240,10 +240,10 @@ pub const Subsection = struct {
240pub const InputSection = struct {240pub const InputSection = struct {
241 merge_section_index: Section.Index = 0,241 merge_section_index: Section.Index = 0,
242 atom_index: Atom.Index = 0,242 atom_index: Atom.Index = 0,
243 offsets: std.ArrayListUnmanaged(u32) = .empty,243 offsets: std.ArrayList(u32) = .empty,
244 subsections: std.ArrayListUnmanaged(Subsection.Index) = .empty,244 subsections: std.ArrayList(Subsection.Index) = .empty,
245 bytes: std.ArrayListUnmanaged(u8) = .empty,245 bytes: std.ArrayList(u8) = .empty,
246 strings: std.ArrayListUnmanaged(String) = .empty,246 strings: std.ArrayList(String) = .empty,
247247
248 pub fn deinit(imsec: *InputSection, allocator: Allocator) void {248 pub fn deinit(imsec: *InputSection, allocator: Allocator) void {
249 imsec.offsets.deinit(allocator);249 imsec.offsets.deinit(allocator);
src/link/Elf/Object.zig+17-17
...@@ -6,29 +6,29 @@ file_handle: File.HandleIndex,...@@ -6,29 +6,29 @@ file_handle: File.HandleIndex,
6index: File.Index,6index: File.Index,
77
8header: ?elf.Elf64_Ehdr = null,8header: ?elf.Elf64_Ehdr = null,
9shdrs: std.ArrayListUnmanaged(elf.Elf64_Shdr) = .empty,9shdrs: std.ArrayList(elf.Elf64_Shdr) = .empty,
1010
11symtab: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty,11symtab: std.ArrayList(elf.Elf64_Sym) = .empty,
12strtab: std.ArrayListUnmanaged(u8) = .empty,12strtab: std.ArrayList(u8) = .empty,
13first_global: ?Symbol.Index = null,13first_global: ?Symbol.Index = null,
14symbols: std.ArrayListUnmanaged(Symbol) = .empty,14symbols: std.ArrayList(Symbol) = .empty,
15symbols_extra: std.ArrayListUnmanaged(u32) = .empty,15symbols_extra: std.ArrayList(u32) = .empty,
16symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index) = .empty,16symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index) = .empty,
17relocs: std.ArrayListUnmanaged(elf.Elf64_Rela) = .empty,17relocs: std.ArrayList(elf.Elf64_Rela) = .empty,
1818
19atoms: std.ArrayListUnmanaged(Atom) = .empty,19atoms: std.ArrayList(Atom) = .empty,
20atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty,20atoms_indexes: std.ArrayList(Atom.Index) = .empty,
21atoms_extra: std.ArrayListUnmanaged(u32) = .empty,21atoms_extra: std.ArrayList(u32) = .empty,
2222
23groups: std.ArrayListUnmanaged(Elf.Group) = .empty,23groups: std.ArrayList(Elf.Group) = .empty,
24group_data: std.ArrayListUnmanaged(u32) = .empty,24group_data: std.ArrayList(u32) = .empty,
2525
26input_merge_sections: std.ArrayListUnmanaged(Merge.InputSection) = .empty,26input_merge_sections: std.ArrayList(Merge.InputSection) = .empty,
27input_merge_sections_indexes: std.ArrayListUnmanaged(Merge.InputSection.Index) = .empty,27input_merge_sections_indexes: std.ArrayList(Merge.InputSection.Index) = .empty,
2828
29fdes: std.ArrayListUnmanaged(Fde) = .empty,29fdes: std.ArrayList(Fde) = .empty,
30cies: std.ArrayListUnmanaged(Cie) = .empty,30cies: std.ArrayList(Cie) = .empty,
31eh_frame_data: std.ArrayListUnmanaged(u8) = .empty,31eh_frame_data: std.ArrayList(u8) = .empty,
3232
33alive: bool = true,33alive: bool = true,
34dirty: bool = true,34dirty: bool = true,
src/link/Elf/SharedObject.zig+10-10
...@@ -3,11 +3,11 @@ index: File.Index,...@@ -3,11 +3,11 @@ index: File.Index,
33
4parsed: Parsed,4parsed: Parsed,
55
6symbols: std.ArrayListUnmanaged(Symbol),6symbols: std.ArrayList(Symbol),
7symbols_extra: std.ArrayListUnmanaged(u32),7symbols_extra: std.ArrayList(u32),
8symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index),8symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index),
99
10aliases: ?std.ArrayListUnmanaged(u32),10aliases: ?std.ArrayList(u32),
1111
12needed: bool,12needed: bool,
13alive: bool,13alive: bool,
...@@ -35,7 +35,7 @@ pub const Header = struct {...@@ -35,7 +35,7 @@ pub const Header = struct {
35 verdef_sect_index: ?u32,35 verdef_sect_index: ?u32,
3636
37 stat: Stat,37 stat: Stat,
38 strtab: std.ArrayListUnmanaged(u8),38 strtab: std.ArrayList(u8),
3939
40 pub fn deinit(header: *Header, gpa: Allocator) void {40 pub fn deinit(header: *Header, gpa: Allocator) void {
41 gpa.free(header.sections);41 gpa.free(header.sections);
...@@ -149,7 +149,7 @@ pub fn parseHeader(...@@ -149,7 +149,7 @@ pub fn parseHeader(
149 } else &.{};149 } else &.{};
150 errdefer gpa.free(dynamic_table);150 errdefer gpa.free(dynamic_table);
151151
152 var strtab: std.ArrayListUnmanaged(u8) = .empty;152 var strtab: std.ArrayList(u8) = .empty;
153 errdefer strtab.deinit(gpa);153 errdefer strtab.deinit(gpa);
154154
155 if (dynsym_sect_index) |index| {155 if (dynsym_sect_index) |index| {
...@@ -206,7 +206,7 @@ pub fn parse(...@@ -206,7 +206,7 @@ pub fn parse(
206 } else &.{};206 } else &.{};
207 defer gpa.free(symtab);207 defer gpa.free(symtab);
208208
209 var verstrings: std.ArrayListUnmanaged(u32) = .empty;209 var verstrings: std.ArrayList(u32) = .empty;
210 defer verstrings.deinit(gpa);210 defer verstrings.deinit(gpa);
211211
212 if (header.verdef_sect_index) |shndx| {212 if (header.verdef_sect_index) |shndx| {
...@@ -243,13 +243,13 @@ pub fn parse(...@@ -243,13 +243,13 @@ pub fn parse(
243 } else &.{};243 } else &.{};
244 defer gpa.free(versyms);244 defer gpa.free(versyms);
245245
246 var nonlocal_esyms: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty;246 var nonlocal_esyms: std.ArrayList(elf.Elf64_Sym) = .empty;
247 defer nonlocal_esyms.deinit(gpa);247 defer nonlocal_esyms.deinit(gpa);
248248
249 var nonlocal_versyms: std.ArrayListUnmanaged(elf.Versym) = .empty;249 var nonlocal_versyms: std.ArrayList(elf.Versym) = .empty;
250 defer nonlocal_versyms.deinit(gpa);250 defer nonlocal_versyms.deinit(gpa);
251251
252 var nonlocal_symbols: std.ArrayListUnmanaged(Parsed.Symbol) = .empty;252 var nonlocal_symbols: std.ArrayList(Parsed.Symbol) = .empty;
253 defer nonlocal_symbols.deinit(gpa);253 defer nonlocal_symbols.deinit(gpa);
254254
255 var strtab = header.strtab;255 var strtab = header.strtab;
src/link/Elf/ZigObject.zig+12-12
...@@ -3,24 +3,24 @@...@@ -3,24 +3,24 @@
3//! and any relocations that may have been emitted.3//! and any relocations that may have been emitted.
4//! Think about this as fake in-memory Object file for the Zig module.4//! Think about this as fake in-memory Object file for the Zig module.
55
6data: std.ArrayListUnmanaged(u8) = .empty,6data: std.ArrayList(u8) = .empty,
7/// Externally owned memory.7/// Externally owned memory.
8basename: []const u8,8basename: []const u8,
9index: File.Index,9index: File.Index,
1010
11symtab: std.MultiArrayList(ElfSym) = .{},11symtab: std.MultiArrayList(ElfSym) = .{},
12strtab: StringTable = .{},12strtab: StringTable = .{},
13symbols: std.ArrayListUnmanaged(Symbol) = .empty,13symbols: std.ArrayList(Symbol) = .empty,
14symbols_extra: std.ArrayListUnmanaged(u32) = .empty,14symbols_extra: std.ArrayList(u32) = .empty,
15symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index) = .empty,15symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index) = .empty,
16local_symbols: std.ArrayListUnmanaged(Symbol.Index) = .empty,16local_symbols: std.ArrayList(Symbol.Index) = .empty,
17global_symbols: std.ArrayListUnmanaged(Symbol.Index) = .empty,17global_symbols: std.ArrayList(Symbol.Index) = .empty,
18globals_lookup: std.AutoHashMapUnmanaged(u32, Symbol.Index) = .empty,18globals_lookup: std.AutoHashMapUnmanaged(u32, Symbol.Index) = .empty,
1919
20atoms: std.ArrayListUnmanaged(Atom) = .empty,20atoms: std.ArrayList(Atom) = .empty,
21atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty,21atoms_indexes: std.ArrayList(Atom.Index) = .empty,
22atoms_extra: std.ArrayListUnmanaged(u32) = .empty,22atoms_extra: std.ArrayList(u32) = .empty,
23relocs: std.ArrayListUnmanaged(std.ArrayListUnmanaged(elf.Elf64_Rela)) = .empty,23relocs: std.ArrayList(std.ArrayList(elf.Elf64_Rela)) = .empty,
2424
25num_dynrelocs: u32 = 0,25num_dynrelocs: u32 = 0,
2626
...@@ -2369,7 +2369,7 @@ const LazySymbolMetadata = struct {...@@ -2369,7 +2369,7 @@ const LazySymbolMetadata = struct {
2369const AvMetadata = struct {2369const AvMetadata = struct {
2370 symbol_index: Symbol.Index,2370 symbol_index: Symbol.Index,
2371 /// A list of all exports aliases of this Av.2371 /// A list of all exports aliases of this Av.
2372 exports: std.ArrayListUnmanaged(Symbol.Index) = .empty,2372 exports: std.ArrayList(Symbol.Index) = .empty,
2373 /// Set to true if the AV has been initialized and allocated.2373 /// Set to true if the AV has been initialized and allocated.
2374 allocated: bool = false,2374 allocated: bool = false,
23752375
...@@ -2417,7 +2417,7 @@ const TlsVariable = struct {...@@ -2417,7 +2417,7 @@ const TlsVariable = struct {
2417 }2417 }
2418};2418};
24192419
2420const AtomList = std.ArrayListUnmanaged(Atom.Index);2420const AtomList = std.ArrayList(Atom.Index);
2421const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);2421const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);
2422const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);2422const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);
2423const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);2423const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);
src/link/Elf/synthetic_sections.zig+9-9
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1pub const DynamicSection = struct {1pub const DynamicSection = struct {
2 soname: ?u32 = null,2 soname: ?u32 = null,
3 needed: std.ArrayListUnmanaged(u32) = .empty,3 needed: std.ArrayList(u32) = .empty,
4 rpath: u32 = 0,4 rpath: u32 = 0,
55
6 pub fn deinit(dt: *DynamicSection, allocator: Allocator) void {6 pub fn deinit(dt: *DynamicSection, allocator: Allocator) void {
...@@ -226,7 +226,7 @@ pub const DynamicSection = struct {...@@ -226,7 +226,7 @@ pub const DynamicSection = struct {
226};226};
227227
228pub const GotSection = struct {228pub const GotSection = struct {
229 entries: std.ArrayListUnmanaged(Entry) = .empty,229 entries: std.ArrayList(Entry) = .empty,
230 output_symtab_ctx: Elf.SymtabCtx = .{},230 output_symtab_ctx: Elf.SymtabCtx = .{},
231 tlsld_index: ?u32 = null,231 tlsld_index: ?u32 = null,
232 flags: Flags = .{},232 flags: Flags = .{},
...@@ -628,7 +628,7 @@ pub const GotSection = struct {...@@ -628,7 +628,7 @@ pub const GotSection = struct {
628};628};
629629
630pub const PltSection = struct {630pub const PltSection = struct {
631 symbols: std.ArrayListUnmanaged(Elf.Ref) = .empty,631 symbols: std.ArrayList(Elf.Ref) = .empty,
632 output_symtab_ctx: Elf.SymtabCtx = .{},632 output_symtab_ctx: Elf.SymtabCtx = .{},
633633
634 pub fn deinit(plt: *PltSection, allocator: Allocator) void {634 pub fn deinit(plt: *PltSection, allocator: Allocator) void {
...@@ -875,7 +875,7 @@ pub const GotPltSection = struct {...@@ -875,7 +875,7 @@ pub const GotPltSection = struct {
875};875};
876876
877pub const PltGotSection = struct {877pub const PltGotSection = struct {
878 symbols: std.ArrayListUnmanaged(Elf.Ref) = .empty,878 symbols: std.ArrayList(Elf.Ref) = .empty,
879 output_symtab_ctx: Elf.SymtabCtx = .{},879 output_symtab_ctx: Elf.SymtabCtx = .{},
880880
881 pub fn deinit(plt_got: *PltGotSection, allocator: Allocator) void {881 pub fn deinit(plt_got: *PltGotSection, allocator: Allocator) void {
...@@ -981,7 +981,7 @@ pub const PltGotSection = struct {...@@ -981,7 +981,7 @@ pub const PltGotSection = struct {
981};981};
982982
983pub const CopyRelSection = struct {983pub const CopyRelSection = struct {
984 symbols: std.ArrayListUnmanaged(Elf.Ref) = .empty,984 symbols: std.ArrayList(Elf.Ref) = .empty,
985985
986 pub fn deinit(copy_rel: *CopyRelSection, allocator: Allocator) void {986 pub fn deinit(copy_rel: *CopyRelSection, allocator: Allocator) void {
987 copy_rel.symbols.deinit(allocator);987 copy_rel.symbols.deinit(allocator);
...@@ -1062,7 +1062,7 @@ pub const CopyRelSection = struct {...@@ -1062,7 +1062,7 @@ pub const CopyRelSection = struct {
1062};1062};
10631063
1064pub const DynsymSection = struct {1064pub const DynsymSection = struct {
1065 entries: std.ArrayListUnmanaged(Entry) = .empty,1065 entries: std.ArrayList(Entry) = .empty,
10661066
1067 pub const Entry = struct {1067 pub const Entry = struct {
1068 /// Ref of the symbol which gets privilege of getting a dynamic treatment1068 /// Ref of the symbol which gets privilege of getting a dynamic treatment
...@@ -1146,7 +1146,7 @@ pub const DynsymSection = struct {...@@ -1146,7 +1146,7 @@ pub const DynsymSection = struct {
1146};1146};
11471147
1148pub const HashSection = struct {1148pub const HashSection = struct {
1149 buffer: std.ArrayListUnmanaged(u8) = .empty,1149 buffer: std.ArrayList(u8) = .empty,
11501150
1151 pub fn deinit(hs: *HashSection, allocator: Allocator) void {1151 pub fn deinit(hs: *HashSection, allocator: Allocator) void {
1152 hs.buffer.deinit(allocator);1152 hs.buffer.deinit(allocator);
...@@ -1307,8 +1307,8 @@ pub const GnuHashSection = struct {...@@ -1307,8 +1307,8 @@ pub const GnuHashSection = struct {
1307};1307};
13081308
1309pub const VerneedSection = struct {1309pub const VerneedSection = struct {
1310 verneed: std.ArrayListUnmanaged(elf.Elf64_Verneed) = .empty,1310 verneed: std.ArrayList(elf.Elf64_Verneed) = .empty,
1311 vernaux: std.ArrayListUnmanaged(elf.Vernaux) = .empty,1311 vernaux: std.ArrayList(elf.Vernaux) = .empty,
1312 index: elf.Versym = .{ .VERSION = elf.Versym.GLOBAL.VERSION + 1, .HIDDEN = false },1312 index: elf.Versym = .{ .VERSION = elf.Versym.GLOBAL.VERSION + 1, .HIDDEN = false },
13131313
1314 pub fn deinit(vern: *VerneedSection, allocator: Allocator) void {1314 pub fn deinit(vern: *VerneedSection, allocator: Allocator) void {
src/link/LdScript.zig+3-3
...@@ -26,9 +26,9 @@ pub fn parse(...@@ -26,9 +26,9 @@ pub fn parse(
26 data: []const u8,26 data: []const u8,
27) Error!LdScript {27) Error!LdScript {
28 var tokenizer = Tokenizer{ .source = data };28 var tokenizer = Tokenizer{ .source = data };
29 var tokens: std.ArrayListUnmanaged(Token) = .empty;29 var tokens: std.ArrayList(Token) = .empty;
30 defer tokens.deinit(gpa);30 defer tokens.deinit(gpa);
31 var line_col: std.ArrayListUnmanaged(LineColumn) = .empty;31 var line_col: std.ArrayList(LineColumn) = .empty;
32 defer line_col.deinit(gpa);32 defer line_col.deinit(gpa);
3333
34 var line: usize = 0;34 var line: usize = 0;
...@@ -117,7 +117,7 @@ const Parser = struct {...@@ -117,7 +117,7 @@ const Parser = struct {
117 it: *TokenIterator,117 it: *TokenIterator,
118118
119 cpu_arch: ?std.Target.Cpu.Arch,119 cpu_arch: ?std.Target.Cpu.Arch,
120 args: std.ArrayListUnmanaged(Arg),120 args: std.ArrayList(Arg),
121121
122 fn start(parser: *Parser) !void {122 fn start(parser: *Parser) !void {
123 while (true) {123 while (true) {
src/link/Lld.zig+1-1
...@@ -312,7 +312,7 @@ fn linkAsArchive(lld: *Lld, arena: Allocator) !void {...@@ -312,7 +312,7 @@ fn linkAsArchive(lld: *Lld, arena: Allocator) !void {
312312
313 const link_inputs = comp.link_inputs;313 const link_inputs = comp.link_inputs;
314314
315 var object_files: std.ArrayListUnmanaged([*:0]const u8) = .empty;315 var object_files: std.ArrayList([*:0]const u8) = .empty;
316316
317 try object_files.ensureUnusedCapacity(arena, link_inputs.len);317 try object_files.ensureUnusedCapacity(arena, link_inputs.len);
318 for (link_inputs) |input| {318 for (link_inputs) |input| {
src/link/MachO.zig+19-19
...@@ -16,13 +16,13 @@ files: std.MultiArrayList(File.Entry) = .{},...@@ -16,13 +16,13 @@ files: std.MultiArrayList(File.Entry) = .{},
16/// Long-lived list of all file descriptors.16/// Long-lived list of all file descriptors.
17/// We store them globally rather than per actual File so that we can re-use17/// We store them globally rather than per actual File so that we can re-use
18/// one file handle per every object file within an archive.18/// one file handle per every object file within an archive.
19file_handles: std.ArrayListUnmanaged(File.Handle) = .empty,19file_handles: std.ArrayList(File.Handle) = .empty,
20zig_object: ?File.Index = null,20zig_object: ?File.Index = null,
21internal_object: ?File.Index = null,21internal_object: ?File.Index = null,
22objects: std.ArrayListUnmanaged(File.Index) = .empty,22objects: std.ArrayList(File.Index) = .empty,
23dylibs: std.ArrayListUnmanaged(File.Index) = .empty,23dylibs: std.ArrayList(File.Index) = .empty,
2424
25segments: std.ArrayListUnmanaged(macho.segment_command_64) = .empty,25segments: std.ArrayList(macho.segment_command_64) = .empty,
26sections: std.MultiArrayList(Section) = .{},26sections: std.MultiArrayList(Section) = .{},
2727
28resolver: SymbolResolver = .{},28resolver: SymbolResolver = .{},
...@@ -30,7 +30,7 @@ resolver: SymbolResolver = .{},...@@ -30,7 +30,7 @@ resolver: SymbolResolver = .{},
30/// Key is symbol index.30/// Key is symbol index.
31undefs: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, UndefRefs) = .empty,31undefs: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, UndefRefs) = .empty,
32undefs_mutex: std.Thread.Mutex = .{},32undefs_mutex: std.Thread.Mutex = .{},
33dupes: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, std.ArrayListUnmanaged(File.Index)) = .empty,33dupes: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, std.ArrayList(File.Index)) = .empty,
34dupes_mutex: std.Thread.Mutex = .{},34dupes_mutex: std.Thread.Mutex = .{},
3535
36dyld_info_cmd: macho.dyld_info_command = .{},36dyld_info_cmd: macho.dyld_info_command = .{},
...@@ -55,11 +55,11 @@ eh_frame_sect_index: ?u8 = null,...@@ -55,11 +55,11 @@ eh_frame_sect_index: ?u8 = null,
55unwind_info_sect_index: ?u8 = null,55unwind_info_sect_index: ?u8 = null,
56objc_stubs_sect_index: ?u8 = null,56objc_stubs_sect_index: ?u8 = null,
5757
58thunks: std.ArrayListUnmanaged(Thunk) = .empty,58thunks: std.ArrayList(Thunk) = .empty,
5959
60/// Output synthetic sections60/// Output synthetic sections
61symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty,61symtab: std.ArrayList(macho.nlist_64) = .empty,
62strtab: std.ArrayListUnmanaged(u8) = .empty,62strtab: std.ArrayList(u8) = .empty,
63indsymtab: Indsymtab = .{},63indsymtab: Indsymtab = .{},
64got: GotSection = .{},64got: GotSection = .{},
65stubs: StubsSection = .{},65stubs: StubsSection = .{},
...@@ -4041,19 +4041,19 @@ const default_entry_symbol_name = "_main";...@@ -4041,19 +4041,19 @@ const default_entry_symbol_name = "_main";
4041const Section = struct {4041const Section = struct {
4042 header: macho.section_64,4042 header: macho.section_64,
4043 segment_id: u8,4043 segment_id: u8,
4044 atoms: std.ArrayListUnmanaged(Ref) = .empty,4044 atoms: std.ArrayList(Ref) = .empty,
4045 free_list: std.ArrayListUnmanaged(Atom.Index) = .empty,4045 free_list: std.ArrayList(Atom.Index) = .empty,
4046 last_atom_index: Atom.Index = 0,4046 last_atom_index: Atom.Index = 0,
4047 thunks: std.ArrayListUnmanaged(Thunk.Index) = .empty,4047 thunks: std.ArrayList(Thunk.Index) = .empty,
4048 out: std.ArrayListUnmanaged(u8) = .empty,4048 out: std.ArrayList(u8) = .empty,
4049 relocs: std.ArrayListUnmanaged(macho.relocation_info) = .empty,4049 relocs: std.ArrayList(macho.relocation_info) = .empty,
4050};4050};
40514051
4052pub const LiteralPool = struct {4052pub const LiteralPool = struct {
4053 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,4053 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
4054 keys: std.ArrayListUnmanaged(Key) = .empty,4054 keys: std.ArrayList(Key) = .empty,
4055 values: std.ArrayListUnmanaged(MachO.Ref) = .empty,4055 values: std.ArrayList(MachO.Ref) = .empty,
4056 data: std.ArrayListUnmanaged(u8) = .empty,4056 data: std.ArrayList(u8) = .empty,
40574057
4058 pub fn deinit(lp: *LiteralPool, allocator: Allocator) void {4058 pub fn deinit(lp: *LiteralPool, allocator: Allocator) void {
4059 lp.table.deinit(allocator);4059 lp.table.deinit(allocator);
...@@ -4485,8 +4485,8 @@ pub const Ref = struct {...@@ -4485,8 +4485,8 @@ pub const Ref = struct {
4485};4485};
44864486
4487pub const SymbolResolver = struct {4487pub const SymbolResolver = struct {
4488 keys: std.ArrayListUnmanaged(Key) = .empty,4488 keys: std.ArrayList(Key) = .empty,
4489 values: std.ArrayListUnmanaged(Ref) = .empty,4489 values: std.ArrayList(Ref) = .empty,
4490 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,4490 table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
44914491
4492 const Result = struct {4492 const Result = struct {
...@@ -4586,7 +4586,7 @@ pub const UndefRefs = union(enum) {...@@ -4586,7 +4586,7 @@ pub const UndefRefs = union(enum) {
4586 entry,4586 entry,
4587 dyld_stub_binder,4587 dyld_stub_binder,
4588 objc_msgsend,4588 objc_msgsend,
4589 refs: std.ArrayListUnmanaged(Ref),4589 refs: std.ArrayList(Ref),
45904590
4591 pub fn deinit(self: *UndefRefs, allocator: Allocator) void {4591 pub fn deinit(self: *UndefRefs, allocator: Allocator) void {
4592 switch (self.*) {4592 switch (self.*) {
src/link/MachO/Archive.zig+2-2
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1objects: std.ArrayListUnmanaged(Object) = .empty,1objects: std.ArrayList(Object) = .empty,
22
3pub fn deinit(self: *Archive, allocator: Allocator) void {3pub fn deinit(self: *Archive, allocator: Allocator) void {
4 self.objects.deinit(allocator);4 self.objects.deinit(allocator);
...@@ -172,7 +172,7 @@ pub const ar_hdr = extern struct {...@@ -172,7 +172,7 @@ pub const ar_hdr = extern struct {
172};172};
173173
174pub const ArSymtab = struct {174pub const ArSymtab = struct {
175 entries: std.ArrayListUnmanaged(Entry) = .empty,175 entries: std.ArrayList(Entry) = .empty,
176 strtab: StringTable = .{},176 strtab: StringTable = .{},
177177
178 pub fn deinit(ar: *ArSymtab, allocator: Allocator) void {178 pub fn deinit(ar: *ArSymtab, allocator: Allocator) void {
src/link/MachO/CodeSignature.zig+1-1
...@@ -53,7 +53,7 @@ const CodeDirectory = struct {...@@ -53,7 +53,7 @@ const CodeDirectory = struct {
53 inner: macho.CodeDirectory,53 inner: macho.CodeDirectory,
54 ident: []const u8,54 ident: []const u8,
55 special_slots: [n_special_slots][hash_size]u8,55 special_slots: [n_special_slots][hash_size]u8,
56 code_slots: std.ArrayListUnmanaged([hash_size]u8) = .empty,56 code_slots: std.ArrayList([hash_size]u8) = .empty,
5757
58 const n_special_slots: usize = 7;58 const n_special_slots: usize = 7;
5959
src/link/MachO/DebugSymbols.zig+5-5
...@@ -4,8 +4,8 @@ file: ?fs.File,...@@ -4,8 +4,8 @@ file: ?fs.File,
4symtab_cmd: macho.symtab_command = .{},4symtab_cmd: macho.symtab_command = .{},
5uuid_cmd: macho.uuid_command = .{ .uuid = [_]u8{0} ** 16 },5uuid_cmd: macho.uuid_command = .{ .uuid = [_]u8{0} ** 16 },
66
7segments: std.ArrayListUnmanaged(macho.segment_command_64) = .empty,7segments: std.ArrayList(macho.segment_command_64) = .empty,
8sections: std.ArrayListUnmanaged(macho.section_64) = .empty,8sections: std.ArrayList(macho.section_64) = .empty,
99
10dwarf_segment_cmd_index: ?u8 = null,10dwarf_segment_cmd_index: ?u8 = null,
11linkedit_segment_cmd_index: ?u8 = null,11linkedit_segment_cmd_index: ?u8 = null,
...@@ -19,11 +19,11 @@ debug_line_str_section_index: ?u8 = null,...@@ -19,11 +19,11 @@ debug_line_str_section_index: ?u8 = null,
19debug_loclists_section_index: ?u8 = null,19debug_loclists_section_index: ?u8 = null,
20debug_rnglists_section_index: ?u8 = null,20debug_rnglists_section_index: ?u8 = null,
2121
22relocs: std.ArrayListUnmanaged(Reloc) = .empty,22relocs: std.ArrayList(Reloc) = .empty,
2323
24/// Output synthetic sections24/// Output synthetic sections
25symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty,25symtab: std.ArrayList(macho.nlist_64) = .empty,
26strtab: std.ArrayListUnmanaged(u8) = .empty,26strtab: std.ArrayList(u8) = .empty,
2727
28pub const Reloc = struct {28pub const Reloc = struct {
29 type: enum {29 type: enum {
src/link/MachO/Dylib.zig+6-6
...@@ -6,14 +6,14 @@ file_handle: File.HandleIndex,...@@ -6,14 +6,14 @@ file_handle: File.HandleIndex,
6tag: enum { dylib, tbd },6tag: enum { dylib, tbd },
77
8exports: std.MultiArrayList(Export) = .{},8exports: std.MultiArrayList(Export) = .{},
9strtab: std.ArrayListUnmanaged(u8) = .empty,9strtab: std.ArrayList(u8) = .empty,
10id: ?Id = null,10id: ?Id = null,
11ordinal: u16 = 0,11ordinal: u16 = 0,
1212
13symbols: std.ArrayListUnmanaged(Symbol) = .empty,13symbols: std.ArrayList(Symbol) = .empty,
14symbols_extra: std.ArrayListUnmanaged(u32) = .empty,14symbols_extra: std.ArrayList(u32) = .empty,
15globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty,15globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,
16dependents: std.ArrayListUnmanaged(Id) = .empty,16dependents: std.ArrayList(Id) = .empty,
17rpaths: std.StringArrayHashMapUnmanaged(void) = .empty,17rpaths: std.StringArrayHashMapUnmanaged(void) = .empty,
18umbrella: File.Index,18umbrella: File.Index,
19platform: ?MachO.Platform = null,19platform: ?MachO.Platform = null,
...@@ -695,7 +695,7 @@ pub const TargetMatcher = struct {...@@ -695,7 +695,7 @@ pub const TargetMatcher = struct {
695 allocator: Allocator,695 allocator: Allocator,
696 cpu_arch: std.Target.Cpu.Arch,696 cpu_arch: std.Target.Cpu.Arch,
697 platform: macho.PLATFORM,697 platform: macho.PLATFORM,
698 target_strings: std.ArrayListUnmanaged([]const u8) = .empty,698 target_strings: std.ArrayList([]const u8) = .empty,
699699
700 pub fn init(allocator: Allocator, cpu_arch: std.Target.Cpu.Arch, platform: macho.PLATFORM) !TargetMatcher {700 pub fn init(allocator: Allocator, cpu_arch: std.Target.Cpu.Arch, platform: macho.PLATFORM) !TargetMatcher {
701 var self = TargetMatcher{701 var self = TargetMatcher{
src/link/MachO/InternalObject.zig+13-13
...@@ -1,19 +1,19 @@...@@ -1,19 +1,19 @@
1index: File.Index,1index: File.Index,
22
3sections: std.MultiArrayList(Section) = .{},3sections: std.MultiArrayList(Section) = .{},
4atoms: std.ArrayListUnmanaged(Atom) = .empty,4atoms: std.ArrayList(Atom) = .empty,
5atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty,5atoms_indexes: std.ArrayList(Atom.Index) = .empty,
6atoms_extra: std.ArrayListUnmanaged(u32) = .empty,6atoms_extra: std.ArrayList(u32) = .empty,
7symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty,7symtab: std.ArrayList(macho.nlist_64) = .empty,
8strtab: std.ArrayListUnmanaged(u8) = .empty,8strtab: std.ArrayList(u8) = .empty,
9symbols: std.ArrayListUnmanaged(Symbol) = .empty,9symbols: std.ArrayList(Symbol) = .empty,
10symbols_extra: std.ArrayListUnmanaged(u32) = .empty,10symbols_extra: std.ArrayList(u32) = .empty,
11globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty,11globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,
1212
13objc_methnames: std.ArrayListUnmanaged(u8) = .empty,13objc_methnames: std.ArrayList(u8) = .empty,
14objc_selrefs: [@sizeOf(u64)]u8 = [_]u8{0} ** @sizeOf(u64),14objc_selrefs: [@sizeOf(u64)]u8 = [_]u8{0} ** @sizeOf(u64),
1515
16force_undefined: std.ArrayListUnmanaged(Symbol.Index) = .empty,16force_undefined: std.ArrayList(Symbol.Index) = .empty,
17entry_index: ?Symbol.Index = null,17entry_index: ?Symbol.Index = null,
18dyld_stub_binder_index: ?Symbol.Index = null,18dyld_stub_binder_index: ?Symbol.Index = null,
19dyld_private_index: ?Symbol.Index = null,19dyld_private_index: ?Symbol.Index = null,
...@@ -21,7 +21,7 @@ objc_msg_send_index: ?Symbol.Index = null,...@@ -21,7 +21,7 @@ objc_msg_send_index: ?Symbol.Index = null,
21mh_execute_header_index: ?Symbol.Index = null,21mh_execute_header_index: ?Symbol.Index = null,
22mh_dylib_header_index: ?Symbol.Index = null,22mh_dylib_header_index: ?Symbol.Index = null,
23dso_handle_index: ?Symbol.Index = null,23dso_handle_index: ?Symbol.Index = null,
24boundary_symbols: std.ArrayListUnmanaged(Symbol.Index) = .empty,24boundary_symbols: std.ArrayList(Symbol.Index) = .empty,
2525
26output_symtab_ctx: MachO.SymtabCtx = .{},26output_symtab_ctx: MachO.SymtabCtx = .{},
2727
...@@ -880,7 +880,7 @@ pub fn fmtSymtab(self: *InternalObject, macho_file: *MachO) std.fmt.Alt(Format,...@@ -880,7 +880,7 @@ pub fn fmtSymtab(self: *InternalObject, macho_file: *MachO) std.fmt.Alt(Format,
880880
881const Section = struct {881const Section = struct {
882 header: macho.section_64,882 header: macho.section_64,
883 relocs: std.ArrayListUnmanaged(Relocation) = .empty,883 relocs: std.ArrayList(Relocation) = .empty,
884 extra: Extra = .{},884 extra: Extra = .{},
885885
886 const Extra = packed struct {886 const Extra = packed struct {
src/link/MachO/Object.zig+19-19
...@@ -12,27 +12,27 @@ in_archive: ?InArchive = null,...@@ -12,27 +12,27 @@ in_archive: ?InArchive = null,
12header: ?macho.mach_header_64 = null,12header: ?macho.mach_header_64 = null,
13sections: std.MultiArrayList(Section) = .{},13sections: std.MultiArrayList(Section) = .{},
14symtab: std.MultiArrayList(Nlist) = .{},14symtab: std.MultiArrayList(Nlist) = .{},
15strtab: std.ArrayListUnmanaged(u8) = .empty,15strtab: std.ArrayList(u8) = .empty,
1616
17symbols: std.ArrayListUnmanaged(Symbol) = .empty,17symbols: std.ArrayList(Symbol) = .empty,
18symbols_extra: std.ArrayListUnmanaged(u32) = .empty,18symbols_extra: std.ArrayList(u32) = .empty,
19globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty,19globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,
20atoms: std.ArrayListUnmanaged(Atom) = .empty,20atoms: std.ArrayList(Atom) = .empty,
21atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty,21atoms_indexes: std.ArrayList(Atom.Index) = .empty,
22atoms_extra: std.ArrayListUnmanaged(u32) = .empty,22atoms_extra: std.ArrayList(u32) = .empty,
2323
24platform: ?MachO.Platform = null,24platform: ?MachO.Platform = null,
25compile_unit: ?CompileUnit = null,25compile_unit: ?CompileUnit = null,
26stab_files: std.ArrayListUnmanaged(StabFile) = .empty,26stab_files: std.ArrayList(StabFile) = .empty,
2727
28eh_frame_sect_index: ?u8 = null,28eh_frame_sect_index: ?u8 = null,
29compact_unwind_sect_index: ?u8 = null,29compact_unwind_sect_index: ?u8 = null,
30cies: std.ArrayListUnmanaged(Cie) = .empty,30cies: std.ArrayList(Cie) = .empty,
31fdes: std.ArrayListUnmanaged(Fde) = .empty,31fdes: std.ArrayList(Fde) = .empty,
32eh_frame_data: std.ArrayListUnmanaged(u8) = .empty,32eh_frame_data: std.ArrayList(u8) = .empty,
33unwind_records: std.ArrayListUnmanaged(UnwindInfo.Record) = .empty,33unwind_records: std.ArrayList(UnwindInfo.Record) = .empty,
34unwind_records_indexes: std.ArrayListUnmanaged(UnwindInfo.Record.Index) = .empty,34unwind_records_indexes: std.ArrayList(UnwindInfo.Record.Index) = .empty,
35data_in_code: std.ArrayListUnmanaged(macho.data_in_code_entry) = .empty,35data_in_code: std.ArrayList(macho.data_in_code_entry) = .empty,
3636
37alive: bool = true,37alive: bool = true,
38hidden: bool = false,38hidden: bool = false,
...@@ -2603,8 +2603,8 @@ fn formatPath(object: Object, w: *Writer) Writer.Error!void {...@@ -2603,8 +2603,8 @@ fn formatPath(object: Object, w: *Writer) Writer.Error!void {
26032603
2604const Section = struct {2604const Section = struct {
2605 header: macho.section_64,2605 header: macho.section_64,
2606 subsections: std.ArrayListUnmanaged(Subsection) = .empty,2606 subsections: std.ArrayList(Subsection) = .empty,
2607 relocs: std.ArrayListUnmanaged(Relocation) = .empty,2607 relocs: std.ArrayList(Relocation) = .empty,
2608};2608};
26092609
2610const Subsection = struct {2610const Subsection = struct {
...@@ -2620,7 +2620,7 @@ pub const Nlist = struct {...@@ -2620,7 +2620,7 @@ pub const Nlist = struct {
26202620
2621const StabFile = struct {2621const StabFile = struct {
2622 comp_dir: u32,2622 comp_dir: u32,
2623 stabs: std.ArrayListUnmanaged(Stab) = .empty,2623 stabs: std.ArrayList(Stab) = .empty,
26242624
2625 fn getCompDir(sf: StabFile, object: Object) [:0]const u8 {2625 fn getCompDir(sf: StabFile, object: Object) [:0]const u8 {
2626 const nlist = object.symtab.items(.nlist)[sf.comp_dir];2626 const nlist = object.symtab.items(.nlist)[sf.comp_dir];
...@@ -2706,7 +2706,7 @@ const x86_64 = struct {...@@ -2706,7 +2706,7 @@ const x86_64 = struct {
2706 self: *Object,2706 self: *Object,
2707 n_sect: u8,2707 n_sect: u8,
2708 sect: macho.section_64,2708 sect: macho.section_64,
2709 out: *std.ArrayListUnmanaged(Relocation),2709 out: *std.ArrayList(Relocation),
2710 handle: File.Handle,2710 handle: File.Handle,
2711 macho_file: *MachO,2711 macho_file: *MachO,
2712 ) !void {2712 ) !void {
...@@ -2873,7 +2873,7 @@ const aarch64 = struct {...@@ -2873,7 +2873,7 @@ const aarch64 = struct {
2873 self: *Object,2873 self: *Object,
2874 n_sect: u8,2874 n_sect: u8,
2875 sect: macho.section_64,2875 sect: macho.section_64,
2876 out: *std.ArrayListUnmanaged(Relocation),2876 out: *std.ArrayList(Relocation),
2877 handle: File.Handle,2877 handle: File.Handle,
2878 macho_file: *MachO,2878 macho_file: *MachO,
2879 ) !void {2879 ) !void {
src/link/MachO/UnwindInfo.zig+4-4
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/// List of all unwind records gathered from all objects and sorted1/// List of all unwind records gathered from all objects and sorted
2/// by allocated relative function address within the section.2/// by allocated relative function address within the section.
3records: std.ArrayListUnmanaged(Record.Ref) = .empty,3records: std.ArrayList(Record.Ref) = .empty,
44
5/// List of all personalities referenced by either unwind info entries5/// List of all personalities referenced by either unwind info entries
6/// or __eh_frame entries.6/// or __eh_frame entries.
...@@ -12,11 +12,11 @@ common_encodings: [max_common_encodings]Encoding = undefined,...@@ -12,11 +12,11 @@ common_encodings: [max_common_encodings]Encoding = undefined,
12common_encodings_count: u7 = 0,12common_encodings_count: u7 = 0,
1313
14/// List of record indexes containing an LSDA pointer.14/// List of record indexes containing an LSDA pointer.
15lsdas: std.ArrayListUnmanaged(u32) = .empty,15lsdas: std.ArrayList(u32) = .empty,
16lsdas_lookup: std.ArrayListUnmanaged(u32) = .empty,16lsdas_lookup: std.ArrayList(u32) = .empty,
1717
18/// List of second level pages.18/// List of second level pages.
19pages: std.ArrayListUnmanaged(Page) = .empty,19pages: std.ArrayList(Page) = .empty,
2020
21pub fn deinit(info: *UnwindInfo, allocator: Allocator) void {21pub fn deinit(info: *UnwindInfo, allocator: Allocator) void {
22 info.records.deinit(allocator);22 info.records.deinit(allocator);
src/link/MachO/ZigObject.zig+9-9
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1data: std.ArrayListUnmanaged(u8) = .empty,1data: std.ArrayList(u8) = .empty,
2/// Externally owned memory.2/// Externally owned memory.
3basename: []const u8,3basename: []const u8,
4index: File.Index,4index: File.Index,
...@@ -6,15 +6,15 @@ index: File.Index,...@@ -6,15 +6,15 @@ index: File.Index,
6symtab: std.MultiArrayList(Nlist) = .{},6symtab: std.MultiArrayList(Nlist) = .{},
7strtab: StringTable = .{},7strtab: StringTable = .{},
88
9symbols: std.ArrayListUnmanaged(Symbol) = .empty,9symbols: std.ArrayList(Symbol) = .empty,
10symbols_extra: std.ArrayListUnmanaged(u32) = .empty,10symbols_extra: std.ArrayList(u32) = .empty,
11globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty,11globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty,
12/// Maps string index (so name) into nlist index for the global symbol defined within this12/// Maps string index (so name) into nlist index for the global symbol defined within this
13/// module.13/// module.
14globals_lookup: std.AutoHashMapUnmanaged(u32, u32) = .empty,14globals_lookup: std.AutoHashMapUnmanaged(u32, u32) = .empty,
15atoms: std.ArrayListUnmanaged(Atom) = .empty,15atoms: std.ArrayList(Atom) = .empty,
16atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty,16atoms_indexes: std.ArrayList(Atom.Index) = .empty,
17atoms_extra: std.ArrayListUnmanaged(u32) = .empty,17atoms_extra: std.ArrayList(u32) = .empty,
1818
19/// Table of tracked LazySymbols.19/// Table of tracked LazySymbols.
20lazy_syms: LazySymbolTable = .{},20lazy_syms: LazySymbolTable = .{},
...@@ -1737,7 +1737,7 @@ pub fn fmtAtoms(self: *ZigObject, macho_file: *MachO) std.fmt.Alt(Format, Format...@@ -1737,7 +1737,7 @@ pub fn fmtAtoms(self: *ZigObject, macho_file: *MachO) std.fmt.Alt(Format, Format
1737const AvMetadata = struct {1737const AvMetadata = struct {
1738 symbol_index: Symbol.Index,1738 symbol_index: Symbol.Index,
1739 /// A list of all exports aliases of this Av.1739 /// A list of all exports aliases of this Av.
1740 exports: std.ArrayListUnmanaged(Symbol.Index) = .empty,1740 exports: std.ArrayList(Symbol.Index) = .empty,
17411741
1742 fn @"export"(m: AvMetadata, zig_object: *ZigObject, name: []const u8) ?*u32 {1742 fn @"export"(m: AvMetadata, zig_object: *ZigObject, name: []const u8) ?*u32 {
1743 for (m.exports.items) |*exp| {1743 for (m.exports.items) |*exp| {
...@@ -1769,7 +1769,7 @@ const TlvInitializer = struct {...@@ -1769,7 +1769,7 @@ const TlvInitializer = struct {
1769const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);1769const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata);
1770const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);1770const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata);
1771const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);1771const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata);
1772const RelocationTable = std.ArrayListUnmanaged(std.ArrayListUnmanaged(Relocation));1772const RelocationTable = std.ArrayList(std.ArrayList(Relocation));
1773const TlvInitializerTable = std.AutoArrayHashMapUnmanaged(Atom.Index, TlvInitializer);1773const TlvInitializerTable = std.AutoArrayHashMapUnmanaged(Atom.Index, TlvInitializer);
17741774
1775const x86_64 = struct {1775const x86_64 = struct {
src/link/MachO/dyld_info/Rebase.zig+2-2
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1entries: std.ArrayListUnmanaged(Entry) = .empty,1entries: std.ArrayList(Entry) = .empty,
2buffer: std.ArrayListUnmanaged(u8) = .empty,2buffer: std.ArrayList(u8) = .empty,
33
4pub const Entry = struct {4pub const Entry = struct {
5 offset: u64,5 offset: u64,
src/link/MachO/dyld_info/Trie.zig+4-4
...@@ -31,9 +31,9 @@...@@ -31,9 +31,9 @@
3131
32/// The root node of the trie.32/// The root node of the trie.
33root: ?Node.Index = null,33root: ?Node.Index = null,
34buffer: std.ArrayListUnmanaged(u8) = .empty,34buffer: std.ArrayList(u8) = .empty,
35nodes: std.MultiArrayList(Node) = .{},35nodes: std.MultiArrayList(Node) = .{},
36edges: std.ArrayListUnmanaged(Edge) = .empty,36edges: std.ArrayList(Edge) = .empty,
3737
38/// Insert a symbol into the trie, updating the prefixes in the process.38/// Insert a symbol into the trie, updating the prefixes in the process.
39/// This operation may change the layout of the trie by splicing edges in39/// This operation may change the layout of the trie by splicing edges in
...@@ -139,7 +139,7 @@ fn finalize(self: *Trie, allocator: Allocator) !void {...@@ -139,7 +139,7 @@ fn finalize(self: *Trie, allocator: Allocator) !void {
139 try ordered_nodes.ensureTotalCapacityPrecise(self.nodes.items(.is_terminal).len);139 try ordered_nodes.ensureTotalCapacityPrecise(self.nodes.items(.is_terminal).len);
140140
141 {141 {
142 var fifo: std.ArrayListUnmanaged(Node.Index) = .empty;142 var fifo: std.ArrayList(Node.Index) = .empty;
143 defer fifo.deinit(allocator);143 defer fifo.deinit(allocator);
144144
145 try fifo.append(allocator, self.root.?);145 try fifo.append(allocator, self.root.?);
...@@ -328,7 +328,7 @@ const Node = struct {...@@ -328,7 +328,7 @@ const Node = struct {
328 trie_offset: u32 = 0,328 trie_offset: u32 = 0,
329329
330 /// List of all edges originating from this node.330 /// List of all edges originating from this node.
331 edges: std.ArrayListUnmanaged(Edge.Index) = .empty,331 edges: std.ArrayList(Edge.Index) = .empty,
332332
333 const Index = u32;333 const Index = u32;
334};334};
src/link/MachO/dyld_info/bind.zig+7-7
...@@ -17,8 +17,8 @@ pub const Entry = struct {...@@ -17,8 +17,8 @@ pub const Entry = struct {
17};17};
1818
19pub const Bind = struct {19pub const Bind = struct {
20 entries: std.ArrayListUnmanaged(Entry) = .empty,20 entries: std.ArrayList(Entry) = .empty,
21 buffer: std.ArrayListUnmanaged(u8) = .empty,21 buffer: std.ArrayList(u8) = .empty,
2222
23 const Self = @This();23 const Self = @This();
2424
...@@ -271,8 +271,8 @@ pub const Bind = struct {...@@ -271,8 +271,8 @@ pub const Bind = struct {
271};271};
272272
273pub const WeakBind = struct {273pub const WeakBind = struct {
274 entries: std.ArrayListUnmanaged(Entry) = .empty,274 entries: std.ArrayList(Entry) = .empty,
275 buffer: std.ArrayListUnmanaged(u8) = .empty,275 buffer: std.ArrayList(u8) = .empty,
276276
277 const Self = @This();277 const Self = @This();
278278
...@@ -515,9 +515,9 @@ pub const WeakBind = struct {...@@ -515,9 +515,9 @@ pub const WeakBind = struct {
515};515};
516516
517pub const LazyBind = struct {517pub const LazyBind = struct {
518 entries: std.ArrayListUnmanaged(Entry) = .empty,518 entries: std.ArrayList(Entry) = .empty,
519 buffer: std.ArrayListUnmanaged(u8) = .empty,519 buffer: std.ArrayList(u8) = .empty,
520 offsets: std.ArrayListUnmanaged(u32) = .empty,520 offsets: std.ArrayList(u32) = .empty,
521521
522 const Self = @This();522 const Self = @This();
523523
src/link/MachO/synthetic.zig+5-5
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1pub const GotSection = struct {1pub const GotSection = struct {
2 symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,2 symbols: std.ArrayList(MachO.Ref) = .empty,
33
4 pub const Index = u32;4 pub const Index = u32;
55
...@@ -61,7 +61,7 @@ pub const GotSection = struct {...@@ -61,7 +61,7 @@ pub const GotSection = struct {
61};61};
6262
63pub const StubsSection = struct {63pub const StubsSection = struct {
64 symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,64 symbols: std.ArrayList(MachO.Ref) = .empty,
6565
66 pub const Index = u32;66 pub const Index = u32;
6767
...@@ -296,7 +296,7 @@ pub const LaSymbolPtrSection = struct {...@@ -296,7 +296,7 @@ pub const LaSymbolPtrSection = struct {
296};296};
297297
298pub const TlvPtrSection = struct {298pub const TlvPtrSection = struct {
299 symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,299 symbols: std.ArrayList(MachO.Ref) = .empty,
300300
301 pub const Index = u32;301 pub const Index = u32;
302302
...@@ -361,7 +361,7 @@ pub const TlvPtrSection = struct {...@@ -361,7 +361,7 @@ pub const TlvPtrSection = struct {
361};361};
362362
363pub const ObjcStubsSection = struct {363pub const ObjcStubsSection = struct {
364 symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,364 symbols: std.ArrayList(MachO.Ref) = .empty,
365365
366 pub fn deinit(objc: *ObjcStubsSection, allocator: Allocator) void {366 pub fn deinit(objc: *ObjcStubsSection, allocator: Allocator) void {
367 objc.symbols.deinit(allocator);367 objc.symbols.deinit(allocator);
...@@ -517,7 +517,7 @@ pub const Indsymtab = struct {...@@ -517,7 +517,7 @@ pub const Indsymtab = struct {
517};517};
518518
519pub const DataInCode = struct {519pub const DataInCode = struct {
520 entries: std.ArrayListUnmanaged(Entry) = .empty,520 entries: std.ArrayList(Entry) = .empty,
521521
522 pub fn deinit(dice: *DataInCode, allocator: Allocator) void {522 pub fn deinit(dice: *DataInCode, allocator: Allocator) void {
523 dice.entries.deinit(allocator);523 dice.entries.deinit(allocator);
src/link/StringTable.zig+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1buffer: std.ArrayListUnmanaged(u8) = .empty,1buffer: std.ArrayList(u8) = .empty,
2table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty,2table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty,
33
4pub fn deinit(self: *Self, gpa: Allocator) void {4pub fn deinit(self: *Self, gpa: Allocator) void {
src/link/Wasm.zig+25-25
...@@ -53,7 +53,7 @@ base: link.File,...@@ -53,7 +53,7 @@ base: link.File,
53/// with a null byte so that deserialization does not attempt to create53/// with a null byte so that deserialization does not attempt to create
54/// string_table entries for them. Alternately those sites could be moved to54/// string_table entries for them. Alternately those sites could be moved to
55/// use a different byte array for this purpose.55/// use a different byte array for this purpose.
56string_bytes: std.ArrayListUnmanaged(u8),56string_bytes: std.ArrayList(u8),
57/// Sometimes we have logic that wants to borrow string bytes to store57/// Sometimes we have logic that wants to borrow string bytes to store
58/// arbitrary things in there. In this case it is not allowed to intern new58/// arbitrary things in there. In this case it is not allowed to intern new
59/// strings during this time. This safety lock is used to detect misuses.59/// strings during this time. This safety lock is used to detect misuses.
...@@ -77,7 +77,7 @@ export_table: bool,...@@ -77,7 +77,7 @@ export_table: bool,
77/// Output name of the file77/// Output name of the file
78name: []const u8,78name: []const u8,
79/// List of relocatable files to be linked into the final binary.79/// List of relocatable files to be linked into the final binary.
80objects: std.ArrayListUnmanaged(Object) = .{},80objects: std.ArrayList(Object) = .{},
8181
82func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,82func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,
83/// Provides a mapping of both imports and provided functions to symbol name.83/// Provides a mapping of both imports and provided functions to symbol name.
...@@ -85,23 +85,23 @@ func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,...@@ -85,23 +85,23 @@ func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,
85/// Key is symbol name, however the `FunctionImport` may have an name override for the import name.85/// Key is symbol name, however the `FunctionImport` may have an name override for the import name.
86object_function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImport) = .empty,86object_function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImport) = .empty,
87/// All functions for all objects.87/// All functions for all objects.
88object_functions: std.ArrayListUnmanaged(ObjectFunction) = .empty,88object_functions: std.ArrayList(ObjectFunction) = .empty,
8989
90/// Provides a mapping of both imports and provided globals to symbol name.90/// Provides a mapping of both imports and provided globals to symbol name.
91/// Local globals may be unnamed.91/// Local globals may be unnamed.
92object_global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImport) = .empty,92object_global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImport) = .empty,
93/// All globals for all objects.93/// All globals for all objects.
94object_globals: std.ArrayListUnmanaged(ObjectGlobal) = .empty,94object_globals: std.ArrayList(ObjectGlobal) = .empty,
9595
96/// All table imports for all objects.96/// All table imports for all objects.
97object_table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport) = .empty,97object_table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport) = .empty,
98/// All parsed table sections for all objects.98/// All parsed table sections for all objects.
99object_tables: std.ArrayListUnmanaged(Table) = .empty,99object_tables: std.ArrayList(Table) = .empty,
100100
101/// All memory imports for all objects.101/// All memory imports for all objects.
102object_memory_imports: std.AutoArrayHashMapUnmanaged(String, MemoryImport) = .empty,102object_memory_imports: std.AutoArrayHashMapUnmanaged(String, MemoryImport) = .empty,
103/// All parsed memory sections for all objects.103/// All parsed memory sections for all objects.
104object_memories: std.ArrayListUnmanaged(ObjectMemory) = .empty,104object_memories: std.ArrayList(ObjectMemory) = .empty,
105105
106/// All relocations from all objects concatenated. `relocs_start` marks the end106/// All relocations from all objects concatenated. `relocs_start` marks the end
107/// point of object relocations and start point of Zcu relocations.107/// point of object relocations and start point of Zcu relocations.
...@@ -109,21 +109,21 @@ object_relocations: std.MultiArrayList(ObjectRelocation) = .empty,...@@ -109,21 +109,21 @@ object_relocations: std.MultiArrayList(ObjectRelocation) = .empty,
109109
110/// List of initialization functions. These must be called in order of priority110/// List of initialization functions. These must be called in order of priority
111/// by the (synthetic) `__wasm_call_ctors` function.111/// by the (synthetic) `__wasm_call_ctors` function.
112object_init_funcs: std.ArrayListUnmanaged(InitFunc) = .empty,112object_init_funcs: std.ArrayList(InitFunc) = .empty,
113113
114/// The data section of an object has many segments. Each segment corresponds114/// The data section of an object has many segments. Each segment corresponds
115/// logically to an object file's .data section, or .rodata section. In115/// logically to an object file's .data section, or .rodata section. In
116/// the case of `-fdata-sections` there will be one segment per data symbol.116/// the case of `-fdata-sections` there will be one segment per data symbol.
117object_data_segments: std.ArrayListUnmanaged(ObjectDataSegment) = .empty,117object_data_segments: std.ArrayList(ObjectDataSegment) = .empty,
118/// Each segment has many data symbols, which correspond logically to global118/// Each segment has many data symbols, which correspond logically to global
119/// constants.119/// constants.
120object_datas: std.ArrayListUnmanaged(ObjectData) = .empty,120object_datas: std.ArrayList(ObjectData) = .empty,
121object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty,121object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty,
122/// Non-synthetic section that can essentially be mem-cpy'd into place after performing relocations.122/// Non-synthetic section that can essentially be mem-cpy'd into place after performing relocations.
123object_custom_segments: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, CustomSegment) = .empty,123object_custom_segments: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, CustomSegment) = .empty,
124124
125/// All comdat information for all objects.125/// All comdat information for all objects.
126object_comdats: std.ArrayListUnmanaged(Comdat) = .empty,126object_comdats: std.ArrayList(Comdat) = .empty,
127/// A table that maps the relocations to be performed where the key represents127/// A table that maps the relocations to be performed where the key represents
128/// the section (across all objects) that the slice of relocations applies to.128/// the section (across all objects) that the slice of relocations applies to.
129object_relocations_table: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, ObjectRelocation.Slice) = .empty,129object_relocations_table: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, ObjectRelocation.Slice) = .empty,
...@@ -138,15 +138,15 @@ out_relocs: std.MultiArrayList(OutReloc) = .empty,...@@ -138,15 +138,15 @@ out_relocs: std.MultiArrayList(OutReloc) = .empty,
138/// List of locations within `string_bytes` that must be patched with the virtual138/// List of locations within `string_bytes` that must be patched with the virtual
139/// memory address of a Uav during `flush`.139/// memory address of a Uav during `flush`.
140/// When emitting an object file, `out_relocs` is used instead.140/// When emitting an object file, `out_relocs` is used instead.
141uav_fixups: std.ArrayListUnmanaged(UavFixup) = .empty,141uav_fixups: std.ArrayList(UavFixup) = .empty,
142/// List of locations within `string_bytes` that must be patched with the virtual142/// List of locations within `string_bytes` that must be patched with the virtual
143/// memory address of a Nav during `flush`.143/// memory address of a Nav during `flush`.
144/// When emitting an object file, `out_relocs` is used instead.144/// When emitting an object file, `out_relocs` is used instead.
145/// No functions here only global variables.145/// No functions here only global variables.
146nav_fixups: std.ArrayListUnmanaged(NavFixup) = .empty,146nav_fixups: std.ArrayList(NavFixup) = .empty,
147/// When a nav reference is a function pointer, this tracks the required function147/// When a nav reference is a function pointer, this tracks the required function
148/// table entry index that needs to overwrite the code in the final output.148/// table entry index that needs to overwrite the code in the final output.
149func_table_fixups: std.ArrayListUnmanaged(FuncTableFixup) = .empty,149func_table_fixups: std.ArrayList(FuncTableFixup) = .empty,
150/// Symbols to be emitted into an object file. Remains empty when not emitting150/// Symbols to be emitted into an object file. Remains empty when not emitting
151/// an object file.151/// an object file.
152symbol_table: std.AutoArrayHashMapUnmanaged(String, void) = .empty,152symbol_table: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
...@@ -167,7 +167,7 @@ memories: std.wasm.Memory = .{ .limits = .{...@@ -167,7 +167,7 @@ memories: std.wasm.Memory = .{ .limits = .{
167/// `--verbose-link` output.167/// `--verbose-link` output.
168/// Initialized on creation, appended to as inputs are added, printed during `flush`.168/// Initialized on creation, appended to as inputs are added, printed during `flush`.
169/// String data is allocated into Compilation arena.169/// String data is allocated into Compilation arena.
170dump_argv_list: std.ArrayListUnmanaged([]const u8),170dump_argv_list: std.ArrayList([]const u8),
171171
172preloaded_strings: PreloadedStrings,172preloaded_strings: PreloadedStrings,
173173
...@@ -205,7 +205,7 @@ entry_resolution: FunctionImport.Resolution = .unresolved,...@@ -205,7 +205,7 @@ entry_resolution: FunctionImport.Resolution = .unresolved,
205/// Empty when outputting an object.205/// Empty when outputting an object.
206function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,206function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,
207hidden_function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,207hidden_function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,
208global_exports: std.ArrayListUnmanaged(GlobalExport) = .empty,208global_exports: std.ArrayList(GlobalExport) = .empty,
209/// Tracks the value at the end of prelink.209/// Tracks the value at the end of prelink.
210global_exports_len: u32 = 0,210global_exports_len: u32 = 0,
211211
...@@ -279,22 +279,22 @@ any_passive_inits: bool = false,...@@ -279,22 +279,22 @@ any_passive_inits: bool = false,
279/// All MIR instructions for all Zcu functions.279/// All MIR instructions for all Zcu functions.
280mir_instructions: std.MultiArrayList(Mir.Inst) = .{},280mir_instructions: std.MultiArrayList(Mir.Inst) = .{},
281/// Corresponds to `mir_instructions`.281/// Corresponds to `mir_instructions`.
282mir_extra: std.ArrayListUnmanaged(u32) = .empty,282mir_extra: std.ArrayList(u32) = .empty,
283/// All local types for all Zcu functions.283/// All local types for all Zcu functions.
284mir_locals: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty,284mir_locals: std.ArrayList(std.wasm.Valtype) = .empty,
285285
286params_scratch: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty,286params_scratch: std.ArrayList(std.wasm.Valtype) = .empty,
287returns_scratch: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty,287returns_scratch: std.ArrayList(std.wasm.Valtype) = .empty,
288288
289/// All Zcu error names in order, null-terminated, concatenated. No need to289/// All Zcu error names in order, null-terminated, concatenated. No need to
290/// serialize; trivially reconstructed.290/// serialize; trivially reconstructed.
291error_name_bytes: std.ArrayListUnmanaged(u8) = .empty,291error_name_bytes: std.ArrayList(u8) = .empty,
292/// For each Zcu error, in order, offset into `error_name_bytes` where the name292/// For each Zcu error, in order, offset into `error_name_bytes` where the name
293/// is stored. No need to serialize; trivially reconstructed.293/// is stored. No need to serialize; trivially reconstructed.
294error_name_offs: std.ArrayListUnmanaged(u32) = .empty,294error_name_offs: std.ArrayList(u32) = .empty,
295295
296tag_name_bytes: std.ArrayListUnmanaged(u8) = .empty,296tag_name_bytes: std.ArrayList(u8) = .empty,
297tag_name_offs: std.ArrayListUnmanaged(u32) = .empty,297tag_name_offs: std.ArrayList(u32) = .empty,
298298
299pub const TagNameOff = extern struct {299pub const TagNameOff = extern struct {
300 off: u32,300 off: u32,
...@@ -4196,8 +4196,8 @@ fn convertZcuFnType(...@@ -4196,8 +4196,8 @@ fn convertZcuFnType(
4196 params: []const InternPool.Index,4196 params: []const InternPool.Index,
4197 return_type: Zcu.Type,4197 return_type: Zcu.Type,
4198 target: *const std.Target,4198 target: *const std.Target,
4199 params_buffer: *std.ArrayListUnmanaged(std.wasm.Valtype),4199 params_buffer: *std.ArrayList(std.wasm.Valtype),
4200 returns_buffer: *std.ArrayListUnmanaged(std.wasm.Valtype),4200 returns_buffer: *std.ArrayList(std.wasm.Valtype),
4201) Allocator.Error!void {4201) Allocator.Error!void {
4202 params_buffer.clearRetainingCapacity();4202 params_buffer.clearRetainingCapacity();
4203 returns_buffer.clearRetainingCapacity();4203 returns_buffer.clearRetainingCapacity();
src/link/Wasm/Archive.zig+1-1
...@@ -12,7 +12,7 @@ toc: Toc,...@@ -12,7 +12,7 @@ toc: Toc,
1212
13/// Key points into `LazyArchive` `file_contents`.13/// Key points into `LazyArchive` `file_contents`.
14/// Value is allocated with gpa.14/// Value is allocated with gpa.
15const Toc = std.StringArrayHashMapUnmanaged(std.ArrayListUnmanaged(u32));15const Toc = std.StringArrayHashMapUnmanaged(std.ArrayList(u32));
1616
17const ARMAG = std.elf.ARMAG;17const ARMAG = std.elf.ARMAG;
18const ARFMAG = std.elf.ARFMAG;18const ARFMAG = std.elf.ARFMAG;
src/link/Wasm/Object.zig+8-8
...@@ -169,14 +169,14 @@ pub const Symbol = struct {...@@ -169,14 +169,14 @@ pub const Symbol = struct {
169};169};
170170
171pub const ScratchSpace = struct {171pub const ScratchSpace = struct {
172 func_types: std.ArrayListUnmanaged(Wasm.FunctionType.Index) = .empty,172 func_types: std.ArrayList(Wasm.FunctionType.Index) = .empty,
173 func_type_indexes: std.ArrayListUnmanaged(FuncTypeIndex) = .empty,173 func_type_indexes: std.ArrayList(FuncTypeIndex) = .empty,
174 func_imports: std.ArrayListUnmanaged(FunctionImport) = .empty,174 func_imports: std.ArrayList(FunctionImport) = .empty,
175 global_imports: std.ArrayListUnmanaged(GlobalImport) = .empty,175 global_imports: std.ArrayList(GlobalImport) = .empty,
176 table_imports: std.ArrayListUnmanaged(TableImport) = .empty,176 table_imports: std.ArrayList(TableImport) = .empty,
177 symbol_table: std.ArrayListUnmanaged(Symbol) = .empty,177 symbol_table: std.ArrayList(Symbol) = .empty,
178 segment_info: std.ArrayListUnmanaged(SegmentInfo) = .empty,178 segment_info: std.ArrayList(SegmentInfo) = .empty,
179 exports: std.ArrayListUnmanaged(Export) = .empty,179 exports: std.ArrayList(Export) = .empty,
180180
181 const Export = struct {181 const Export = struct {
182 name: Wasm.String,182 name: Wasm.String,
src/link/table_section.zig+2-2
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1pub fn TableSection(comptime Entry: type) type {1pub fn TableSection(comptime Entry: type) type {
2 return struct {2 return struct {
3 entries: std.ArrayListUnmanaged(Entry) = .empty,3 entries: std.ArrayList(Entry) = .empty,
4 free_list: std.ArrayListUnmanaged(Index) = .empty,4 free_list: std.ArrayList(Index) = .empty,
5 lookup: std.AutoHashMapUnmanaged(Entry, Index) = .empty,5 lookup: std.AutoHashMapUnmanaged(Entry, Index) = .empty,
66
7 pub fn deinit(self: *Self, allocator: Allocator) void {7 pub fn deinit(self: *Self, allocator: Allocator) void {
src/link/tapi/parse.zig+4-4
...@@ -103,7 +103,7 @@ pub const Node = struct {...@@ -103,7 +103,7 @@ pub const Node = struct {
103 .start = undefined,103 .start = undefined,
104 .end = undefined,104 .end = undefined,
105 },105 },
106 values: std.ArrayListUnmanaged(Entry) = .empty,106 values: std.ArrayList(Entry) = .empty,
107107
108 pub const base_tag: Node.Tag = .map;108 pub const base_tag: Node.Tag = .map;
109109
...@@ -142,7 +142,7 @@ pub const Node = struct {...@@ -142,7 +142,7 @@ pub const Node = struct {
142 .start = undefined,142 .start = undefined,
143 .end = undefined,143 .end = undefined,
144 },144 },
145 values: std.ArrayListUnmanaged(*Node) = .empty,145 values: std.ArrayList(*Node) = .empty,
146146
147 pub const base_tag: Node.Tag = .list;147 pub const base_tag: Node.Tag = .list;
148148
...@@ -169,7 +169,7 @@ pub const Node = struct {...@@ -169,7 +169,7 @@ pub const Node = struct {
169 .start = undefined,169 .start = undefined,
170 .end = undefined,170 .end = undefined,
171 },171 },
172 string_value: std.ArrayListUnmanaged(u8) = .empty,172 string_value: std.ArrayList(u8) = .empty,
173173
174 pub const base_tag: Node.Tag = .value;174 pub const base_tag: Node.Tag = .value;
175175
...@@ -194,7 +194,7 @@ pub const Tree = struct {...@@ -194,7 +194,7 @@ pub const Tree = struct {
194 source: []const u8,194 source: []const u8,
195 tokens: []Token,195 tokens: []Token,
196 line_cols: std.AutoHashMap(TokenIndex, LineCol),196 line_cols: std.AutoHashMap(TokenIndex, LineCol),
197 docs: std.ArrayListUnmanaged(*Node) = .empty,197 docs: std.ArrayList(*Node) = .empty,
198198
199 pub fn init(allocator: Allocator) Tree {199 pub fn init(allocator: Allocator) Tree {
200 return .{200 return .{
src/main.zig+29-29
...@@ -132,7 +132,7 @@ const debug_usage = normal_usage ++...@@ -132,7 +132,7 @@ const debug_usage = normal_usage ++
132132
133const usage = if (build_options.enable_debug_extensions) debug_usage else normal_usage;133const usage = if (build_options.enable_debug_extensions) debug_usage else normal_usage;
134134
135var log_scopes: std.ArrayListUnmanaged([]const u8) = .empty;135var log_scopes: std.ArrayList([]const u8) = .empty;
136136
137pub fn log(137pub fn log(
138 comptime level: std.log.Level,138 comptime level: std.log.Level,
...@@ -884,7 +884,7 @@ fn buildOutputType(...@@ -884,7 +884,7 @@ fn buildOutputType(
884 var link_emit_relocs = false;884 var link_emit_relocs = false;
885 var build_id: ?std.zig.BuildId = null;885 var build_id: ?std.zig.BuildId = null;
886 var runtime_args_start: ?usize = null;886 var runtime_args_start: ?usize = null;
887 var test_filters: std.ArrayListUnmanaged([]const u8) = .empty;887 var test_filters: std.ArrayList([]const u8) = .empty;
888 var test_runner_path: ?[]const u8 = null;888 var test_runner_path: ?[]const u8 = null;
889 var override_local_cache_dir: ?[]const u8 = try EnvVar.ZIG_LOCAL_CACHE_DIR.get(arena);889 var override_local_cache_dir: ?[]const u8 = try EnvVar.ZIG_LOCAL_CACHE_DIR.get(arena);
890 var override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena);890 var override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena);
...@@ -912,12 +912,12 @@ fn buildOutputType(...@@ -912,12 +912,12 @@ fn buildOutputType(
912 var pdb_out_path: ?[]const u8 = null;912 var pdb_out_path: ?[]const u8 = null;
913 var error_limit: ?Zcu.ErrorInt = null;913 var error_limit: ?Zcu.ErrorInt = null;
914 // These are before resolving sysroot.914 // These are before resolving sysroot.
915 var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty;915 var extra_cflags: std.ArrayList([]const u8) = .empty;
916 var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty;916 var extra_rcflags: std.ArrayList([]const u8) = .empty;
917 var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;917 var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;
918 var rc_includes: std.zig.RcIncludes = .any;918 var rc_includes: std.zig.RcIncludes = .any;
919 var manifest_file: ?[]const u8 = null;919 var manifest_file: ?[]const u8 = null;
920 var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty;920 var linker_export_symbol_names: std.ArrayList([]const u8) = .empty;
921921
922 // Tracks the position in c_source_files which have already their owner populated.922 // Tracks the position in c_source_files which have already their owner populated.
923 var c_source_files_owner_index: usize = 0;923 var c_source_files_owner_index: usize = 0;
...@@ -925,7 +925,7 @@ fn buildOutputType(...@@ -925,7 +925,7 @@ fn buildOutputType(
925 var rc_source_files_owner_index: usize = 0;925 var rc_source_files_owner_index: usize = 0;
926926
927 // null means replace with the test executable binary927 // null means replace with the test executable binary
928 var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .empty;928 var test_exec_args: std.ArrayList(?[]const u8) = .empty;
929929
930 // These get set by CLI flags and then snapshotted when a `-M` flag is930 // These get set by CLI flags and then snapshotted when a `-M` flag is
931 // encountered.931 // encountered.
...@@ -934,8 +934,8 @@ fn buildOutputType(...@@ -934,8 +934,8 @@ fn buildOutputType(
934 // These get appended to by CLI flags and then slurped when a `-M` flag934 // These get appended to by CLI flags and then slurped when a `-M` flag
935 // is encountered.935 // is encountered.
936 var cssan: ClangSearchSanitizer = .{};936 var cssan: ClangSearchSanitizer = .{};
937 var cc_argv: std.ArrayListUnmanaged([]const u8) = .empty;937 var cc_argv: std.ArrayList([]const u8) = .empty;
938 var deps: std.ArrayListUnmanaged(CliModule.Dep) = .empty;938 var deps: std.ArrayList(CliModule.Dep) = .empty;
939939
940 // Contains every module specified via -M. The dependencies are added940 // Contains every module specified via -M. The dependencies are added
941 // after argument parsing is completed. We use a StringArrayHashMap to make941 // after argument parsing is completed. We use a StringArrayHashMap to make
...@@ -3374,7 +3374,7 @@ fn buildOutputType(...@@ -3374,7 +3374,7 @@ fn buildOutputType(
33743374
3375 process.raiseFileDescriptorLimit();3375 process.raiseFileDescriptorLimit();
33763376
3377 var file_system_inputs: std.ArrayListUnmanaged(u8) = .empty;3377 var file_system_inputs: std.ArrayList(u8) = .empty;
3378 defer file_system_inputs.deinit(gpa);3378 defer file_system_inputs.deinit(gpa);
33793379
3380 // Deduplicate rpath entries3380 // Deduplicate rpath entries
...@@ -3698,29 +3698,29 @@ const CreateModule = struct {...@@ -3698,29 +3698,29 @@ const CreateModule = struct {
3698 /// directly after computing the target and used to compute link_libc,3698 /// directly after computing the target and used to compute link_libc,
3699 /// link_libcpp, and then the libraries are filtered into3699 /// link_libcpp, and then the libraries are filtered into
3700 /// `unresolved_link_inputs` and `windows_libs`.3700 /// `unresolved_link_inputs` and `windows_libs`.
3701 cli_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput),3701 cli_link_inputs: std.ArrayList(link.UnresolvedInput),
3702 windows_libs: std.StringArrayHashMapUnmanaged(void),3702 windows_libs: std.StringArrayHashMapUnmanaged(void),
3703 /// The local variable `unresolved_link_inputs` is fed into library3703 /// The local variable `unresolved_link_inputs` is fed into library
3704 /// resolution, mutating the input array, and producing this data as3704 /// resolution, mutating the input array, and producing this data as
3705 /// output. Allocated with gpa.3705 /// output. Allocated with gpa.
3706 link_inputs: std.ArrayListUnmanaged(link.Input),3706 link_inputs: std.ArrayList(link.Input),
37073707
3708 c_source_files: std.ArrayListUnmanaged(Compilation.CSourceFile),3708 c_source_files: std.ArrayList(Compilation.CSourceFile),
3709 rc_source_files: std.ArrayListUnmanaged(Compilation.RcSourceFile),3709 rc_source_files: std.ArrayList(Compilation.RcSourceFile),
37103710
3711 /// e.g. -m3dnow or -mno-outline-atomics. They correspond to std.Target llvm cpu feature names.3711 /// e.g. -m3dnow or -mno-outline-atomics. They correspond to std.Target llvm cpu feature names.
3712 /// This array is populated by zig cc frontend and then has to be converted to zig-style3712 /// This array is populated by zig cc frontend and then has to be converted to zig-style
3713 /// CPU features.3713 /// CPU features.
3714 llvm_m_args: std.ArrayListUnmanaged([]const u8),3714 llvm_m_args: std.ArrayList([]const u8),
3715 sysroot: ?[]const u8,3715 sysroot: ?[]const u8,
3716 lib_directories: std.ArrayListUnmanaged(Directory),3716 lib_directories: std.ArrayList(Directory),
3717 lib_dir_args: std.ArrayListUnmanaged([]const u8),3717 lib_dir_args: std.ArrayList([]const u8),
3718 libc_installation: ?LibCInstallation,3718 libc_installation: ?LibCInstallation,
3719 want_native_include_dirs: bool,3719 want_native_include_dirs: bool,
3720 frameworks: std.StringArrayHashMapUnmanaged(Framework),3720 frameworks: std.StringArrayHashMapUnmanaged(Framework),
3721 native_system_include_paths: []const []const u8,3721 native_system_include_paths: []const []const u8,
3722 framework_dirs: std.ArrayListUnmanaged([]const u8),3722 framework_dirs: std.ArrayList([]const u8),
3723 rpath_list: std.ArrayListUnmanaged([]const u8),3723 rpath_list: std.ArrayList([]const u8),
3724 each_lib_rpath: ?bool,3724 each_lib_rpath: ?bool,
3725 libc_paths_file: ?[]const u8,3725 libc_paths_file: ?[]const u8,
3726};3726};
...@@ -3826,7 +3826,7 @@ fn createModule(...@@ -3826,7 +3826,7 @@ fn createModule(
3826 // We need to know whether the set of system libraries contains anything besides these3826 // We need to know whether the set of system libraries contains anything besides these
3827 // to decide whether to trigger native path detection logic.3827 // to decide whether to trigger native path detection logic.
3828 // Preserves linker input order.3828 // Preserves linker input order.
3829 var unresolved_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput) = .empty;3829 var unresolved_link_inputs: std.ArrayList(link.UnresolvedInput) = .empty;
3830 defer unresolved_link_inputs.deinit(gpa);3830 defer unresolved_link_inputs.deinit(gpa);
3831 try unresolved_link_inputs.ensureUnusedCapacity(gpa, create_module.cli_link_inputs.items.len);3831 try unresolved_link_inputs.ensureUnusedCapacity(gpa, create_module.cli_link_inputs.items.len);
3832 var any_name_queries_remaining = false;3832 var any_name_queries_remaining = false;
...@@ -4215,11 +4215,11 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {...@@ -4215,11 +4215,11 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {
4215 if (comp.time_report) |*tr| {4215 if (comp.time_report) |*tr| {
4216 var decls_len: u32 = 0;4216 var decls_len: u32 = 0;
42174217
4218 var file_name_bytes: std.ArrayListUnmanaged(u8) = .empty;4218 var file_name_bytes: std.ArrayList(u8) = .empty;
4219 defer file_name_bytes.deinit(gpa);4219 defer file_name_bytes.deinit(gpa);
4220 var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty;4220 var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty;
4221 defer files.deinit(gpa);4221 defer files.deinit(gpa);
4222 var decl_data: std.ArrayListUnmanaged(u8) = .empty;4222 var decl_data: std.ArrayList(u8) = .empty;
4223 defer decl_data.deinit(gpa);4223 defer decl_data.deinit(gpa);
42244224
4225 // Each decl needs at least 34 bytes:4225 // Each decl needs at least 34 bytes:
...@@ -4546,7 +4546,7 @@ fn cmdTranslateC(...@@ -4546,7 +4546,7 @@ fn cmdTranslateC(
4546 comp: *Compilation,4546 comp: *Compilation,
4547 arena: Allocator,4547 arena: Allocator,
4548 fancy_output: ?*Compilation.CImportResult,4548 fancy_output: ?*Compilation.CImportResult,
4549 file_system_inputs: ?*std.ArrayListUnmanaged(u8),4549 file_system_inputs: ?*std.ArrayList(u8),
4550 prog_node: std.Progress.Node,4550 prog_node: std.Progress.Node,
4551) !void {4551) !void {
4552 dev.check(.translate_c_command);4552 dev.check(.translate_c_command);
...@@ -4754,7 +4754,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {...@@ -4754,7 +4754,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
4754}4754}
47554755
4756fn sanitizeExampleName(arena: Allocator, bytes: []const u8) error{OutOfMemory}![]const u8 {4756fn sanitizeExampleName(arena: Allocator, bytes: []const u8) error{OutOfMemory}![]const u8 {
4757 var result: std.ArrayListUnmanaged(u8) = .empty;4757 var result: std.ArrayList(u8) = .empty;
4758 for (bytes, 0..) |byte, i| switch (byte) {4758 for (bytes, 0..) |byte, i| switch (byte) {
4759 '0'...'9' => {4759 '0'...'9' => {
4760 if (i == 0) try result.append(arena, '_');4760 if (i == 0) try result.append(arena, '_');
...@@ -5486,7 +5486,7 @@ fn jitCmd(...@@ -5486,7 +5486,7 @@ fn jitCmd(
5486 });5486 });
5487 defer thread_pool.deinit();5487 defer thread_pool.deinit();
54885488
5489 var child_argv: std.ArrayListUnmanaged([]const u8) = .empty;5489 var child_argv: std.ArrayList([]const u8) = .empty;
5490 try child_argv.ensureUnusedCapacity(arena, args.len + 4);5490 try child_argv.ensureUnusedCapacity(arena, args.len + 4);
54915491
5492 // We want to release all the locks before executing the child process, so we make a nice5492 // We want to release all the locks before executing the child process, so we make a nice
...@@ -6687,7 +6687,7 @@ const ClangSearchSanitizer = struct {...@@ -6687,7 +6687,7 @@ const ClangSearchSanitizer = struct {
6687 fn addIncludePath(6687 fn addIncludePath(
6688 self: *@This(),6688 self: *@This(),
6689 ally: Allocator,6689 ally: Allocator,
6690 argv: *std.ArrayListUnmanaged([]const u8),6690 argv: *std.ArrayList([]const u8),
6691 group: Group,6691 group: Group,
6692 arg: []const u8,6692 arg: []const u8,
6693 dir: []const u8,6693 dir: []const u8,
...@@ -7436,10 +7436,10 @@ fn handleModArg(...@@ -7436,10 +7436,10 @@ fn handleModArg(
7436 opt_root_src_orig: ?[]const u8,7436 opt_root_src_orig: ?[]const u8,
7437 create_module: *CreateModule,7437 create_module: *CreateModule,
7438 mod_opts: *Package.Module.CreateOptions.Inherited,7438 mod_opts: *Package.Module.CreateOptions.Inherited,
7439 cc_argv: *std.ArrayListUnmanaged([]const u8),7439 cc_argv: *std.ArrayList([]const u8),
7440 target_arch_os_abi: *?[]const u8,7440 target_arch_os_abi: *?[]const u8,
7441 target_mcpu: *?[]const u8,7441 target_mcpu: *?[]const u8,
7442 deps: *std.ArrayListUnmanaged(CliModule.Dep),7442 deps: *std.ArrayList(CliModule.Dep),
7443 c_source_files_owner_index: *usize,7443 c_source_files_owner_index: *usize,
7444 rc_source_files_owner_index: *usize,7444 rc_source_files_owner_index: *usize,
7445 cssan: *ClangSearchSanitizer,7445 cssan: *ClangSearchSanitizer,
...@@ -7513,12 +7513,12 @@ fn anyObjectLinkInputs(link_inputs: []const link.UnresolvedInput) bool {...@@ -7513,12 +7513,12 @@ fn anyObjectLinkInputs(link_inputs: []const link.UnresolvedInput) bool {
7513 return false;7513 return false;
7514}7514}
75157515
7516fn addLibDirectoryWarn(lib_directories: *std.ArrayListUnmanaged(Directory), path: []const u8) void {7516fn addLibDirectoryWarn(lib_directories: *std.ArrayList(Directory), path: []const u8) void {
7517 return addLibDirectoryWarn2(lib_directories, path, false);7517 return addLibDirectoryWarn2(lib_directories, path, false);
7518}7518}
75197519
7520fn addLibDirectoryWarn2(7520fn addLibDirectoryWarn2(
7521 lib_directories: *std.ArrayListUnmanaged(Directory),7521 lib_directories: *std.ArrayList(Directory),
7522 path: []const u8,7522 path: []const u8,
7523 ignore_not_found: bool,7523 ignore_not_found: bool,
7524) void {7524) void {
src/register_manager.zig+1-1
...@@ -483,7 +483,7 @@ fn MockFunction(comptime Register: type) type {...@@ -483,7 +483,7 @@ fn MockFunction(comptime Register: type) type {
483 return struct {483 return struct {
484 allocator: Allocator,484 allocator: Allocator,
485 register_manager: Register.RM = .{},485 register_manager: Register.RM = .{},
486 spilled: std.ArrayListUnmanaged(Register) = .empty,486 spilled: std.ArrayList(Register) = .empty,
487487
488 const Self = @This();488 const Self = @This();
489489
test/behavior/fn.zig+2-2
...@@ -407,8 +407,8 @@ test "import passed byref to function in return type" {...@@ -407,8 +407,8 @@ test "import passed byref to function in return type" {
407 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO407 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
408408
409 const S = struct {409 const S = struct {
410 fn get() @import("std").ArrayListUnmanaged(i32) {410 fn get() @import("std").ArrayList(i32) {
411 const x: @import("std").ArrayListUnmanaged(i32) = .empty;411 const x: @import("std").ArrayList(i32) = .empty;
412 return x;412 return x;
413 }413 }
414 };414 };
tools/doctest.zig+2-2
...@@ -924,8 +924,8 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code {...@@ -924,8 +924,8 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code {
924924
925 var mode: std.builtin.OptimizeMode = .Debug;925 var mode: std.builtin.OptimizeMode = .Debug;
926 var link_mode: ?std.builtin.LinkMode = null;926 var link_mode: ?std.builtin.LinkMode = null;
927 var link_objects: std.ArrayListUnmanaged([]const u8) = .empty;927 var link_objects: std.ArrayList([]const u8) = .empty;
928 var additional_options: std.ArrayListUnmanaged([]const u8) = .empty;928 var additional_options: std.ArrayList([]const u8) = .empty;
929 var target_str: ?[]const u8 = null;929 var target_str: ?[]const u8 = null;
930 var link_libc = false;930 var link_libc = false;
931 var disable_cache = false;931 var disable_cache = false;
tools/incr-check.zig+11-11
...@@ -108,7 +108,7 @@ pub fn main() !void {...@@ -108,7 +108,7 @@ pub fn main() !void {
108 if (debug_log_verbose) {108 if (debug_log_verbose) {
109 std.log.scoped(.status).info("target: '{s}-{t}'", .{ target.query, target.backend });109 std.log.scoped(.status).info("target: '{s}-{t}'", .{ target.query, target.backend });
110 }110 }
111 var child_args: std.ArrayListUnmanaged([]const u8) = .empty;111 var child_args: std.ArrayList([]const u8) = .empty;
112 try child_args.appendSlice(arena, &.{112 try child_args.appendSlice(arena, &.{
113 resolved_zig_exe,113 resolved_zig_exe,
114 "build-exe",114 "build-exe",
...@@ -161,7 +161,7 @@ pub fn main() !void {...@@ -161,7 +161,7 @@ pub fn main() !void {
161 child.cwd_dir = tmp_dir;161 child.cwd_dir = tmp_dir;
162 child.cwd = tmp_dir_path;162 child.cwd = tmp_dir_path;
163163
164 var cc_child_args: std.ArrayListUnmanaged([]const u8) = .empty;164 var cc_child_args: std.ArrayList([]const u8) = .empty;
165 if (target.backend == .cbe) {165 if (target.backend == .cbe) {
166 const resolved_cc_zig_exe = if (opt_cc_zig) |cc_zig_exe|166 const resolved_cc_zig_exe = if (opt_cc_zig) |cc_zig_exe|
167 try std.fs.path.relative(arena, tmp_dir_path, cc_zig_exe)167 try std.fs.path.relative(arena, tmp_dir_path, cc_zig_exe)
...@@ -238,7 +238,7 @@ const Eval = struct {...@@ -238,7 +238,7 @@ const Eval = struct {
238 preserve_tmp_on_fatal: bool,238 preserve_tmp_on_fatal: bool,
239 /// When `target.backend == .cbe`, this contains the first few arguments to `zig cc` to build the generated binary.239 /// When `target.backend == .cbe`, this contains the first few arguments to `zig cc` to build the generated binary.
240 /// The arguments `out.c in.c` must be appended before spawning the subprocess.240 /// The arguments `out.c in.c` must be appended before spawning the subprocess.
241 cc_child_args: *std.ArrayListUnmanaged([]const u8),241 cc_child_args: *std.ArrayList([]const u8),
242242
243 const StreamEnum = enum { stdout, stderr };243 const StreamEnum = enum { stdout, stderr };
244 const Poller = Io.Poller(StreamEnum);244 const Poller = Io.Poller(StreamEnum);
...@@ -664,11 +664,11 @@ const Case = struct {...@@ -664,11 +664,11 @@ const Case = struct {
664 fn parse(arena: Allocator, io: Io, bytes: []const u8) !Case {664 fn parse(arena: Allocator, io: Io, bytes: []const u8) !Case {
665 const fatal = std.process.fatal;665 const fatal = std.process.fatal;
666666
667 var targets: std.ArrayListUnmanaged(Target) = .empty;667 var targets: std.ArrayList(Target) = .empty;
668 var modules: std.ArrayListUnmanaged(Module) = .empty;668 var modules: std.ArrayList(Module) = .empty;
669 var updates: std.ArrayListUnmanaged(Update) = .empty;669 var updates: std.ArrayList(Update) = .empty;
670 var changes: std.ArrayListUnmanaged(FullContents) = .empty;670 var changes: std.ArrayList(FullContents) = .empty;
671 var deletes: std.ArrayListUnmanaged([]const u8) = .empty;671 var deletes: std.ArrayList([]const u8) = .empty;
672 var it = std.mem.splitScalar(u8, bytes, '\n');672 var it = std.mem.splitScalar(u8, bytes, '\n');
673 var line_n: usize = 1;673 var line_n: usize = 1;
674 var root_source_file: ?[]const u8 = null;674 var root_source_file: ?[]const u8 = null;
...@@ -731,7 +731,7 @@ const Case = struct {...@@ -731,7 +731,7 @@ const Case = struct {
731731
732 // Because Windows is so excellent, we need to convert CRLF to LF, so732 // Because Windows is so excellent, we need to convert CRLF to LF, so
733 // can't just slice into the input here. How delightful!733 // can't just slice into the input here. How delightful!
734 var src: std.ArrayListUnmanaged(u8) = .empty;734 var src: std.ArrayList(u8) = .empty;
735735
736 while (true) {736 while (true) {
737 const next_line_raw = it.peek() orelse fatal("line {d}: unexpected EOF", .{line_n});737 const next_line_raw = it.peek() orelse fatal("line {d}: unexpected EOF", .{line_n});
...@@ -767,7 +767,7 @@ const Case = struct {...@@ -767,7 +767,7 @@ const Case = struct {
767 const last_update = &updates.items[updates.items.len - 1];767 const last_update = &updates.items[updates.items.len - 1];
768 if (last_update.outcome != .unknown) fatal("line {d}: conflicting expect directive", .{line_n});768 if (last_update.outcome != .unknown) fatal("line {d}: conflicting expect directive", .{line_n});
769769
770 var errors: std.ArrayListUnmanaged(ExpectedError) = .empty;770 var errors: std.ArrayList(ExpectedError) = .empty;
771 try errors.append(arena, parseExpectedError(val, line_n));771 try errors.append(arena, parseExpectedError(val, line_n));
772 while (true) {772 while (true) {
773 const next_line = it.peek() orelse break;773 const next_line = it.peek() orelse break;
...@@ -783,7 +783,7 @@ const Case = struct {...@@ -783,7 +783,7 @@ const Case = struct {
783 try errors.append(arena, parseExpectedError(new_val, line_n));783 try errors.append(arena, parseExpectedError(new_val, line_n));
784 }784 }
785785
786 var compile_log_output: std.ArrayListUnmanaged(u8) = .empty;786 var compile_log_output: std.ArrayList(u8) = .empty;
787 while (true) {787 while (true) {
788 const next_line = it.peek() orelse break;788 const next_line = it.peek() orelse break;
789 if (!std.mem.startsWith(u8, next_line, "#")) break;789 if (!std.mem.startsWith(u8, next_line, "#")) break;