diff --git a/doc/langref/test_switch_dispatch_loop.zig b/doc/langref/test_switch_dispatch_loop.zig index 1756549094..5430199edf 100644 --- a/doc/langref/test_switch_dispatch_loop.zig +++ b/doc/langref/test_switch_dispatch_loop.zig @@ -9,7 +9,7 @@ const Instruction = enum { fn evaluate(initial_stack: []const i32, code: []const Instruction) !i32 { var buffer: [8]i32 = undefined; - var stack = std.ArrayListUnmanaged(i32).initBuffer(&buffer); + var stack = std.ArrayList(i32).initBuffer(&buffer); try stack.appendSliceBounded(initial_stack); var ip: usize = 0; diff --git a/lib/build-web/fuzz.zig b/lib/build-web/fuzz.zig index 44f1434517..5fe0de2f7a 100644 --- a/lib/build-web/fuzz.zig +++ b/lib/build-web/fuzz.zig @@ -42,7 +42,7 @@ pub fn sourceIndexMessage(msg_bytes: []u8) error{OutOfMemory}!void { var coverage = Coverage.init; /// Index of type `SourceLocationIndex`. -var coverage_source_locations: std.ArrayListUnmanaged(Coverage.SourceLocation) = .empty; +var coverage_source_locations: std.ArrayList(Coverage.SourceLocation) = .empty; /// Contains the most recent coverage update message, unmodified. var recent_coverage_update: std.ArrayListAlignedUnmanaged(u8, .of(u64)) = .empty; @@ -76,7 +76,7 @@ pub fn coverageUpdateMessage(msg_bytes: []u8) error{OutOfMemory}!void { try updateCoverage(); } -var entry_points: std.ArrayListUnmanaged(SourceLocationIndex) = .empty; +var entry_points: std.ArrayList(SourceLocationIndex) = .empty; pub fn entryPointsMessage(msg_bytes: []u8) error{OutOfMemory}!void { const header: abi.fuzz.EntryPointHeader = @bitCast(msg_bytes[0..@sizeOf(abi.fuzz.EntryPointHeader)].*); @@ -127,7 +127,7 @@ const SourceLocationIndex = enum(u32) { } fn toWalkFile(sli: SourceLocationIndex) ?Walk.File.Index { - var buf: std.ArrayListUnmanaged(u8) = .empty; + var buf: std.ArrayList(u8) = .empty; defer buf.deinit(gpa); sli.appendPath(&buf) catch @panic("OOM"); return @enumFromInt(Walk.files.getIndex(buf.items) orelse return null); @@ -135,11 +135,11 @@ const SourceLocationIndex = enum(u32) { fn fileHtml( sli: SourceLocationIndex, - out: *std.ArrayListUnmanaged(u8), + out: *std.ArrayList(u8), ) error{ OutOfMemory, SourceUnavailable }!void { const walk_file_index = sli.toWalkFile() orelse return error.SourceUnavailable; const root_node = walk_file_index.findRootDecl().get().ast_node; - var annotations: std.ArrayListUnmanaged(html_render.Annotation) = .empty; + var annotations: std.ArrayList(html_render.Annotation) = .empty; defer annotations.deinit(gpa); try computeSourceAnnotations(sli.ptr().file, walk_file_index, &annotations, coverage_source_locations.items); html_render.fileSourceHtml(walk_file_index, out, root_node, .{ @@ -153,13 +153,13 @@ const SourceLocationIndex = enum(u32) { fn computeSourceAnnotations( cov_file_index: Coverage.File.Index, walk_file_index: Walk.File.Index, - annotations: *std.ArrayListUnmanaged(html_render.Annotation), + annotations: *std.ArrayList(html_render.Annotation), source_locations: []const Coverage.SourceLocation, ) !void { // Collect all the source locations from only this file into this array // first, then sort by line, col, so that we can collect annotations with // O(N) time complexity. - var locs: std.ArrayListUnmanaged(SourceLocationIndex) = .empty; + var locs: std.ArrayList(SourceLocationIndex) = .empty; defer locs.deinit(gpa); for (source_locations, 0..) |sl, sli_usize| { @@ -309,7 +309,7 @@ fn updateCoverage() error{OutOfMemory}!void { if (recent_coverage_update.items.len == 0) return; const want_file = (selected_source_location orelse return).ptr().file; - var covered: std.ArrayListUnmanaged(SourceLocationIndex) = .empty; + var covered: std.ArrayList(SourceLocationIndex) = .empty; defer covered.deinit(gpa); // This code assumes 64-bit elements, which is incorrect if the executable @@ -340,7 +340,7 @@ fn updateCoverage() error{OutOfMemory}!void { fn updateSource() error{OutOfMemory}!void { if (recent_coverage_update.items.len == 0) return; const file_sli = selected_source_location.?; - var html: std.ArrayListUnmanaged(u8) = .empty; + var html: std.ArrayList(u8) = .empty; defer html.deinit(gpa); file_sli.fileHtml(&html) catch |err| switch (err) { error.OutOfMemory => |e| return e, diff --git a/lib/build-web/time_report.zig b/lib/build-web/time_report.zig index 0c60648eaf..c19a5abcc9 100644 --- a/lib/build-web/time_report.zig +++ b/lib/build-web/time_report.zig @@ -254,7 +254,7 @@ pub fn runTestResultMessage(msg_bytes: []u8) error{OutOfMemory}!void { const durations: []align(1) const u64 = @ptrCast(trailing[0 .. hdr.tests_len * 8]); var offset: usize = hdr.tests_len * 8; - var table_html: std.ArrayListUnmanaged(u8) = .empty; + var table_html: std.ArrayList(u8) = .empty; defer table_html.deinit(gpa); for (durations) |test_ns| { diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig index 4d47c95d21..e5eb5eec67 100644 --- a/lib/compiler/build_runner.zig +++ b/lib/compiler/build_runner.zig @@ -459,7 +459,7 @@ pub fn main() !void { } if (graph.needed_lazy_dependencies.entries.len != 0) { - var buffer: std.ArrayListUnmanaged(u8) = .empty; + var buffer: std.ArrayList(u8) = .empty; for (graph.needed_lazy_dependencies.keys()) |k| { try buffer.appendSlice(arena, k); try buffer.append(arena, '\n'); @@ -672,7 +672,7 @@ const Run = struct { watch: bool, web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn, /// Allocated into `gpa`. - memory_blocked_steps: std.ArrayListUnmanaged(*Step), + memory_blocked_steps: std.ArrayList(*Step), /// Allocated into `gpa`. step_stack: std.AutoArrayHashMapUnmanaged(*Step, void), thread_pool: std.Thread.Pool, @@ -1468,7 +1468,7 @@ pub fn printErrorMessages( if (error_style.verboseContext()) { // Provide context for where these error messages are coming from by // printing the corresponding Step subtree. - var step_stack: std.ArrayListUnmanaged(*Step) = .empty; + var step_stack: std.ArrayList(*Step) = .empty; defer step_stack.deinit(gpa); try step_stack.append(gpa, failing_step); while (step_stack.items[step_stack.items.len - 1].dependants.items.len != 0) { diff --git a/lib/compiler/objcopy.zig b/lib/compiler/objcopy.zig index ee7456a87c..7cf0f14e42 100644 --- a/lib/compiler/objcopy.zig +++ b/lib/compiler/objcopy.zig @@ -381,8 +381,8 @@ const BinaryElfSegment = struct { }; const BinaryElfOutput = struct { - segments: std.ArrayListUnmanaged(*BinaryElfSegment), - sections: std.ArrayListUnmanaged(*BinaryElfSection), + segments: std.ArrayList(*BinaryElfSegment), + sections: std.ArrayList(*BinaryElfSection), allocator: Allocator, shstrtab: ?[]const u8, diff --git a/lib/compiler/reduce.zig b/lib/compiler/reduce.zig index 15e545a5ae..28305e801b 100644 --- a/lib/compiler/reduce.zig +++ b/lib/compiler/reduce.zig @@ -109,7 +109,7 @@ pub fn main() !void { const root_source_file_path = opt_root_source_file_path orelse fatal("missing root source file path argument; see -h for usage", .{}); - var interestingness_argv: std.ArrayListUnmanaged([]const u8) = .empty; + var interestingness_argv: std.ArrayList([]const u8) = .empty; try interestingness_argv.ensureUnusedCapacity(arena, argv.len + 1); interestingness_argv.appendAssumeCapacity(checker_path); interestingness_argv.appendSliceAssumeCapacity(argv); diff --git a/lib/compiler/reduce/Walk.zig b/lib/compiler/reduce/Walk.zig index 7a448fad21..1caf942fac 100644 --- a/lib/compiler/reduce/Walk.zig +++ b/lib/compiler/reduce/Walk.zig @@ -23,7 +23,7 @@ pub const Transformation = union(enum) { delete_var_decl: struct { var_decl_node: Ast.Node.Index, /// Identifier nodes that reference the variable. - references: std.ArrayListUnmanaged(Ast.Node.Index), + references: std.ArrayList(Ast.Node.Index), }, /// Replace an expression with `undefined`. replace_with_undef: Ast.Node.Index, diff --git a/lib/compiler/std-docs.zig b/lib/compiler/std-docs.zig index bad2de0ee7..12825146a2 100644 --- a/lib/compiler/std-docs.zig +++ b/lib/compiler/std-docs.zig @@ -284,7 +284,7 @@ fn buildWasmBinary( ) !Cache.Path { const gpa = context.gpa; - var argv: std.ArrayListUnmanaged([]const u8) = .empty; + var argv: std.ArrayList([]const u8) = .empty; try argv.appendSlice(arena, &.{ context.zig_exe_path, // diff --git a/lib/compiler/test_runner.zig b/lib/compiler/test_runner.zig index 054fe1eb27..682c4fda08 100644 --- a/lib/compiler/test_runner.zig +++ b/lib/compiler/test_runner.zig @@ -104,7 +104,7 @@ fn mainServer() !void { @panic("internal test runner memory leak"); }; - var string_bytes: std.ArrayListUnmanaged(u8) = .empty; + var string_bytes: std.ArrayList(u8) = .empty; defer string_bytes.deinit(testing.allocator); try string_bytes.append(testing.allocator, 0); // Reserve 0 for null. diff --git a/lib/docs/wasm/Walk.zig b/lib/docs/wasm/Walk.zig index 38652746cf..bd3051c98f 100644 --- a/lib/docs/wasm/Walk.zig +++ b/lib/docs/wasm/Walk.zig @@ -11,7 +11,7 @@ const Oom = error{OutOfMemory}; pub const Decl = @import("Decl.zig"); pub var files: std.StringArrayHashMapUnmanaged(File) = .empty; -pub var decls: std.ArrayListUnmanaged(Decl) = .empty; +pub var decls: std.ArrayList(Decl) = .empty; pub var modules: std.StringArrayHashMapUnmanaged(File.Index) = .empty; file: File.Index, diff --git a/lib/docs/wasm/markdown/Parser.zig b/lib/docs/wasm/markdown/Parser.zig index 2c9fff2ae8..a1b54e97a8 100644 --- a/lib/docs/wasm/markdown/Parser.zig +++ b/lib/docs/wasm/markdown/Parser.zig @@ -29,7 +29,7 @@ const Node = Document.Node; const ExtraIndex = Document.ExtraIndex; const ExtraData = Document.ExtraData; const StringIndex = Document.StringIndex; -const ArrayList = std.ArrayListUnmanaged; +const ArrayList = std.ArrayList; nodes: Node.List = .{}, extra: ArrayList(u32) = .empty, diff --git a/lib/fuzzer.zig b/lib/fuzzer.zig index 5c452340f6..caf1cbc6fb 100644 --- a/lib/fuzzer.zig +++ b/lib/fuzzer.zig @@ -280,10 +280,10 @@ const Instrumentation = struct { /// Values that have been constant operands in comparisons and switch cases. /// There may be duplicates in this array if they came from different addresses, which is /// fine as they are likely more important and hence more likely to be selected. - const_vals2: std.ArrayListUnmanaged(u16) = .empty, - const_vals4: std.ArrayListUnmanaged(u32) = .empty, - const_vals8: std.ArrayListUnmanaged(u64) = .empty, - const_vals16: std.ArrayListUnmanaged(u128) = .empty, + const_vals2: std.ArrayList(u16) = .empty, + const_vals4: std.ArrayList(u32) = .empty, + const_vals8: std.ArrayList(u64) = .empty, + const_vals16: std.ArrayList(u128) = .empty, /// A minimal state for this struct which instrumentation can function on. /// Used before this structure is initialized to avoid illegal behavior @@ -384,11 +384,11 @@ const Fuzzer = struct { /// Minimized past inputs leading to new pc hits. /// These are randomly mutated in round-robin fashion /// Element zero is always an empty input. It is gauraunteed no other elements are empty. - corpus: std.ArrayListUnmanaged([]const u8), + corpus: std.ArrayList([]const u8), corpus_pos: usize, /// List of past mutations that have led to new inputs. This way, the mutations that are the /// most effective are the most likely to be selected again. Starts with one of each mutation. - mutations: std.ArrayListUnmanaged(Mutation) = .empty, + mutations: std.ArrayList(Mutation) = .empty, /// Filesystem directory containing found inputs for future runs corpus_dir: std.fs.Dir, @@ -1308,7 +1308,7 @@ const Mutation = enum { } }; -/// Like `std.ArrayListUnmanaged(u8)` but backed by memory mapping. +/// Like `std.ArrayList(u8)` but backed by memory mapping. pub const MemoryMappedList = struct { /// Contents of the list. /// diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index 892ff5cd9e..263d990e6d 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -1063,10 +1063,10 @@ pub const Manifest = struct { const dep_file_contents = try dir.readFileAlloc(dep_file_sub_path, gpa, .limited(manifest_file_size_max)); defer gpa.free(dep_file_contents); - var error_buf: std.ArrayListUnmanaged(u8) = .empty; + var error_buf: std.ArrayList(u8) = .empty; defer error_buf.deinit(gpa); - var resolve_buf: std.ArrayListUnmanaged(u8) = .empty; + var resolve_buf: std.ArrayList(u8) = .empty; defer resolve_buf.deinit(gpa); var it: DepTokenizer = .{ .bytes = dep_file_contents }; @@ -1217,7 +1217,7 @@ pub const Manifest = struct { self.files.deinit(self.cache.gpa); } - pub fn populateFileSystemInputs(man: *Manifest, buf: *std.ArrayListUnmanaged(u8)) Allocator.Error!void { + pub fn populateFileSystemInputs(man: *Manifest, buf: *std.ArrayList(u8)) Allocator.Error!void { assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".fields.len == man.cache.prefixes_len); buf.clearRetainingCapacity(); const gpa = man.cache.gpa; diff --git a/lib/std/Build/Cache/DepTokenizer.zig b/lib/std/Build/Cache/DepTokenizer.zig index 8221f92dba..4fe61603c8 100644 --- a/lib/std/Build/Cache/DepTokenizer.zig +++ b/lib/std/Build/Cache/DepTokenizer.zig @@ -363,7 +363,7 @@ pub const Token = union(enum) { }; /// Resolve escapes in target or prereq. Only valid with .target_must_resolve or .prereq_must_resolve. - pub fn resolve(self: Token, gpa: Allocator, list: *std.ArrayListUnmanaged(u8)) error{OutOfMemory}!void { + pub fn resolve(self: Token, gpa: Allocator, list: *std.ArrayList(u8)) error{OutOfMemory}!void { switch (self) { .target_must_resolve => |bytes| { var state: enum { start, escape, dollar } = .start; @@ -429,7 +429,7 @@ pub const Token = union(enum) { } } - pub fn printError(self: Token, gpa: Allocator, list: *std.ArrayListUnmanaged(u8)) error{OutOfMemory}!void { + pub fn printError(self: Token, gpa: Allocator, list: *std.ArrayList(u8)) error{OutOfMemory}!void { switch (self) { .target, .target_must_resolve, .prereq, .prereq_must_resolve => unreachable, // not an error .incomplete_quoted_prerequisite, @@ -1027,8 +1027,8 @@ fn depTokenizer(input: []const u8, expect: []const u8) !void { defer arena_allocator.deinit(); var it: Tokenizer = .{ .bytes = input }; - var buffer: std.ArrayListUnmanaged(u8) = .empty; - var resolve_buf: std.ArrayListUnmanaged(u8) = .empty; + var buffer: std.ArrayList(u8) = .empty; + var resolve_buf: std.ArrayList(u8) = .empty; var i: usize = 0; while (it.next()) |token| { if (i != 0) try buffer.appendSlice(arena, "\n"); @@ -1076,11 +1076,11 @@ fn depTokenizer(input: []const u8, expect: []const u8) !void { try testing.expectEqualStrings(expect, buffer.items); } -fn printCharValues(gpa: Allocator, list: *std.ArrayListUnmanaged(u8), bytes: []const u8) !void { +fn printCharValues(gpa: Allocator, list: *std.ArrayList(u8), bytes: []const u8) !void { for (bytes) |b| try list.append(gpa, printable_char_tab[b]); } -fn printUnderstandableChar(gpa: Allocator, list: *std.ArrayListUnmanaged(u8), char: u8) !void { +fn printUnderstandableChar(gpa: Allocator, list: *std.ArrayList(u8), char: u8) !void { if (std.ascii.isPrint(char)) { try list.print(gpa, "'{c}'", .{char}); } else { diff --git a/lib/std/Build/Fuzz.zig b/lib/std/Build/Fuzz.zig index 7a22522d6b..37af72a6de 100644 --- a/lib/std/Build/Fuzz.zig +++ b/lib/std/Build/Fuzz.zig @@ -33,7 +33,7 @@ coverage_files: std.AutoArrayHashMapUnmanaged(u64, CoverageMap), queue_mutex: std.Thread.Mutex, queue_cond: std.Thread.Condition, -msg_queue: std.ArrayListUnmanaged(Msg), +msg_queue: std.ArrayList(Msg), pub const Mode = union(enum) { forever: struct { ws: *Build.WebServer }, @@ -65,7 +65,7 @@ const CoverageMap = struct { coverage: Coverage, source_locations: []Coverage.SourceLocation, /// Elements are indexes into `source_locations` pointing to the unit tests that are being fuzz tested. - entry_points: std.ArrayListUnmanaged(u32), + entry_points: std.ArrayList(u32), start_timestamp: i64, fn deinit(cm: *CoverageMap, gpa: Allocator) void { @@ -85,7 +85,7 @@ pub fn init( mode: Mode, ) Allocator.Error!Fuzz { const run_steps: []const *Step.Run = steps: { - var steps: std.ArrayListUnmanaged(*Step.Run) = .empty; + var steps: std.ArrayList(*Step.Run) = .empty; defer steps.deinit(gpa); const rebuild_node = root_prog_node.start("Rebuilding Unit Tests", 0); defer rebuild_node.end(); diff --git a/lib/std/Build/Step/CheckObject.zig b/lib/std/Build/Step/CheckObject.zig index ab10d368b2..4d5071d2c7 100644 --- a/lib/std/Build/Step/CheckObject.zig +++ b/lib/std/Build/Step/CheckObject.zig @@ -721,12 +721,12 @@ const MachODumper = struct { gpa: Allocator, data: []const u8, header: macho.mach_header_64, - segments: std.ArrayListUnmanaged(macho.segment_command_64) = .empty, - sections: std.ArrayListUnmanaged(macho.section_64) = .empty, - symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty, - strtab: std.ArrayListUnmanaged(u8) = .empty, - indsymtab: std.ArrayListUnmanaged(u32) = .empty, - imports: std.ArrayListUnmanaged([]const u8) = .empty, + segments: std.ArrayList(macho.segment_command_64) = .empty, + sections: std.ArrayList(macho.section_64) = .empty, + symtab: std.ArrayList(macho.nlist_64) = .empty, + strtab: std.ArrayList(u8) = .empty, + indsymtab: std.ArrayList(u32) = .empty, + imports: std.ArrayList([]const u8) = .empty, fn parse(ctx: *ObjectContext) !void { var it = try ctx.getLoadCommandIterator(); @@ -1767,9 +1767,9 @@ const ElfDumper = struct { const ArchiveContext = struct { gpa: Allocator, data: []const u8, - symtab: std.ArrayListUnmanaged(ArSymtabEntry) = .empty, + symtab: std.ArrayList(ArSymtabEntry) = .empty, strtab: []const u8, - objects: std.ArrayListUnmanaged(struct { name: []const u8, off: usize, len: usize }) = .empty, + objects: std.ArrayList(struct { name: []const u8, off: usize, len: usize }) = .empty, fn parseSymtab(ctx: *ArchiveContext, raw: []const u8, ptr_width: enum { p32, p64 }) !void { var reader: std.Io.Reader = .fixed(raw); diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 4ea09538c2..4f9900ab59 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -1801,7 +1801,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { for (arg, 0..) |c, arg_idx| { if (c == '\\' or c == '"') { // Slow path for arguments that need to be escaped. We'll need to allocate and copy - var escaped: std.ArrayListUnmanaged(u8) = .empty; + var escaped: std.ArrayList(u8) = .empty; try escaped.ensureTotalCapacityPrecise(arena, arg.len + 1); try escaped.appendSlice(arena, arg[0..arg_idx]); for (arg[arg_idx..]) |to_escape| { @@ -2035,7 +2035,7 @@ fn checkCompileErrors(compile: *Compile) !void { }; // Render the expected lines into a string that we can compare verbatim. - var expected_generated: std.ArrayListUnmanaged(u8) = .empty; + var expected_generated: std.ArrayList(u8) = .empty; const expect_errors = compile.expect_errors.?; var actual_line_it = mem.splitScalar(u8, actual_errors, '\n'); diff --git a/lib/std/Build/Step/Fmt.zig b/lib/std/Build/Step/Fmt.zig index 5adebdc454..ff748af979 100644 --- a/lib/std/Build/Step/Fmt.zig +++ b/lib/std/Build/Step/Fmt.zig @@ -48,7 +48,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void { const arena = b.allocator; const fmt: *Fmt = @fieldParentPtr("step", step); - var argv: std.ArrayListUnmanaged([]const u8) = .empty; + var argv: std.ArrayList([]const u8) = .empty; try argv.ensureUnusedCapacity(arena, 2 + 1 + fmt.paths.len + 2 * fmt.exclude_paths.len); argv.appendAssumeCapacity(b.graph.zig_exe); diff --git a/lib/std/Build/Step/ObjCopy.zig b/lib/std/Build/Step/ObjCopy.zig index 5468c6ecaa..b5f058ddfc 100644 --- a/lib/std/Build/Step/ObjCopy.zig +++ b/lib/std/Build/Step/ObjCopy.zig @@ -3,7 +3,6 @@ const ObjCopy = @This(); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; -const ArrayListUnmanaged = std.ArrayListUnmanaged; const File = std.fs.File; const InstallDir = std.Build.InstallDir; const Step = std.Build.Step; diff --git a/lib/std/Build/Step/Options.zig b/lib/std/Build/Step/Options.zig index 8590fa9608..845f21b46a 100644 --- a/lib/std/Build/Step/Options.zig +++ b/lib/std/Build/Step/Options.zig @@ -12,8 +12,8 @@ pub const base_id: Step.Id = .options; step: Step, generated_file: GeneratedFile, -contents: std.ArrayListUnmanaged(u8), -args: std.ArrayListUnmanaged(Arg), +contents: std.ArrayList(u8), +args: std.ArrayList(Arg), encountered_types: std.StringHashMapUnmanaged(void), pub fn create(owner: *std.Build) *Options { @@ -45,7 +45,7 @@ fn addOptionFallible(options: *Options, comptime T: type, name: []const u8, valu fn printType( options: *Options, - out: *std.ArrayListUnmanaged(u8), + out: *std.ArrayList(u8), comptime T: type, value: T, indent: u8, @@ -267,7 +267,7 @@ fn printType( } } -fn printUserDefinedType(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T: type, indent: u8) !void { +fn printUserDefinedType(options: *Options, out: *std.ArrayList(u8), comptime T: type, indent: u8) !void { switch (@typeInfo(T)) { .@"enum" => |info| { return try printEnum(options, out, T, info, indent); @@ -281,7 +281,7 @@ fn printUserDefinedType(options: *Options, out: *std.ArrayListUnmanaged(u8), com fn printEnum( options: *Options, - out: *std.ArrayListUnmanaged(u8), + out: *std.ArrayList(u8), comptime T: type, comptime val: std.builtin.Type.Enum, indent: u8, @@ -309,7 +309,7 @@ fn printEnum( try out.appendSlice(gpa, "};\n"); } -fn printStruct(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T: type, comptime val: std.builtin.Type.Struct, indent: u8) !void { +fn printStruct(options: *Options, out: *std.ArrayList(u8), comptime T: type, comptime val: std.builtin.Type.Struct, indent: u8) !void { const gpa = options.step.owner.allocator; const gop = try options.encountered_types.getOrPut(gpa, @typeName(T)); if (gop.found_existing) return; @@ -369,7 +369,7 @@ fn printStruct(options: *Options, out: *std.ArrayListUnmanaged(u8), comptime T: fn printStructValue( options: *Options, - out: *std.ArrayListUnmanaged(u8), + out: *std.ArrayList(u8), comptime struct_val: std.builtin.Type.Struct, val: anytype, indent: u8, diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig index dfae77ffb5..12e4e936f4 100644 --- a/lib/std/Build/Step/Run.zig +++ b/lib/std/Build/Step/Run.zig @@ -16,7 +16,7 @@ pub const base_id: Step.Id = .run; step: Step, /// See also addArg and addArgs to modifying this directly -argv: std.ArrayListUnmanaged(Arg), +argv: std.ArrayList(Arg), /// Use `setCwd` to set the initial current working directory cwd: ?Build.LazyPath, @@ -63,7 +63,7 @@ stdin: StdIn, /// If the Run step is determined to have side-effects, the Run step is always /// executed when it appears in the build graph, regardless of whether these /// files have been modified. -file_inputs: std.ArrayListUnmanaged(std.Build.LazyPath), +file_inputs: std.ArrayList(std.Build.LazyPath), /// After adding an output argument, this step will by default rename itself /// for a better display name in the build summary. @@ -104,7 +104,7 @@ has_side_effects: bool, /// If this is a Zig unit test binary, this tracks the indexes of the unit /// tests that are also fuzz tests. -fuzz_tests: std.ArrayListUnmanaged(u32), +fuzz_tests: std.ArrayList(u32), cached_test_metadata: ?CachedTestMetadata = null, /// Populated during the fuzz phase if this run step corresponds to a unit test @@ -139,7 +139,7 @@ pub const StdIo = union(enum) { /// conditions. /// Note that an explicit check for exit code 0 needs to be added to this /// list if such a check is desirable. - check: std.ArrayListUnmanaged(Check), + check: std.ArrayList(Check), /// This Run step is running a zig unit test binary and will communicate /// extra metadata over the IPC protocol. zig_test, diff --git a/lib/std/Build/Step/UpdateSourceFiles.zig b/lib/std/Build/Step/UpdateSourceFiles.zig index 6f1559bd68..7cdb521d21 100644 --- a/lib/std/Build/Step/UpdateSourceFiles.zig +++ b/lib/std/Build/Step/UpdateSourceFiles.zig @@ -12,7 +12,7 @@ const fs = std.fs; const ArrayList = std.ArrayList; step: Step, -output_source_files: std.ArrayListUnmanaged(OutputSourceFile), +output_source_files: std.ArrayList(OutputSourceFile), pub const base_id: Step.Id = .update_source_files; diff --git a/lib/std/Build/Step/WriteFile.zig b/lib/std/Build/Step/WriteFile.zig index 1a531604e3..030c7c6811 100644 --- a/lib/std/Build/Step/WriteFile.zig +++ b/lib/std/Build/Step/WriteFile.zig @@ -11,8 +11,8 @@ const WriteFile = @This(); step: Step, // The elements here are pointers because we need stable pointers for the GeneratedFile field. -files: std.ArrayListUnmanaged(File), -directories: std.ArrayListUnmanaged(Directory), +files: std.ArrayList(File), +directories: std.ArrayList(Directory), generated_directory: std.Build.GeneratedFile, pub const base_id: Step.Id = .write_file; diff --git a/lib/std/Build/WebServer.zig b/lib/std/Build/WebServer.zig index 4a136ccbf4..ec15ab1dba 100644 --- a/lib/std/Build/WebServer.zig +++ b/lib/std/Build/WebServer.zig @@ -549,7 +549,7 @@ fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.Optim .sub_path = "docs/wasm/html_render.zig", }; - var argv: std.ArrayListUnmanaged([]const u8) = .empty; + var argv: std.ArrayList([]const u8) = .empty; try argv.appendSlice(arena, &.{ graph.zig_exe, "build-exe", // diff --git a/lib/std/Io.zig b/lib/std/Io.zig index 937b0aeaef..40f213f3de 100644 --- a/lib/std/Io.zig +++ b/lib/std/Io.zig @@ -361,7 +361,7 @@ pub fn Poller(comptime StreamEnum: type) type { r.end = data.len; } { - var list: std.ArrayListUnmanaged(u8) = .{ + var list: std.ArrayList(u8) = .{ .items = r.buffer[0..r.end], .capacity = r.buffer.len, }; diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 880de381a0..665e006e8a 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -22,7 +22,7 @@ mutex: std.Thread.Mutex = .{}, cond: std.Thread.Condition = .{}, run_queue: std.SinglyLinkedList = .{}, join_requested: bool = false, -threads: std.ArrayListUnmanaged(std.Thread), +threads: std.ArrayList(std.Thread), stack_size: usize, cpu_count: std.Thread.CpuCountError!usize, concurrent_count: usize, diff --git a/lib/std/array_hash_map.zig b/lib/std/array_hash_map.zig index 2550e0aebe..838faf26a1 100644 --- a/lib/std/array_hash_map.zig +++ b/lib/std/array_hash_map.zig @@ -505,7 +505,7 @@ pub fn ArrayHashMapWithAllocator( /// A hash table of keys and values, each stored sequentially. /// /// Insertion order is preserved. In general, this data structure supports the same -/// operations as `std.ArrayListUnmanaged`. +/// operations as `std.ArrayList`. /// /// Deletion operations: /// * `swapRemove` - O(1) diff --git a/lib/std/crypto/Certificate/Bundle.zig b/lib/std/crypto/Certificate/Bundle.zig index d7f6537c4a..c9c0b92397 100644 --- a/lib/std/crypto/Certificate/Bundle.zig +++ b/lib/std/crypto/Certificate/Bundle.zig @@ -21,7 +21,7 @@ const base64 = std.base64.standard.decoderWithIgnore(" \t\r\n"); /// The key is the contents slice of the subject. map: std.HashMapUnmanaged(der.Element.Slice, u32, MapContext, std.hash_map.default_max_load_percentage) = .empty, -bytes: std.ArrayListUnmanaged(u8) = .empty, +bytes: std.ArrayList(u8) = .empty, pub const VerifyError = Certificate.Parsed.VerifyError || error{ CertificateIssuerNotFound, diff --git a/lib/std/debug/Coverage.zig b/lib/std/debug/Coverage.zig index f1621c0e12..749b992a02 100644 --- a/lib/std/debug/Coverage.zig +++ b/lib/std/debug/Coverage.zig @@ -21,7 +21,7 @@ directories: std.ArrayHashMapUnmanaged(String, void, String.MapContext, false), /// /// Protected by `mutex`. files: std.ArrayHashMapUnmanaged(File, void, File.MapContext, false), -string_bytes: std.ArrayListUnmanaged(u8), +string_bytes: std.ArrayList(u8), /// Protects the other fields. mutex: std.Thread.Mutex, diff --git a/lib/std/debug/Dwarf/expression.zig b/lib/std/debug/Dwarf/expression.zig index 62659ec089..626af96d4a 100644 --- a/lib/std/debug/Dwarf/expression.zig +++ b/lib/std/debug/Dwarf/expression.zig @@ -158,7 +158,7 @@ pub fn StackMachine(comptime options: Options) type { } }; - stack: std.ArrayListUnmanaged(Value) = .empty, + stack: std.ArrayList(Value) = .empty, pub fn reset(self: *Self) void { self.stack.clearRetainingCapacity(); diff --git a/lib/std/debug/SelfInfo/Windows.zig b/lib/std/debug/SelfInfo/Windows.zig index 306287a9e7..03fc7e2811 100644 --- a/lib/std/debug/SelfInfo/Windows.zig +++ b/lib/std/debug/SelfInfo/Windows.zig @@ -1,5 +1,5 @@ mutex: std.Thread.Mutex, -modules: std.ArrayListUnmanaged(Module), +modules: std.ArrayList(Module), module_name_arena: std.heap.ArenaAllocator.State, pub const init: SelfInfo = .{ diff --git a/lib/std/fs/Dir.zig b/lib/std/fs/Dir.zig index 73a24c873b..1eea1e6a9d 100644 --- a/lib/std/fs/Dir.zig +++ b/lib/std/fs/Dir.zig @@ -667,8 +667,8 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator { } pub const SelectiveWalker = struct { - stack: std.ArrayListUnmanaged(Walker.StackItem), - name_buffer: std.ArrayListUnmanaged(u8), + stack: std.ArrayList(Walker.StackItem), + name_buffer: std.ArrayList(u8), allocator: Allocator, pub const Error = IteratorError || Allocator.Error; @@ -767,7 +767,7 @@ pub const SelectiveWalker = struct { /// /// See also `walk`. pub fn walkSelectively(self: Dir, allocator: Allocator) !SelectiveWalker { - var stack: std.ArrayListUnmanaged(Walker.StackItem) = .empty; + var stack: std.ArrayList(Walker.StackItem) = .empty; try stack.append(allocator, .{ .iter = self.iterate(), @@ -1521,7 +1521,7 @@ pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void { }; var stack_buffer: [16]StackItem = undefined; - var stack = std.ArrayListUnmanaged(StackItem).initBuffer(&stack_buffer); + var stack = std.ArrayList(StackItem).initBuffer(&stack_buffer); defer StackItem.closeAll(stack.items); stack.appendAssumeCapacity(.{ diff --git a/lib/std/fs/wasi.zig b/lib/std/fs/wasi.zig index 5d729c9da1..e17a852a9b 100644 --- a/lib/std/fs/wasi.zig +++ b/lib/std/fs/wasi.zig @@ -24,7 +24,7 @@ pub const Preopens = struct { }; pub fn preopensAlloc(gpa: Allocator) Allocator.Error!Preopens { - var names: std.ArrayListUnmanaged([]const u8) = .empty; + var names: std.ArrayList([]const u8) = .empty; defer names.deinit(gpa); try names.ensureUnusedCapacity(gpa, 3); diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 83d4b5fae3..c8e2c70a1a 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -91,7 +91,7 @@ pub fn hashString(s: []const u8) u64 { } pub const StringIndexContext = struct { - bytes: *const std.ArrayListUnmanaged(u8), + bytes: *const std.ArrayList(u8), pub fn eql(_: @This(), a: u32, b: u32) bool { return a == b; @@ -103,7 +103,7 @@ pub const StringIndexContext = struct { }; pub const StringIndexAdapter = struct { - bytes: *const std.ArrayListUnmanaged(u8), + bytes: *const std.ArrayList(u8), pub fn eql(ctx: @This(), a: []const u8, b: u32) bool { return mem.eql(u8, a, mem.sliceTo(ctx.bytes.items[b..], 0)); diff --git a/lib/std/tar.zig b/lib/std/tar.zig index 12f9c837a2..0fe314301a 100644 --- a/lib/std/tar.zig +++ b/lib/std/tar.zig @@ -27,7 +27,7 @@ pub const Writer = @import("tar/Writer.zig"); /// the errors in diagnostics to know whether the operation succeeded or failed. pub const Diagnostics = struct { allocator: std.mem.Allocator, - errors: std.ArrayListUnmanaged(Error) = .empty, + errors: std.ArrayList(Error) = .empty, entries: usize = 0, root_dir: []const u8 = "", diff --git a/lib/std/zig/AstGen.zig b/lib/std/zig/AstGen.zig index 614e3fb917..c7d7f24938 100644 --- a/lib/std/zig/AstGen.zig +++ b/lib/std/zig/AstGen.zig @@ -6,7 +6,7 @@ const Ast = std.zig.Ast; const mem = std.mem; const Allocator = std.mem.Allocator; const assert = std.debug.assert; -const ArrayListUnmanaged = std.ArrayListUnmanaged; +const ArrayList = std.ArrayList; const StringIndexAdapter = std.hash_map.StringIndexAdapter; const StringIndexContext = std.hash_map.StringIndexContext; @@ -22,8 +22,8 @@ tree: *const Ast, /// sub-expressions. See `AstRlAnnotate` for details. nodes_need_rl: *const AstRlAnnotate.RlNeededSet, instructions: std.MultiArrayList(Zir.Inst) = .{}, -extra: ArrayListUnmanaged(u32) = .empty, -string_bytes: ArrayListUnmanaged(u8) = .empty, +extra: ArrayList(u32) = .empty, +string_bytes: ArrayList(u8) = .empty, /// Tracks the current byte offset within the source file. /// Used to populate line deltas in the ZIR. AstGen maintains /// this "cursor" throughout the entire AST lowering process in order @@ -40,7 +40,7 @@ source_column: u32 = 0, /// The resulting ZIR code has no references to anything in this arena. arena: Allocator, string_table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty, -compile_errors: ArrayListUnmanaged(Zir.Inst.CompileErrors.Item) = .empty, +compile_errors: ArrayList(Zir.Inst.CompileErrors.Item) = .empty, /// The topmost block of the current function. fn_block: ?*GenZir = null, fn_var_args: bool = false, @@ -54,7 +54,7 @@ fn_ret_ty: Zir.Inst.Ref = .none, /// that uses this string as the operand. imports: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, Ast.TokenIndex) = .empty, /// Used for temporary storage when building payloads. -scratch: std.ArrayListUnmanaged(u32) = .empty, +scratch: std.ArrayList(u32) = .empty, /// Whenever a `ref` instruction is needed, it is created and saved in this /// table instead of being immediately appended to the current block body. /// 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 { var top_scope: Scope.Top = .{}; - var gz_instructions: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty; + var gz_instructions: std.ArrayList(Zir.Inst.Index) = .empty; var gen_scope: GenZir = .{ .is_comptime = true, .parent = &top_scope.base, @@ -1766,7 +1766,7 @@ fn structInitExpr( var sfba = std.heap.stackFallback(256, astgen.arena); const sfba_allocator = sfba.get(); - var duplicate_names = std.AutoArrayHashMap(Zir.NullTerminatedString, ArrayListUnmanaged(Ast.TokenIndex)).init(sfba_allocator); + var duplicate_names = std.AutoArrayHashMap(Zir.NullTerminatedString, ArrayList(Ast.TokenIndex)).init(sfba_allocator); try duplicate_names.ensureTotalCapacity(@intCast(struct_init.ast.fields.len)); // 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. } const WipMembers = struct { - payload: *ArrayListUnmanaged(u32), + payload: *ArrayList(u32), payload_top: usize, field_bits_start: u32, fields_start: u32, @@ -4006,7 +4006,7 @@ const WipMembers = struct { const Self = @This(); - 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 { + 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 { const payload_top: u32 = @intCast(payload.items.len); const field_bits_start = payload_top + decl_count; const fields_start = field_bits_start + if (bits_per_field > 0) blk: { @@ -4260,7 +4260,7 @@ fn fnDeclInner( const is_inferred_error = tree.tokenTag(maybe_bang) == .bang; // Note that the capacity here may not be sufficient, as this does not include `anytype` parameters. - var param_insts: std.ArrayListUnmanaged(Zir.Inst.Index) = try .initCapacity(astgen.arena, fn_proto.ast.params.len); + var param_insts: std.ArrayList(Zir.Inst.Index) = try .initCapacity(astgen.arena, fn_proto.ast.params.len); // We use this as `is_used_or_discarded` to figure out if parameters / return types are generic. var any_param_used = false; @@ -11311,7 +11311,7 @@ fn identifierTokenString(astgen: *AstGen, token: Ast.TokenIndex) InnerError![]co if (!mem.startsWith(u8, ident_name, "@")) { return ident_name; } - var buf: ArrayListUnmanaged(u8) = .empty; + var buf: ArrayList(u8) = .empty; defer buf.deinit(astgen.gpa); try astgen.parseStrLit(token, &buf, ident_name, 1); if (mem.indexOfScalar(u8, buf.items, 0) != null) { @@ -11329,7 +11329,7 @@ fn identifierTokenString(astgen: *AstGen, token: Ast.TokenIndex) InnerError![]co fn appendIdentStr( astgen: *AstGen, token: Ast.TokenIndex, - buf: *ArrayListUnmanaged(u8), + buf: *ArrayList(u8), ) InnerError!void { const tree = astgen.tree; assert(tree.tokenTag(token) == .identifier); @@ -11352,7 +11352,7 @@ fn appendIdentStr( fn parseStrLit( astgen: *AstGen, token: Ast.TokenIndex, - buf: *ArrayListUnmanaged(u8), + buf: *ArrayList(u8), bytes: []const u8, offset: u32, ) InnerError!void { @@ -11833,7 +11833,7 @@ const GenZir = struct { astgen: *AstGen, /// Keeps track of the list of instructions in this scope. Possibly shared. /// Indexes to instructions in `astgen`. - instructions: *ArrayListUnmanaged(Zir.Inst.Index), + instructions: *ArrayList(Zir.Inst.Index), /// A sub-block may share its instructions ArrayList with containing GenZir, /// if use is strictly nested. This saves prior size of list for unstacking. instructions_top: usize, @@ -13641,7 +13641,7 @@ fn scanContainer( for (names.keys(), names.values()) |name, first| { if (first.next == null) continue; - var notes: std.ArrayListUnmanaged(u32) = .empty; + var notes: std.ArrayList(u32) = .empty; var prev: NameEntry = first; while (prev.next) |cur| : (prev = cur.*) { try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate name here", .{})); @@ -13654,7 +13654,7 @@ fn scanContainer( for (test_names.keys(), test_names.values()) |name, first| { if (first.next == null) continue; - var notes: std.ArrayListUnmanaged(u32) = .empty; + var notes: std.ArrayList(u32) = .empty; var prev: NameEntry = first; while (prev.next) |cur| : (prev = cur.*) { try notes.append(astgen.arena, try astgen.errNoteTok(cur.tok, "duplicate test here", .{})); @@ -13667,7 +13667,7 @@ fn scanContainer( for (decltest_names.keys(), decltest_names.values()) |name, first| { if (first.next == null) continue; - var notes: std.ArrayListUnmanaged(u32) = .empty; + var notes: std.ArrayList(u32) = .empty; var prev: NameEntry = first; while (prev.next) |cur| : (prev = cur.*) { 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 { fn appendBodyWithFixupsArrayList( astgen: *AstGen, - list: *std.ArrayListUnmanaged(u32), + list: *std.ArrayList(u32), body: []const Zir.Inst.Index, ) void { astgen.appendBodyWithFixupsExtraRefsArrayList(list, body, &.{}); @@ -13698,7 +13698,7 @@ fn appendBodyWithFixupsArrayList( fn appendBodyWithFixupsExtraRefsArrayList( astgen: *AstGen, - list: *std.ArrayListUnmanaged(u32), + list: *std.ArrayList(u32), body: []const Zir.Inst.Index, extra_refs: []const Zir.Inst.Index, ) void { @@ -13714,7 +13714,7 @@ fn appendBodyWithFixupsExtraRefsArrayList( fn appendPossiblyRefdBodyInst( astgen: *AstGen, - list: *std.ArrayListUnmanaged(u32), + list: *std.ArrayList(u32), body_inst: Zir.Inst.Index, ) void { list.appendAssumeCapacity(@intFromEnum(body_inst)); @@ -13808,7 +13808,7 @@ fn lowerAstErrors(astgen: *AstGen) error{OutOfMemory}!void { defer msg.deinit(); const msg_w = &msg.writer; - var notes: std.ArrayListUnmanaged(u32) = .empty; + var notes: std.ArrayList(u32) = .empty; defer notes.deinit(gpa); const token_starts = tree.tokens.items(.start); @@ -14104,7 +14104,7 @@ fn setDeclaration( /// *all* of the bodies into a big `GenZir` stack. Therefore, we use this function to pull out these per-body `ref` /// instructions which must be emitted. fn fetchRemoveRefEntries(astgen: *AstGen, param_insts: []const Zir.Inst.Index) ![]Zir.Inst.Index { - var refs: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty; + var refs: std.ArrayList(Zir.Inst.Index) = .empty; for (param_insts) |param_inst| { if (astgen.ref_table.fetchRemove(param_inst)) |kv| { try refs.append(astgen.arena, kv.value); diff --git a/lib/std/zig/ErrorBundle.zig b/lib/std/zig/ErrorBundle.zig index bcef7f407c..ef6203cbe8 100644 --- a/lib/std/zig/ErrorBundle.zig +++ b/lib/std/zig/ErrorBundle.zig @@ -320,10 +320,10 @@ fn writeMsg(eb: ErrorBundle, err_msg: ErrorMessage, w: *Writer, indent: usize) ! pub const Wip = struct { gpa: Allocator, - string_bytes: std.ArrayListUnmanaged(u8), + string_bytes: std.ArrayList(u8), /// The first thing in this array is a ErrorMessageList. - extra: std.ArrayListUnmanaged(u32), - root_list: std.ArrayListUnmanaged(MessageIndex), + extra: std.ArrayList(u32), + root_list: std.ArrayList(MessageIndex), pub fn init(wip: *Wip, gpa: Allocator) !void { wip.* = .{ @@ -666,7 +666,7 @@ pub const Wip = struct { if (index == .none) return .none; const other_sl = other.getSourceLocation(index); - var ref_traces: std.ArrayListUnmanaged(ReferenceTrace) = .empty; + var ref_traces: std.ArrayList(ReferenceTrace) = .empty; defer ref_traces.deinit(wip.gpa); if (other_sl.reference_trace_len > 0) { diff --git a/lib/std/zig/Parse.zig b/lib/std/zig/Parse.zig index 47834681c1..4d8c710816 100644 --- a/lib/std/zig/Parse.zig +++ b/lib/std/zig/Parse.zig @@ -6,10 +6,10 @@ gpa: Allocator, source: []const u8, tokens: Ast.TokenList.Slice, tok_i: TokenIndex, -errors: std.ArrayListUnmanaged(AstError), +errors: std.ArrayList(AstError), nodes: Ast.NodeList, -extra_data: std.ArrayListUnmanaged(u32), -scratch: std.ArrayListUnmanaged(Node.Index), +extra_data: std.ArrayList(u32), +scratch: std.ArrayList(Node.Index), fn tokenTag(p: *const Parse, token_index: TokenIndex) Token.Tag { return p.tokens.items(.tag)[token_index]; diff --git a/lib/std/zig/WindowsSdk.zig b/lib/std/zig/WindowsSdk.zig index 0d74174bcc..6353c9b1e6 100644 --- a/lib/std/zig/WindowsSdk.zig +++ b/lib/std/zig/WindowsSdk.zig @@ -752,7 +752,7 @@ const MsvcLibDir = struct { defer instances_dir.close(); var state_subpath_buf: [std.fs.max_name_bytes + 32]u8 = undefined; - var latest_version_lib_dir: std.ArrayListUnmanaged(u8) = .empty; + var latest_version_lib_dir: std.ArrayList(u8) = .empty; errdefer latest_version_lib_dir.deinit(allocator); var latest_version: u64 = 0; diff --git a/lib/std/zig/Zir.zig b/lib/std/zig/Zir.zig index 0bed0f4246..7a1069fe7d 100644 --- a/lib/std/zig/Zir.zig +++ b/lib/std/zig/Zir.zig @@ -4093,8 +4093,8 @@ pub const DeclContents = struct { /// This is a simple optional because ZIR guarantees that a `func`/`func_inferred`/`func_fancy` instruction /// can only occur once per `declaration`. func_decl: ?Inst.Index, - explicit_types: std.ArrayListUnmanaged(Inst.Index), - other: std.ArrayListUnmanaged(Inst.Index), + explicit_types: std.ArrayList(Inst.Index), + other: std.ArrayList(Inst.Index), pub const init: DeclContents = .{ .func_decl = null, @@ -4118,7 +4118,7 @@ pub const DeclContents = struct { /// nested declarations; to find all declarations, call this function recursively on the type declarations discovered /// in `contents.explicit_types`. /// -/// This populates an `ArrayListUnmanaged` because an iterator would need to allocate memory anyway. +/// This populates an `ArrayList` because an iterator would need to allocate memory anyway. pub fn findTrackable(zir: Zir, gpa: Allocator, contents: *DeclContents, decl_inst: Zir.Inst.Index) !void { contents.clear(); diff --git a/lib/std/zig/ZonGen.zig b/lib/std/zig/ZonGen.zig index 4bb299a5e9..0137f84911 100644 --- a/lib/std/zig/ZonGen.zig +++ b/lib/std/zig/ZonGen.zig @@ -17,13 +17,13 @@ tree: Ast, options: Options, nodes: std.MultiArrayList(Zoir.Node.Repr), -extra: std.ArrayListUnmanaged(u32), -limbs: std.ArrayListUnmanaged(std.math.big.Limb), -string_bytes: std.ArrayListUnmanaged(u8), +extra: std.ArrayList(u32), +limbs: std.ArrayList(std.math.big.Limb), +string_bytes: std.ArrayList(u8), string_table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage), -compile_errors: std.ArrayListUnmanaged(Zoir.CompileError), -error_notes: std.ArrayListUnmanaged(Zoir.CompileError.Note), +compile_errors: std.ArrayList(Zoir.CompileError), +error_notes: std.ArrayList(Zoir.CompileError.Note), pub const Options = struct { /// When false, string literals are not parsed. `string_literal` nodes will contain empty @@ -889,7 +889,7 @@ fn lowerAstErrors(zg: *ZonGen) Allocator.Error!void { defer msg.deinit(); const msg_bw = &msg.writer; - var notes: std.ArrayListUnmanaged(Zoir.CompileError.Note) = .empty; + var notes: std.ArrayList(Zoir.CompileError.Note) = .empty; defer notes.deinit(gpa); var cur_err = tree.errors[0]; diff --git a/lib/std/zig/llvm/BitcodeReader.zig b/lib/std/zig/llvm/BitcodeReader.zig index a876dcd2eb..d7b923c3c8 100644 --- a/lib/std/zig/llvm/BitcodeReader.zig +++ b/lib/std/zig/llvm/BitcodeReader.zig @@ -9,7 +9,7 @@ reader: *std.Io.Reader, keep_names: bool, bit_buffer: u32, bit_offset: u5, -stack: std.ArrayListUnmanaged(State), +stack: std.ArrayList(State), block_info: std.AutoHashMapUnmanaged(u32, Block.Info), pub const Item = union(enum) { @@ -488,7 +488,7 @@ const Abbrev = struct { }; const Store = struct { - abbrevs: std.ArrayListUnmanaged(Abbrev), + abbrevs: std.ArrayList(Abbrev), fn deinit(store: *Store, allocator: std.mem.Allocator) void { for (store.abbrevs.items) |abbrev| allocator.free(abbrev.operands); diff --git a/lib/std/zig/llvm/Builder.zig b/lib/std/zig/llvm/Builder.zig index 3bad020b9a..0f01748bbf 100644 --- a/lib/std/zig/llvm/Builder.zig +++ b/lib/std/zig/llvm/Builder.zig @@ -15,23 +15,23 @@ strip: bool, source_filename: String, data_layout: String, target_triple: String, -module_asm: std.ArrayListUnmanaged(u8), +module_asm: std.ArrayList(u8), string_map: std.AutoArrayHashMapUnmanaged(void, void), -string_indices: std.ArrayListUnmanaged(u32), -string_bytes: std.ArrayListUnmanaged(u8), +string_indices: std.ArrayList(u32), +string_bytes: std.ArrayList(u8), types: std.AutoArrayHashMapUnmanaged(String, Type), next_unnamed_type: String, next_unique_type_id: std.AutoHashMapUnmanaged(String, u32), type_map: std.AutoArrayHashMapUnmanaged(void, void), -type_items: std.ArrayListUnmanaged(Type.Item), -type_extra: std.ArrayListUnmanaged(u32), +type_items: std.ArrayList(Type.Item), +type_extra: std.ArrayList(u32), attributes: std.AutoArrayHashMapUnmanaged(Attribute.Storage, void), attributes_map: std.AutoArrayHashMapUnmanaged(void, void), -attributes_indices: std.ArrayListUnmanaged(u32), -attributes_extra: std.ArrayListUnmanaged(u32), +attributes_indices: std.ArrayList(u32), +attributes_extra: std.ArrayList(u32), function_attributes_set: std.AutoArrayHashMapUnmanaged(FunctionAttributes, void), @@ -39,32 +39,32 @@ globals: std.AutoArrayHashMapUnmanaged(StrtabString, Global), next_unnamed_global: StrtabString, next_replaced_global: StrtabString, next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32), -aliases: std.ArrayListUnmanaged(Alias), -variables: std.ArrayListUnmanaged(Variable), -functions: std.ArrayListUnmanaged(Function), +aliases: std.ArrayList(Alias), +variables: std.ArrayList(Variable), +functions: std.ArrayList(Function), strtab_string_map: std.AutoArrayHashMapUnmanaged(void, void), -strtab_string_indices: std.ArrayListUnmanaged(u32), -strtab_string_bytes: std.ArrayListUnmanaged(u8), +strtab_string_indices: std.ArrayList(u32), +strtab_string_bytes: std.ArrayList(u8), constant_map: std.AutoArrayHashMapUnmanaged(void, void), constant_items: std.MultiArrayList(Constant.Item), -constant_extra: std.ArrayListUnmanaged(u32), -constant_limbs: std.ArrayListUnmanaged(std.math.big.Limb), +constant_extra: std.ArrayList(u32), +constant_limbs: std.ArrayList(std.math.big.Limb), metadata_map: std.AutoArrayHashMapUnmanaged(void, void), metadata_items: std.MultiArrayList(Metadata.Item), -metadata_extra: std.ArrayListUnmanaged(u32), -metadata_limbs: std.ArrayListUnmanaged(std.math.big.Limb), -metadata_forward_references: std.ArrayListUnmanaged(Metadata.Optional), +metadata_extra: std.ArrayList(u32), +metadata_limbs: std.ArrayList(std.math.big.Limb), +metadata_forward_references: std.ArrayList(Metadata.Optional), metadata_named: std.AutoArrayHashMapUnmanaged(String, struct { len: u32, index: Metadata.Item.ExtraIndex, }), metadata_string_map: std.AutoArrayHashMapUnmanaged(void, void), -metadata_string_indices: std.ArrayListUnmanaged(u32), -metadata_string_bytes: std.ArrayListUnmanaged(u8), +metadata_string_indices: std.ArrayList(u32), +metadata_string_bytes: std.ArrayList(u8), pub const expected_args_len = 16; pub const expected_attrs_len = 16; @@ -1627,7 +1627,7 @@ pub const FunctionAttributes = enum(u32) { maps: Maps = .{}, const Map = std.AutoArrayHashMapUnmanaged(Attribute.Kind, Attribute.Index); - const Maps = std.ArrayListUnmanaged(Map); + const Maps = std.ArrayList(Map); pub fn deinit(self: *Wip, builder: *const Builder) void { for (self.maps.items) |*map| map.deinit(builder.gpa); @@ -5173,13 +5173,13 @@ pub const WipFunction = struct { prev_debug_location: DebugLocation, debug_location: DebugLocation, cursor: Cursor, - blocks: std.ArrayListUnmanaged(Block), + blocks: std.ArrayList(Block), instructions: std.MultiArrayList(Instruction), - names: std.ArrayListUnmanaged(String), + names: std.ArrayList(String), strip: bool, debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation), debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void), - extra: std.ArrayListUnmanaged(u32), + extra: std.ArrayList(u32), pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 }; @@ -5187,7 +5187,7 @@ pub const WipFunction = struct { name: String, incoming: u32, branches: u32 = 0, - instructions: std.ArrayListUnmanaged(Instruction.Index), + instructions: std.ArrayList(Instruction.Index), const Index = enum(u32) { entry, @@ -13193,7 +13193,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco // Write LLVM IR magic try bitcode.writeBits(ir.MAGIC, 32); - var record: std.ArrayListUnmanaged(u64) = .empty; + var record: std.ArrayList(u64) = .empty; defer record.deinit(self.gpa); // IDENTIFICATION_BLOCK diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig index c459981dd6..70b72b0581 100644 --- a/lib/std/zig/system/NativePaths.zig +++ b/lib/std/zig/system/NativePaths.zig @@ -7,11 +7,11 @@ const mem = std.mem; const NativePaths = @This(); arena: Allocator, -include_dirs: std.ArrayListUnmanaged([]const u8) = .empty, -lib_dirs: std.ArrayListUnmanaged([]const u8) = .empty, -framework_dirs: std.ArrayListUnmanaged([]const u8) = .empty, -rpaths: std.ArrayListUnmanaged([]const u8) = .empty, -warnings: std.ArrayListUnmanaged([]const u8) = .empty, +include_dirs: std.ArrayList([]const u8) = .empty, +lib_dirs: std.ArrayList([]const u8) = .empty, +framework_dirs: std.ArrayList([]const u8) = .empty, +rpaths: std.ArrayList([]const u8) = .empty, +warnings: std.ArrayList([]const u8) = .empty, pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths { var self: NativePaths = .{ .arena = arena }; diff --git a/lib/std/zon/parse.zig b/lib/std/zon/parse.zig index 5c1621adcf..aaa6622762 100644 --- a/lib/std/zon/parse.zig +++ b/lib/std/zon/parse.zig @@ -19,7 +19,7 @@ const Base = std.zig.number_literal.Base; const StrLitErr = std.zig.string_literal.Error; const NumberLiteralError = std.zig.number_literal.Error; const assert = std.debug.assert; -const ArrayListUnmanaged = std.ArrayListUnmanaged; +const ArrayList = std.ArrayList; /// Rename when adding or removing support for a type. const valid_types = {}; @@ -1115,7 +1115,7 @@ const Parser = struct { }; } else b: { const msg = "supported: "; - var buf: std.ArrayListUnmanaged(u8) = try .initCapacity(gpa, 64); + var buf: std.ArrayList(u8) = try .initCapacity(gpa, 64); defer buf.deinit(gpa); try buf.appendSlice(gpa, msg); inline for (info.fields, 0..) |field_info, i| { diff --git a/src/Air.zig b/src/Air.zig index 99065f83fe..e210ab17b8 100644 --- a/src/Air.zig +++ b/src/Air.zig @@ -22,7 +22,7 @@ pub const Liveness = @import("Air/Liveness.zig"); instructions: std.MultiArrayList(Inst).Slice, /// The meaning of this data is determined by `Inst.Tag` value. /// The first few indexes are reserved. See `ExtraIndex` for the values. -extra: std.ArrayListUnmanaged(u32), +extra: std.ArrayList(u32), pub const ExtraIndex = enum(u32) { /// Payload index of the main `Block` in the `extra` array. diff --git a/src/Air/Legalize.zig b/src/Air/Legalize.zig index 7657bdd479..3c3a5d013f 100644 --- a/src/Air/Legalize.zig +++ b/src/Air/Legalize.zig @@ -1,6 +1,6 @@ pt: Zcu.PerThread, air_instructions: std.MultiArrayList(Air.Inst), -air_extra: std.ArrayListUnmanaged(u32), +air_extra: std.ArrayList(u32), features: if (switch (dev.env) { .bootstrap => @import("../codegen/c.zig").legalizeFeatures(undefined), else => null, diff --git a/src/Air/Liveness.zig b/src/Air/Liveness.zig index 44364465bb..d90a5a1c3f 100644 --- a/src/Air/Liveness.zig +++ b/src/Air/Liveness.zig @@ -117,7 +117,7 @@ fn LivenessPassData(comptime pass: LivenessPass) type { /// The extra data initialized by the `loop_analysis` pass for this pass to consume. /// Owned by this struct during this pass. - old_extra: std.ArrayListUnmanaged(u32) = .empty, + old_extra: std.ArrayList(u32) = .empty, const BlockScope = struct { /// If this is a `block`, these instructions are alive upon a `br` to this block. @@ -347,7 +347,7 @@ const Analysis = struct { intern_pool: *InternPool, tomb_bits: []usize, special: std.AutoHashMapUnmanaged(Air.Inst.Index, u32), - extra: std.ArrayListUnmanaged(u32), + extra: std.ArrayList(u32), fn addExtra(a: *Analysis, extra: anytype) Allocator.Error!u32 { const fields = std.meta.fields(@TypeOf(extra)); @@ -1235,10 +1235,10 @@ fn analyzeInstCondBr( // Operands which are alive in one branch but not the other need to die at the start of // the peer branch. - var then_mirrored_deaths: std.ArrayListUnmanaged(Air.Inst.Index) = .empty; + var then_mirrored_deaths: std.ArrayList(Air.Inst.Index) = .empty; defer then_mirrored_deaths.deinit(gpa); - var else_mirrored_deaths: std.ArrayListUnmanaged(Air.Inst.Index) = .empty; + var else_mirrored_deaths: std.ArrayList(Air.Inst.Index) = .empty; defer else_mirrored_deaths.deinit(gpa); // Note: this invalidates `else_live`, but expands `then_live` to be their union @@ -1351,7 +1351,7 @@ fn analyzeInstSwitchBr( // to understand it, I encourage looking at `analyzeInstCondBr` first. const DeathSet = std.AutoHashMapUnmanaged(Air.Inst.Index, void); - const DeathList = std.ArrayListUnmanaged(Air.Inst.Index); + const DeathList = std.ArrayList(Air.Inst.Index); var case_live_sets = try gpa.alloc(std.AutoHashMapUnmanaged(Air.Inst.Index, void), ncases + 1); // +1 for else defer gpa.free(case_live_sets); diff --git a/src/Compilation.zig b/src/Compilation.zig index c83d6beb53..c76bcc37ea 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -263,7 +263,7 @@ llvm_opt_bisect_limit: c_int, time_report: ?TimeReport, -file_system_inputs: ?*std.ArrayListUnmanaged(u8), +file_system_inputs: ?*std.ArrayList(u8), /// This is the digest of the cache for the current compilation. /// This digest will be known after update() is called. @@ -1166,8 +1166,8 @@ pub const CObject = struct { category: u32 = 0, msg: []const u8 = &.{}, src_loc: SrcLoc = .{}, - src_ranges: std.ArrayListUnmanaged(SrcRange) = .empty, - sub_diags: std.ArrayListUnmanaged(Diag) = .empty, + src_ranges: std.ArrayList(SrcRange) = .empty, + sub_diags: std.ArrayList(Diag) = .empty, fn deinit(wip_diag: *@This(), allocator: Allocator) void { allocator.free(wip_diag.msg); @@ -1197,7 +1197,7 @@ pub const CObject = struct { category_names.deinit(gpa); } - var stack: std.ArrayListUnmanaged(WipDiag) = .empty; + var stack: std.ArrayList(WipDiag) = .empty; defer { for (stack.items) |*wip_diag| wip_diag.deinit(gpa); stack.deinit(gpa); @@ -1784,7 +1784,7 @@ pub const CreateOptions = struct { global_cc_argv: []const []const u8 = &.{}, /// Tracks all files that can cause the Compilation to be invalidated and need a rebuild. - file_system_inputs: ?*std.ArrayListUnmanaged(u8) = null, + file_system_inputs: ?*std.ArrayList(u8) = null, parent_whole_cache: ?ParentWholeCache = null, @@ -4150,7 +4150,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle { const refs = try zcu.resolveReferences(); - var messages: std.ArrayListUnmanaged(Zcu.ErrorMsg) = .empty; + var messages: std.ArrayList(Zcu.ErrorMsg) = .empty; defer messages.deinit(gpa); for (zcu.compile_logs.keys(), zcu.compile_logs.values()) |logging_unit, compile_log| { if (!refs.contains(logging_unit)) continue; @@ -4197,7 +4197,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle { } } - var log_text: std.ArrayListUnmanaged(u8) = .empty; + var log_text: std.ArrayList(u8) = .empty; defer log_text.deinit(gpa); // Index 0 will be the root message; the rest will be notes. @@ -4250,7 +4250,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle { } /// Writes all compile log lines belonging to `logging_unit` into `log_text` using `zcu.gpa`. -fn appendCompileLogLines(log_text: *std.ArrayListUnmanaged(u8), zcu: *Zcu, logging_unit: InternPool.AnalUnit) Allocator.Error!void { +fn appendCompileLogLines(log_text: *std.ArrayList(u8), zcu: *Zcu, logging_unit: InternPool.AnalUnit) Allocator.Error!void { const gpa = zcu.gpa; const ip = &zcu.intern_pool; var opt_line_idx = zcu.compile_logs.get(logging_unit).?.first_line.toOptional(); @@ -4336,7 +4336,7 @@ pub fn addModuleErrorMsg( }; const err_loc = std.zig.findLineColumn(err_source, err_span.main); - var ref_traces: std.ArrayListUnmanaged(ErrorBundle.ReferenceTrace) = .empty; + var ref_traces: std.ArrayList(ErrorBundle.ReferenceTrace) = .empty; defer ref_traces.deinit(gpa); rt: { @@ -4470,7 +4470,7 @@ pub fn addModuleErrorMsg( fn addReferenceTraceFrame( zcu: *Zcu, eb: *ErrorBundle.Wip, - ref_traces: *std.ArrayListUnmanaged(ErrorBundle.ReferenceTrace), + ref_traces: *std.ArrayList(ErrorBundle.ReferenceTrace), name: []const u8, lazy_src: Zcu.LazySrcLoc, inlined: bool, @@ -5678,7 +5678,7 @@ pub fn translateC( try argv.appendSlice(&[_][]const u8{ "-target", try target.zigTriple(arena) }); const mcpu = mcpu: { - var buf: std.ArrayListUnmanaged(u8) = .empty; + var buf: std.ArrayList(u8) = .empty; defer buf.deinit(gpa); try buf.print(gpa, "-mcpu={s}", .{target.cpu.model.name}); @@ -6671,7 +6671,7 @@ fn spawnZigRc( argv: []const []const u8, child_progress_node: std.Progress.Node, ) !void { - var node_name: std.ArrayListUnmanaged(u8) = .empty; + var node_name: std.ArrayList(u8) = .empty; defer node_name.deinit(arena); var child = std.process.Child.init(argv, arena); @@ -6986,7 +6986,7 @@ fn addCommonCCArgs( } if (is_clang) { - var san_arg: std.ArrayListUnmanaged(u8) = .empty; + var san_arg: std.ArrayList(u8) = .empty; const prefix = "-fsanitize="; if (mod.sanitize_c != .off) { if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); diff --git a/src/IncrementalDebugServer.zig b/src/IncrementalDebugServer.zig index 0ac1b360b8..d376ec146e 100644 --- a/src/IncrementalDebugServer.zig +++ b/src/IncrementalDebugServer.zig @@ -47,7 +47,7 @@ fn runThread(ids: *IncrementalDebugServer) void { const io = ids.zcu.comp.io; var cmd_buf: [1024]u8 = undefined; - var text_out: std.ArrayListUnmanaged(u8) = .empty; + var text_out: std.ArrayList(u8) = .empty; defer text_out.deinit(gpa); const addr: std.Io.net.IpAddress = .{ .ip6 = .loopback(port) }; diff --git a/src/InternPool.zig b/src/InternPool.zig index e53caf382f..e2912f2c69 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -79,10 +79,10 @@ first_dependency: std.AutoArrayHashMapUnmanaged(AnalUnit, DepEntry.Index), /// up entries in this list as required. This is not stored in `extra` so that /// we can use `free_dep_entries` to track free indices, since dependencies are /// removed frequently. -dep_entries: std.ArrayListUnmanaged(DepEntry), +dep_entries: std.ArrayList(DepEntry), /// Stores unused indices in `dep_entries` which can be reused without a full /// garbage collection pass. -free_dep_entries: std.ArrayListUnmanaged(DepEntry.Index), +free_dep_entries: std.ArrayList(DepEntry.Index), /// Whether a multi-threaded intern pool is useful. /// Currently `false` until the intern pool is actually accessed @@ -11436,7 +11436,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator) defer arena_allocator.deinit(); const arena = arena_allocator.allocator(); - var instances: std.AutoArrayHashMapUnmanaged(Index, std.ArrayListUnmanaged(Index)) = .empty; + var instances: std.AutoArrayHashMapUnmanaged(Index, std.ArrayList(Index)) = .empty; for (ip.locals, 0..) |*local, tid| { const items = local.shared.items.view().slice(); const extra_list = local.shared.extra; @@ -11463,7 +11463,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator) defer std.debug.unlockStderrWriter(); const SortContext = struct { - values: []std.ArrayListUnmanaged(Index), + values: []std.ArrayList(Index), pub fn lessThan(ctx: @This(), a_index: usize, b_index: usize) bool { return ctx.values[a_index].items.len > ctx.values[b_index].items.len; } diff --git a/src/Package.zig b/src/Package.zig index f625dd4908..9f05f33a46 100644 --- a/src/Package.zig +++ b/src/Package.zig @@ -105,7 +105,7 @@ pub const Hash = struct { assert(name.len <= 32); assert(ver.len <= 32); var result: Hash = undefined; - var buf: std.ArrayListUnmanaged(u8) = .initBuffer(&result.bytes); + var buf: std.ArrayList(u8) = .initBuffer(&result.bytes); buf.appendSliceAssumeCapacity(name); buf.appendAssumeCapacity('-'); buf.appendSliceAssumeCapacity(ver); diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig index 83d8aa7e5e..fab9d74a91 100644 --- a/src/Package/Fetch.zig +++ b/src/Package/Fetch.zig @@ -112,7 +112,7 @@ pub const JobQueue = struct { /// `table` may be missing some tasks such as ones that failed, so this /// field contains references to all of them. /// Protected by `mutex`. - all_fetches: std.ArrayListUnmanaged(*Fetch) = .empty, + all_fetches: std.ArrayList(*Fetch) = .empty, http_client: *std.http.Client, thread_pool: *ThreadPool, @@ -2323,7 +2323,7 @@ const TestFetchBuilder = struct { var package_dir = try self.packageDir(); defer package_dir.close(); - var actual_files: std.ArrayListUnmanaged([]u8) = .empty; + var actual_files: std.ArrayList([]u8) = .empty; defer actual_files.deinit(std.testing.allocator); defer for (actual_files.items) |file| std.testing.allocator.free(file); var walker = try package_dir.walk(std.testing.allocator); diff --git a/src/Package/Fetch/git.zig b/src/Package/Fetch/git.zig index 1d01b58633..a2ea870c3f 100644 --- a/src/Package/Fetch/git.zig +++ b/src/Package/Fetch/git.zig @@ -160,7 +160,7 @@ pub const Oid = union(Format) { pub const Diagnostics = struct { allocator: Allocator, - errors: std.ArrayListUnmanaged(Error) = .empty, + errors: std.ArrayList(Error) = .empty, pub const Error = union(enum) { unable_to_create_sym_link: struct { @@ -405,7 +405,7 @@ const Odb = struct { fn readObject(odb: *Odb) !Object { var base_offset = odb.pack_file.logicalPos(); var base_header: EntryHeader = undefined; - var delta_offsets: std.ArrayListUnmanaged(u64) = .empty; + var delta_offsets: std.ArrayList(u64) = .empty; defer delta_offsets.deinit(odb.allocator); const base_object = while (true) { if (odb.cache.get(base_offset)) |base_object| break base_object; @@ -1277,7 +1277,7 @@ pub fn indexPack( var index_entries: std.AutoHashMapUnmanaged(Oid, IndexEntry) = .empty; defer index_entries.deinit(allocator); - var pending_deltas: std.ArrayListUnmanaged(IndexEntry) = .empty; + var pending_deltas: std.ArrayList(IndexEntry) = .empty; defer pending_deltas.deinit(allocator); const pack_checksum = try indexPackFirstPass(allocator, format, pack, &index_entries, &pending_deltas); @@ -1299,7 +1299,7 @@ pub fn indexPack( remaining_deltas = pending_deltas.items.len; } - var oids: std.ArrayListUnmanaged(Oid) = .empty; + var oids: std.ArrayList(Oid) = .empty; defer oids.deinit(allocator); try oids.ensureTotalCapacityPrecise(allocator, index_entries.count()); var index_entries_iter = index_entries.iterator(); @@ -1341,7 +1341,7 @@ pub fn indexPack( try writer.writeInt(u32, index_entries.get(oid).?.crc32, .big); } - var big_offsets: std.ArrayListUnmanaged(u64) = .empty; + var big_offsets: std.ArrayList(u64) = .empty; defer big_offsets.deinit(allocator); for (oids.items) |oid| { const offset = index_entries.get(oid).?.offset; @@ -1372,7 +1372,7 @@ fn indexPackFirstPass( format: Oid.Format, pack: *std.fs.File.Reader, index_entries: *std.AutoHashMapUnmanaged(Oid, IndexEntry), - pending_deltas: *std.ArrayListUnmanaged(IndexEntry), + pending_deltas: *std.ArrayList(IndexEntry), ) !Oid { var flate_buffer: [std.compress.flate.max_window_len]u8 = undefined; var pack_buffer: [2048]u8 = undefined; // Reasonably large buffer for file system. @@ -1431,7 +1431,7 @@ fn indexPackHashDelta( // Figure out the chain of deltas to resolve var base_offset = delta.offset; var base_header: EntryHeader = undefined; - var delta_offsets: std.ArrayListUnmanaged(u64) = .empty; + var delta_offsets: std.ArrayList(u64) = .empty; defer delta_offsets.deinit(allocator); const base_object = while (true) { 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 "file8", "file9", }; - var actual_files: std.ArrayListUnmanaged([]u8) = .empty; + var actual_files: std.ArrayList([]u8) = .empty; defer actual_files.deinit(testing.allocator); defer for (actual_files.items) |file| testing.allocator.free(file); var walker = try worktree.dir.walk(testing.allocator); diff --git a/src/Package/Manifest.zig b/src/Package/Manifest.zig index 9b97b6b6d9..90243a23e0 100644 --- a/src/Package/Manifest.zig +++ b/src/Package/Manifest.zig @@ -140,8 +140,8 @@ const Parse = struct { gpa: Allocator, ast: Ast, arena: Allocator, - buf: std.ArrayListUnmanaged(u8), - errors: std.ArrayListUnmanaged(ErrorMessage), + buf: std.ArrayList(u8), + errors: std.ArrayList(ErrorMessage), name: []const u8, id: u32, @@ -466,7 +466,7 @@ const Parse = struct { fn parseStrLit( p: *Parse, token: Ast.TokenIndex, - buf: *std.ArrayListUnmanaged(u8), + buf: *std.ArrayList(u8), bytes: []const u8, offset: u32, ) InnerError!void { diff --git a/src/Sema.zig b/src/Sema.zig index f47d9dcc7d..51273d8812 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -46,7 +46,7 @@ gpa: Allocator, arena: Allocator, code: Zir, air_instructions: std.MultiArrayList(Air.Inst) = .{}, -air_extra: std.ArrayListUnmanaged(u32) = .empty, +air_extra: std.ArrayList(u32) = .empty, /// Maps ZIR to AIR. inst_map: InstMap = .{}, /// 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 /// stored as elements of this array. /// Pointers to such memory are represented via an index into this array. /// Backed by gpa. -comptime_allocs: std.ArrayListUnmanaged(ComptimeAlloc) = .empty, +comptime_allocs: std.ArrayList(ComptimeAlloc) = .empty, /// A list of exports performed by this analysis. After this `Sema` terminates, /// these are flushed to `Zcu.single_exports` or `Zcu.multi_exports`. -exports: std.ArrayListUnmanaged(Zcu.Export) = .empty, +exports: std.ArrayList(Zcu.Export) = .empty, /// All references registered so far by this `Sema`. This is a temporary duplicate /// of data stored in `Zcu.all_references`. It exists to avoid adding references to @@ -343,7 +343,7 @@ pub const Block = struct { /// The namespace to use for lookups from this source block namespace: InternPool.NamespaceIndex, /// The AIR instructions generated for this block. - instructions: std.ArrayListUnmanaged(Air.Inst.Index), + instructions: std.ArrayList(Air.Inst.Index), // `param` instructions are collected here to be used by the `func` instruction. /// When doing a generic function instantiation, this array collects a type /// for each *runtime-known* parameter. This array corresponds to the instance @@ -475,23 +475,23 @@ pub const Block = struct { block_inst: Air.Inst.Index, /// Separate array list from break_inst_list so that it can be passed directly /// to resolvePeerTypes. - results: std.ArrayListUnmanaged(Air.Inst.Ref), + results: std.ArrayList(Air.Inst.Ref), /// Keeps track of the break instructions so that the operand can be replaced /// if we need to add type coercion at the end of block analysis. /// Same indexes, capacity, length as `results`. - br_list: std.ArrayListUnmanaged(Air.Inst.Index), + br_list: std.ArrayList(Air.Inst.Index), /// Keeps the source location of the rhs operand of the break instruction, /// to enable more precise compile errors. /// Same indexes, capacity, length as `results`. - src_locs: std.ArrayListUnmanaged(?LazySrcLoc), + src_locs: std.ArrayList(?LazySrcLoc), /// Most blocks do not utilize this field. When it is used, its use is /// contextual. The possible uses are as follows: /// * for a `switch_block[_ref]`, this refers to dummy `br` instructions /// which correspond to `switch_continue` ZIR. The switch logic will /// rewrite these to appropriate AIR switch dispatches. - extra_insts: std.ArrayListUnmanaged(Air.Inst.Index) = .empty, + extra_insts: std.ArrayList(Air.Inst.Index) = .empty, /// Same indexes, capacity, length as `extra_insts`. - extra_src_locs: std.ArrayListUnmanaged(LazySrcLoc) = .empty, + extra_src_locs: std.ArrayList(LazySrcLoc) = .empty, pub fn deinit(merges: *@This(), allocator: Allocator) void { merges.results.deinit(allocator); @@ -985,7 +985,7 @@ const InferredAlloc = struct { /// is known. These should be rewritten to perform any required coercions /// when the type is resolved. /// Allocated from `sema.arena`. - prongs: std.ArrayListUnmanaged(Air.Inst.Index) = .empty, + prongs: std.ArrayList(Air.Inst.Index) = .empty, }; pub fn deinit(sema: *Sema) void { @@ -7547,8 +7547,8 @@ fn analyzeCall( // This may be an overestimate, but it's definitely sufficient. const max_runtime_args = args_info.count() - @popCount(func_ty_info.comptime_bits); - var runtime_args: std.ArrayListUnmanaged(Air.Inst.Ref) = try .initCapacity(arena, max_runtime_args); - var runtime_param_tys: std.ArrayListUnmanaged(InternPool.Index) = try .initCapacity(arena, max_runtime_args); + var runtime_args: std.ArrayList(Air.Inst.Ref) = try .initCapacity(arena, max_runtime_args); + var runtime_param_tys: std.ArrayList(InternPool.Index) = try .initCapacity(arena, max_runtime_args); const comptime_args = try arena.alloc(InternPool.Index, args_info.count()); @@ -11107,7 +11107,7 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp break :blk err_capture_inst; } else undefined; - var case_vals = try std.ArrayListUnmanaged(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len); + var case_vals = try std.ArrayList(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len); defer case_vals.deinit(gpa); const NonError = struct { @@ -11490,7 +11490,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index, operand_is_r break :blk tag_capture_inst; } else undefined; - var case_vals = try std.ArrayListUnmanaged(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len); + var case_vals = try std.ArrayList(Air.Inst.Ref).initCapacity(gpa, scalar_cases_len + 2 * multi_cases_len); defer case_vals.deinit(gpa); 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 } var extra_case_vals: struct { - items: std.ArrayListUnmanaged(Air.Inst.Ref), - ranges: std.ArrayListUnmanaged([2]Air.Inst.Ref), + items: std.ArrayList(Air.Inst.Ref), + ranges: std.ArrayList([2]Air.Inst.Ref), } = .{ .items = .empty, .ranges = .empty }; defer { extra_case_vals.items.deinit(gpa); @@ -12337,7 +12337,7 @@ fn analyzeSwitchRuntimeBlock( operand: Air.Inst.Ref, operand_ty: Type, operand_src: LazySrcLoc, - case_vals: std.ArrayListUnmanaged(Air.Inst.Ref), + case_vals: std.ArrayList(Air.Inst.Ref), else_prong: SpecialProng, scalar_cases_len: usize, multi_cases_len: usize, @@ -12369,10 +12369,10 @@ fn analyzeSwitchRuntimeBlock( const estimated_cases_extra = (scalar_cases_len + multi_cases_len) * @typeInfo(Air.SwitchBr.Case).@"struct".fields.len + 2; - var cases_extra = try std.ArrayListUnmanaged(u32).initCapacity(gpa, estimated_cases_extra); + var cases_extra = try std.ArrayList(u32).initCapacity(gpa, estimated_cases_extra); defer cases_extra.deinit(gpa); - var branch_hints = try std.ArrayListUnmanaged(std.builtin.BranchHint).initCapacity(gpa, scalar_cases_len); + var branch_hints = try std.ArrayList(std.builtin.BranchHint).initCapacity(gpa, scalar_cases_len); defer branch_hints.deinit(gpa); var case_block = child_block.makeSubBlock(); @@ -13022,7 +13022,7 @@ fn resolveSwitchComptimeLoop( special_members_only: ?SpecialProng, special_generic: SpecialProng, special_generic_is_under: bool, - case_vals: std.ArrayListUnmanaged(Air.Inst.Ref), + case_vals: std.ArrayList(Air.Inst.Ref), scalar_cases_len: u32, multi_cases_len: u32, err_set: bool, @@ -13094,7 +13094,7 @@ fn resolveSwitchComptime( special_members_only: ?SpecialProng, special_generic: SpecialProng, special_generic_is_under: bool, - case_vals: std.ArrayListUnmanaged(Air.Inst.Ref), + case_vals: std.ArrayList(Air.Inst.Ref), scalar_cases_len: u32, multi_cases_len: u32, err_set: bool, @@ -13350,7 +13350,7 @@ fn validateErrSetSwitch( sema: *Sema, block: *Block, seen_errors: *SwitchErrorSet, - case_vals: *std.ArrayListUnmanaged(Air.Inst.Ref), + case_vals: *std.ArrayList(Air.Inst.Ref), operand_ty: Type, inst_data: @FieldType(Zir.Inst.Data, "pl_node"), scalar_cases_len: u32, @@ -35678,8 +35678,8 @@ fn unionFields( enum_field_names = try sema.arena.alloc(InternPool.NullTerminatedString, fields_len); } - var field_types: std.ArrayListUnmanaged(InternPool.Index) = .empty; - var field_aligns: std.ArrayListUnmanaged(InternPool.Alignment) = .empty; + var field_types: std.ArrayList(InternPool.Index) = .empty; + var field_aligns: std.ArrayList(InternPool.Alignment) = .empty; try field_types.ensureTotalCapacityPrecise(sema.arena, fields_len); if (small.any_aligned_fields) @@ -37056,7 +37056,7 @@ fn notePathToComptimeAllocPtr( const zcu = pt.zcu; const ip = &zcu.intern_pool; - var first_path: std.ArrayListUnmanaged(u8) = .empty; + var first_path: std.ArrayList(u8) = .empty; if (intermediate_value_count == 0) { try first_path.print(arena, "{f}", .{start_value_name.fmt(ip)}); } else { @@ -37127,7 +37127,7 @@ fn notePathToComptimeAllocPtr( } } -fn notePathToComptimeAllocPtrInner(sema: *Sema, val: Value, path: *std.ArrayListUnmanaged(u8)) Allocator.Error!Value { +fn notePathToComptimeAllocPtrInner(sema: *Sema, val: Value, path: *std.ArrayList(u8)) Allocator.Error!Value { const pt = sema.pt; const zcu = pt.zcu; const ip = &zcu.intern_pool; diff --git a/src/Zcu.zig b/src/Zcu.zig index a8e4fc0e41..f15b03dc1a 100644 --- a/src/Zcu.zig +++ b/src/Zcu.zig @@ -87,10 +87,10 @@ local_zir_cache: Cache.Directory, /// This is where all `Export` values are stored. Not all values here are necessarily valid exports; /// to enumerate all exports, `single_exports` and `multi_exports` must be consulted. -all_exports: std.ArrayListUnmanaged(Export) = .empty, +all_exports: std.ArrayList(Export) = .empty, /// This is a list of free indices in `all_exports`. These indices may be reused by exports from /// future semantic analysis. -free_exports: std.ArrayListUnmanaged(Export.Index) = .empty, +free_exports: std.ArrayList(Export.Index) = .empty, /// Maps from an `AnalUnit` which performs a single export, to the index into `all_exports` of /// the export it performs. Note that the key is not the `Decl` being exported, but the `AnalUnit` /// whose analysis triggered the export. @@ -201,8 +201,8 @@ compile_logs: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct { }; } }) = .empty, -compile_log_lines: std.ArrayListUnmanaged(CompileLogLine) = .empty, -free_compile_log_lines: std.ArrayListUnmanaged(CompileLogLine.Index) = .empty, +compile_log_lines: std.ArrayList(CompileLogLine) = .empty, +free_compile_log_lines: std.ArrayList(CompileLogLine.Index) = .empty, /// This tracks files which triggered errors when generating AST/ZIR/ZOIR. /// If not `null`, the value is a retryable error (the file status is guaranteed /// to be `.retryable_failure`). Otherwise, the file status is `.astgen_failure` @@ -232,7 +232,7 @@ failed_files: std.AutoArrayHashMapUnmanaged(File.Index, ?[]u8) = .empty, /// semantic analysis this update. /// /// Allocated into gpa. -failed_imports: std.ArrayListUnmanaged(struct { +failed_imports: std.ArrayList(struct { file_index: File.Index, import_string: Zir.NullTerminatedString, import_token: Ast.TokenIndex, @@ -261,7 +261,7 @@ outdated_ready: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty, /// failure was something like running out of disk space, and trying again may /// succeed. On the next update, we will flush this list, marking all members of /// it as outdated. -retryable_failures: std.ArrayListUnmanaged(AnalUnit) = .empty, +retryable_failures: std.ArrayList(AnalUnit) = .empty, func_body_analysis_queued: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty, nav_val_analysis_queued: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty, @@ -290,12 +290,12 @@ global_assembly: std.AutoArrayHashMapUnmanaged(AnalUnit, []u8) = .empty, /// The `next` field on the `Reference` forms a linked list of all references /// triggered by the key `AnalUnit`. reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty, -all_references: std.ArrayListUnmanaged(Reference) = .empty, +all_references: std.ArrayList(Reference) = .empty, /// Freelist of indices in `all_references`. -free_references: std.ArrayListUnmanaged(u32) = .empty, +free_references: std.ArrayList(u32) = .empty, -inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame) = .empty, -free_inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame.Index) = .empty, +inline_reference_frames: std.ArrayList(InlineReferenceFrame) = .empty, +free_inline_reference_frames: std.ArrayList(InlineReferenceFrame.Index) = .empty, /// Key is the `AnalUnit` *performing* the reference. This representation allows /// incremental updates to quickly delete references caused by a specific `AnalUnit`. @@ -303,9 +303,9 @@ free_inline_reference_frames: std.ArrayListUnmanaged(InlineReferenceFrame.Index) /// The `next` field on the `TypeReference` forms a linked list of all type references /// triggered by the key `AnalUnit`. type_reference_table: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty, -all_type_references: std.ArrayListUnmanaged(TypeReference) = .empty, +all_type_references: std.ArrayList(TypeReference) = .empty, /// Freelist of indices in `all_type_references`. -free_type_references: std.ArrayListUnmanaged(u32) = .empty, +free_type_references: std.ArrayList(u32) = .empty, /// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = s })`, where `s` depends on the element. builtin_decl_values: BuiltinDecl.Memoized = .initFill(.none), @@ -346,7 +346,7 @@ pub const IncrementalDebugState = struct { pub const UnitInfo = struct { last_update_gen: u32, /// This information isn't easily recoverable from `InternPool`'s dependency storage format. - deps: std.ArrayListUnmanaged(InternPool.Dependee), + deps: std.ArrayList(InternPool.Dependee), }; pub fn getUnitInfo(ids: *IncrementalDebugState, gpa: Allocator, unit: AnalUnit) Allocator.Error!*UnitInfo { const gop = try ids.units.getOrPut(gpa, unit); @@ -812,10 +812,10 @@ pub const Namespace = struct { priv_decls: std.ArrayHashMapUnmanaged(InternPool.Nav.Index, void, NavNameContext, true) = .empty, /// All `comptime` declarations in this namespace. We store these purely so that incremental /// compilation can re-use the existing `ComptimeUnit`s when a namespace changes. - comptime_decls: std.ArrayListUnmanaged(InternPool.ComptimeUnit.Id) = .empty, + comptime_decls: std.ArrayList(InternPool.ComptimeUnit.Id) = .empty, /// All `test` declarations in this namespace. We store these purely so that incremental /// compilation can re-use the existing `Nav`s when a namespace changes. - test_decls: std.ArrayListUnmanaged(InternPool.Nav.Index) = .empty, + test_decls: std.ArrayList(InternPool.Nav.Index) = .empty, pub const Index = InternPool.NamespaceIndex; pub const OptionalIndex = InternPool.OptionalNamespaceIndex; @@ -3292,7 +3292,7 @@ pub fn mapOldZirToNew( old_inst: Zir.Inst.Index, new_inst: Zir.Inst.Index, }; - var match_stack: std.ArrayListUnmanaged(MatchedZirDecl) = .empty; + var match_stack: std.ArrayList(MatchedZirDecl) = .empty; defer match_stack.deinit(gpa); // Used as temporary buffers for namespace declaration instructions @@ -3358,10 +3358,10 @@ pub fn mapOldZirToNew( var named_decltests: std.StringHashMapUnmanaged(Zir.Inst.Index) = .empty; defer named_decltests.deinit(gpa); // All unnamed tests, in order, for a best-effort match. - var unnamed_tests: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty; + var unnamed_tests: std.ArrayList(Zir.Inst.Index) = .empty; defer unnamed_tests.deinit(gpa); // All comptime declarations, in order, for a best-effort match. - var comptime_decls: std.ArrayListUnmanaged(Zir.Inst.Index) = .empty; + var comptime_decls: std.ArrayList(Zir.Inst.Index) = .empty; defer comptime_decls.deinit(gpa); { @@ -4636,7 +4636,7 @@ pub fn addFileInMultipleModulesError( info.modules[1].fully_qualified_name, }); - var notes: std.ArrayListUnmanaged(std.zig.ErrorBundle.MessageIndex) = .empty; + var notes: std.ArrayList(std.zig.ErrorBundle.MessageIndex) = .empty; defer notes.deinit(gpa); try notes.append(gpa, try eb.addErrorMessage(.{ @@ -4660,7 +4660,7 @@ pub fn addFileInMultipleModulesError( fn explainWhyFileIsInModule( zcu: *Zcu, eb: *std.zig.ErrorBundle.Wip, - notes_out: *std.ArrayListUnmanaged(std.zig.ErrorBundle.MessageIndex), + notes_out: *std.ArrayList(std.zig.ErrorBundle.MessageIndex), file: File.Index, in_module: *Package.Module, ref: File.Reference, diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index ce7d44c4b6..78a35fb124 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -3091,8 +3091,8 @@ pub fn processExports(pt: Zcu.PerThread) !void { } // First, construct a mapping of every exported value and Nav to the indices of all its different exports. - var nav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, std.ArrayListUnmanaged(Zcu.Export.Index)) = .empty; - var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Index, std.ArrayListUnmanaged(Zcu.Export.Index)) = .empty; + var nav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, std.ArrayList(Zcu.Export.Index)) = .empty; + var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty; defer { for (nav_exports.values()) |*exports| { exports.deinit(gpa); diff --git a/src/codegen/aarch64/Select.zig b/src/codegen/aarch64/Select.zig index 4799505b7f..93cb987820 100644 --- a/src/codegen/aarch64/Select.zig +++ b/src/codegen/aarch64/Select.zig @@ -7,24 +7,24 @@ nav_index: InternPool.Nav.Index, def_order: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, void), blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Block), loops: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Loop), -active_loops: std.ArrayListUnmanaged(Loop.Index), +active_loops: std.ArrayList(Loop.Index), loop_live: struct { set: std.AutoArrayHashMapUnmanaged(struct { Loop.Index, Air.Inst.Index }, void), - list: std.ArrayListUnmanaged(Air.Inst.Index), + list: std.ArrayList(Air.Inst.Index), }, dom_start: u32, dom_len: u32, -dom: std.ArrayListUnmanaged(DomInt), +dom: std.ArrayList(DomInt), // Wip Mir saved_registers: std.enums.EnumSet(Register.Alias), -instructions: std.ArrayListUnmanaged(codegen.aarch64.encoding.Instruction), -literals: std.ArrayListUnmanaged(u32), -nav_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Nav), -uav_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Uav), -lazy_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Lazy), -global_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Global), -literal_relocs: std.ArrayListUnmanaged(codegen.aarch64.Mir.Reloc.Literal), +instructions: std.ArrayList(codegen.aarch64.encoding.Instruction), +literals: std.ArrayList(u32), +nav_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Nav), +uav_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Uav), +lazy_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Lazy), +global_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Global), +literal_relocs: std.ArrayList(codegen.aarch64.Mir.Reloc.Literal), // Stack Frame returns: bool, @@ -44,7 +44,7 @@ stack_align: InternPool.Alignment, // Value Tracking live_registers: LiveRegisters, live_values: std.AutoHashMapUnmanaged(Air.Inst.Index, Value.Index), -values: std.ArrayListUnmanaged(Value), +values: std.ArrayList(Value), pub const LiveRegisters = std.enums.EnumArray(Register.Alias, Value.Index); @@ -11274,7 +11274,7 @@ pub fn dumpValues(isel: *Select, which: enum { only_referenced, all }) void { const ip = &zcu.intern_pool; const nav = ip.getNav(isel.nav_index); - var reverse_live_values: std.AutoArrayHashMapUnmanaged(Value.Index, std.ArrayListUnmanaged(Air.Inst.Index)) = .empty; + var reverse_live_values: std.AutoArrayHashMapUnmanaged(Value.Index, std.ArrayList(Air.Inst.Index)) = .empty; defer { for (reverse_live_values.values()) |*list| list.deinit(gpa); reverse_live_values.deinit(gpa); diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 91614bf2df..428d3f4c64 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -431,7 +431,7 @@ pub const Function = struct { lazy_fns: LazyFnMap, func_index: InternPool.Index, /// All the locals, to be emitted at the top of the function. - locals: std.ArrayListUnmanaged(Local) = .empty, + locals: std.ArrayList(Local) = .empty, /// Which locals are available for reuse, based on Type. free_locals_map: LocalsMap = .{}, /// Locals which will not be freed by Liveness. This is used after a @@ -752,7 +752,7 @@ pub const DeclGen = struct { fwd_decl: Writer.Allocating, error_msg: ?*Zcu.ErrorMsg, ctype_pool: CType.Pool, - scratch: std.ArrayListUnmanaged(u32), + scratch: std.ArrayList(u32), /// This map contains all the UAVs we saw generating this function. /// `link.C` will merge them into its `uavs`/`aligned_uavs` fields. /// Key is the value of the UAV; value is the UAV's alignment, or diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig index ac535a47d1..f575a40197 100644 --- a/src/codegen/c/Type.zig +++ b/src/codegen/c/Type.zig @@ -971,11 +971,11 @@ pub const Info = union(enum) { pub const Pool = struct { map: Map, items: std.MultiArrayList(Item), - extra: std.ArrayListUnmanaged(u32), + extra: std.ArrayList(u32), string_map: Map, - string_indices: std.ArrayListUnmanaged(u32), - string_bytes: std.ArrayListUnmanaged(u8), + string_indices: std.ArrayList(u32), + string_bytes: std.ArrayList(u8), const Map = std.AutoArrayHashMapUnmanaged(void, void); @@ -1396,7 +1396,7 @@ pub const Pool = struct { pub fn fromType( pool: *Pool, allocator: std.mem.Allocator, - scratch: *std.ArrayListUnmanaged(u32), + scratch: *std.ArrayList(u32), ty: Type, pt: Zcu.PerThread, mod: *Module, @@ -3271,7 +3271,7 @@ pub const Pool = struct { addExtraAssumeCapacityTo(&pool.extra, Extra, extra); } fn addExtraAssumeCapacityTo( - array: *std.ArrayListUnmanaged(u32), + array: *std.ArrayList(u32), comptime Extra: type, extra: Extra, ) void { @@ -3309,7 +3309,7 @@ pub const Pool = struct { } fn addHashedExtraAssumeCapacityTo( pool: *Pool, - array: *std.ArrayListUnmanaged(u32), + array: *std.ArrayList(u32), hasher: *Hasher, comptime Extra: type, extra: Extra, diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 8d51fea0c3..ad76cc8f36 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -523,8 +523,8 @@ pub const Object = struct { debug_enums_fwd_ref: Builder.Metadata.Optional, debug_globals_fwd_ref: Builder.Metadata.Optional, - debug_enums: std.ArrayListUnmanaged(Builder.Metadata), - debug_globals: std.ArrayListUnmanaged(Builder.Metadata), + debug_enums: std.ArrayList(Builder.Metadata), + debug_globals: std.ArrayList(Builder.Metadata), debug_file_map: std.AutoHashMapUnmanaged(Zcu.File.Index, Builder.Metadata), debug_type_map: std.AutoHashMapUnmanaged(InternPool.Index, Builder.Metadata), @@ -571,7 +571,7 @@ pub const Object = struct { struct_field_map: std.AutoHashMapUnmanaged(ZigStructField, c_uint), /// Values for `@llvm.used`. - used: std.ArrayListUnmanaged(Builder.Constant), + used: std.ArrayList(Builder.Constant), const ZigStructField = struct { struct_ty: InternPool.Index, @@ -1298,7 +1298,7 @@ pub const Object = struct { // instructions. Depending on the calling convention, this list is not necessarily // a bijection with the actual LLVM parameters of the function. const gpa = o.gpa; - var args: std.ArrayListUnmanaged(Builder.Value) = .empty; + var args: std.ArrayList(Builder.Value) = .empty; defer args.deinit(gpa); { @@ -2318,7 +2318,7 @@ pub const Object = struct { switch (ip.indexToKey(ty.toIntern())) { .tuple_type => |tuple| { - var fields: std.ArrayListUnmanaged(Builder.Metadata) = .empty; + var fields: std.ArrayList(Builder.Metadata) = .empty; defer fields.deinit(gpa); try fields.ensureUnusedCapacity(gpa, tuple.types.len); @@ -2392,7 +2392,7 @@ pub const Object = struct { const struct_type = zcu.typeToStruct(ty).?; - var fields: std.ArrayListUnmanaged(Builder.Metadata) = .empty; + var fields: std.ArrayList(Builder.Metadata) = .empty; defer fields.deinit(gpa); try fields.ensureUnusedCapacity(gpa, struct_type.field_types.len); @@ -2484,7 +2484,7 @@ pub const Object = struct { return debug_union_type; } - var fields: std.ArrayListUnmanaged(Builder.Metadata) = .empty; + var fields: std.ArrayList(Builder.Metadata) = .empty; defer fields.deinit(gpa); try fields.ensureUnusedCapacity(gpa, union_type.loadTagType(ip).names.len); @@ -3273,7 +3273,7 @@ pub const Object = struct { return int_ty; } - var llvm_field_types: std.ArrayListUnmanaged(Builder.Type) = .empty; + var llvm_field_types: std.ArrayList(Builder.Type) = .empty; defer llvm_field_types.deinit(o.gpa); // Although we can estimate how much capacity to add, these cannot be // relied upon because of the recursive calls to lowerType below. @@ -3342,7 +3342,7 @@ pub const Object = struct { return ty; }, .tuple_type => |tuple_type| { - var llvm_field_types: std.ArrayListUnmanaged(Builder.Type) = .empty; + var llvm_field_types: std.ArrayList(Builder.Type) = .empty; defer llvm_field_types.deinit(o.gpa); // Although we can estimate how much capacity to add, these cannot be // relied upon because of the recursive calls to lowerType below. @@ -3531,7 +3531,7 @@ pub const Object = struct { const target = zcu.getTarget(); const ret_ty = try lowerFnRetTy(o, pt, fn_info); - var llvm_params: std.ArrayListUnmanaged(Builder.Type) = .empty; + var llvm_params: std.ArrayList(Builder.Type) = .empty; defer llvm_params.deinit(o.gpa); if (firstParamSRet(fn_info, zcu, target)) { @@ -4741,7 +4741,7 @@ pub const FuncGen = struct { const Fuzz = struct { counters_variable: Builder.Variable.Index, - pcs: std.ArrayListUnmanaged(Builder.Constant), + pcs: std.ArrayList(Builder.Constant), fn deinit(f: *Fuzz, gpa: Allocator) void { f.pcs.deinit(gpa); @@ -7251,7 +7251,7 @@ pub const FuncGen = struct { const inputs: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[extra_i..][0..extra.data.inputs_len]); extra_i += inputs.len; - var llvm_constraints: std.ArrayListUnmanaged(u8) = .empty; + var llvm_constraints: std.ArrayList(u8) = .empty; defer llvm_constraints.deinit(gpa); 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) /// Appends zero or more LLVM constraints to `llvm_constraints`, returning how many were added. fn appendConstraints( gpa: Allocator, - llvm_constraints: *std.ArrayListUnmanaged(u8), + llvm_constraints: *std.ArrayList(u8), zig_name: []const u8, target: *const std.Target, ) error{OutOfMemory}!usize { diff --git a/src/codegen/riscv64/CodeGen.zig b/src/codegen/riscv64/CodeGen.zig index ac176c4780..5dc89d9af9 100644 --- a/src/codegen/riscv64/CodeGen.zig +++ b/src/codegen/riscv64/CodeGen.zig @@ -90,7 +90,7 @@ scope_generation: u32, /// The value is an offset into the `Function` `code` from the beginning. /// To perform the reloc, write 32-bit signed little-endian integer /// which is a relative jump, based on the address following the reloc. -exitlude_jump_relocs: std.ArrayListUnmanaged(usize) = .empty, +exitlude_jump_relocs: std.ArrayList(usize) = .empty, reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined, @@ -609,7 +609,7 @@ const FrameAlloc = struct { }; const BlockData = struct { - relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty, + relocs: std.ArrayList(Mir.Inst.Index) = .empty, state: State, fn deinit(bd: *BlockData, gpa: Allocator) void { @@ -6200,7 +6200,7 @@ fn airAsm(func: *Func, inst: Air.Inst.Index) !void { const Label = struct { target: Mir.Inst.Index = undefined, - pending_relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty, + pending_relocs: std.ArrayList(Mir.Inst.Index) = .empty, const Kind = enum { definition, reference }; diff --git a/src/codegen/riscv64/Emit.zig b/src/codegen/riscv64/Emit.zig index 64a476007c..67732cc9c0 100644 --- a/src/codegen/riscv64/Emit.zig +++ b/src/codegen/riscv64/Emit.zig @@ -11,7 +11,7 @@ prev_di_column: u32, prev_di_pc: usize, code_offset_mapping: std.AutoHashMapUnmanaged(Mir.Inst.Index, usize) = .empty, -relocs: std.ArrayListUnmanaged(Reloc) = .empty, +relocs: std.ArrayList(Reloc) = .empty, pub const Error = Lower.Error || std.Io.Writer.Error || error{ EmitFail, diff --git a/src/codegen/sparc64/CodeGen.zig b/src/codegen/sparc64/CodeGen.zig index c681137bae..b3416dcedf 100644 --- a/src/codegen/sparc64/CodeGen.zig +++ b/src/codegen/sparc64/CodeGen.zig @@ -68,7 +68,7 @@ stack_align: Alignment, /// MIR Instructions mir_instructions: std.MultiArrayList(Mir.Inst) = .{}, /// MIR extra data -mir_extra: std.ArrayListUnmanaged(u32) = .empty, +mir_extra: std.ArrayList(u32) = .empty, /// Byte offset within the source file of the ending curly. end_di_line: u32, @@ -77,7 +77,7 @@ end_di_column: u32, /// The value is an offset into the `Function` `code` from the beginning. /// To perform the reloc, write 32-bit signed little-endian integer /// which is a relative jump, based on the address following the reloc. -exitlude_jump_relocs: std.ArrayListUnmanaged(usize) = .empty, +exitlude_jump_relocs: std.ArrayList(usize) = .empty, reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined, @@ -218,7 +218,7 @@ const StackAllocation = struct { }; const BlockData = struct { - relocs: std.ArrayListUnmanaged(Mir.Inst.Index), + relocs: std.ArrayList(Mir.Inst.Index), /// The first break instruction encounters `null` here and chooses a /// machine code value for the block result, populating this field. /// Following break instructions encounter that value and use it for diff --git a/src/codegen/sparc64/Emit.zig b/src/codegen/sparc64/Emit.zig index 26282b09ab..9442fc1908 100644 --- a/src/codegen/sparc64/Emit.zig +++ b/src/codegen/sparc64/Emit.zig @@ -32,7 +32,7 @@ prev_di_pc: usize, branch_types: std.AutoHashMapUnmanaged(Mir.Inst.Index, BranchType) = .empty, /// For every forward branch, maps the target instruction to a list of /// branches which branch to this target instruction -branch_forward_origins: std.AutoHashMapUnmanaged(Mir.Inst.Index, std.ArrayListUnmanaged(Mir.Inst.Index)) = .empty, +branch_forward_origins: std.AutoHashMapUnmanaged(Mir.Inst.Index, std.ArrayList(Mir.Inst.Index)) = .empty, /// For backward branches: stores the code offset of the target /// instruction /// @@ -568,7 +568,7 @@ fn lowerBranches(emit: *Emit) !void { if (emit.branch_forward_origins.getPtr(target_inst)) |origin_list| { try origin_list.append(gpa, inst); } else { - var origin_list: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty; + var origin_list: std.ArrayList(Mir.Inst.Index) = .empty; try origin_list.append(gpa, inst); try emit.branch_forward_origins.put(gpa, target_inst, origin_list); } diff --git a/src/codegen/spirv/Assembler.zig b/src/codegen/spirv/Assembler.zig index a47cd49644..5b19f960a7 100644 --- a/src/codegen/spirv/Assembler.zig +++ b/src/codegen/spirv/Assembler.zig @@ -14,16 +14,16 @@ const StorageClass = spec.StorageClass; const Assembler = @This(); cg: *CodeGen, -errors: std.ArrayListUnmanaged(ErrorMsg) = .empty, +errors: std.ArrayList(ErrorMsg) = .empty, src: []const u8 = undefined, /// `ass.src` tokenized. -tokens: std.ArrayListUnmanaged(Token) = .empty, +tokens: std.ArrayList(Token) = .empty, current_token: u32 = 0, /// The instruction that is currently being parsed or has just been parsed. inst: struct { opcode: Opcode = undefined, - operands: std.ArrayListUnmanaged(Operand) = .empty, - string_bytes: std.ArrayListUnmanaged(u8) = .empty, + operands: std.ArrayList(Operand) = .empty, + string_bytes: std.ArrayList(u8) = .empty, fn result(ass: @This()) ?AsmValue.Ref { for (ass.operands.items[0..@min(ass.operands.items.len, 2)]) |op| { diff --git a/src/codegen/spirv/CodeGen.zig b/src/codegen/spirv/CodeGen.zig index 20aad56225..c34dd96e25 100644 --- a/src/codegen/spirv/CodeGen.zig +++ b/src/codegen/spirv/CodeGen.zig @@ -83,7 +83,7 @@ const ControlFlow = union(enum) { selection: struct { /// In order to know which merges we still need to do, we need to keep /// a stack of those. - merge_stack: std.ArrayListUnmanaged(SelectionMerge) = .empty, + merge_stack: std.ArrayList(SelectionMerge) = .empty, }, /// For a `loop` type block, we can early-exit the block by /// jumping to the loop exit node, and we don't need to generate @@ -91,7 +91,7 @@ const ControlFlow = union(enum) { loop: struct { /// The next block to jump to can be determined from any number /// of conditions that jump to the loop exit. - merges: std.ArrayListUnmanaged(Incoming) = .empty, + merges: std.ArrayList(Incoming) = .empty, /// The label id of the loop's merge block. merge_block: Id, }, @@ -105,7 +105,7 @@ const ControlFlow = union(enum) { } }; /// This determines how exits from the current block must be handled. - block_stack: std.ArrayListUnmanaged(*Structured.Block) = .empty, + block_stack: std.ArrayList(*Structured.Block) = .empty, block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty, }; @@ -117,7 +117,7 @@ const ControlFlow = union(enum) { const Block = struct { label: ?Id = null, - incoming_blocks: std.ArrayListUnmanaged(Incoming) = .empty, + incoming_blocks: std.ArrayList(Incoming) = .empty, }; /// We need to keep track of result ids for block labels, as well as the 'incoming' @@ -151,9 +151,9 @@ control_flow: ControlFlow, base_line: u32, block_label: Id = .none, next_arg_index: u32 = 0, -args: std.ArrayListUnmanaged(Id) = .empty, +args: std.ArrayList(Id) = .empty, inst_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty, -id_scratch: std.ArrayListUnmanaged(Id) = .empty, +id_scratch: std.ArrayList(Id) = .empty, prologue: Section = .{}, body: Section = .{}, error_msg: ?*Zcu.ErrorMsg = null, @@ -5783,7 +5783,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index) !void { } } - var incoming_structured_blocks: std.ArrayListUnmanaged(ControlFlow.Structured.Block.Incoming) = .empty; + var incoming_structured_blocks: std.ArrayList(ControlFlow.Structured.Block.Incoming) = .empty; defer incoming_structured_blocks.deinit(gpa); if (cg.control_flow == .structured) { diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig index 3189a422f8..6b6c1f0ab3 100644 --- a/src/codegen/spirv/Module.zig +++ b/src/codegen/spirv/Module.zig @@ -26,8 +26,8 @@ zcu: *Zcu, nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty, uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty, intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty, -decls: std.ArrayListUnmanaged(Decl) = .empty, -decl_deps: std.ArrayListUnmanaged(Decl.Index) = .empty, +decls: std.ArrayList(Decl) = .empty, +decl_deps: std.ArrayList(Decl.Index) = .empty, entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty, /// This map serves a dual purpose: /// - It keeps track of pointers that are currently being emitted, so that we can tell diff --git a/src/codegen/spirv/Section.zig b/src/codegen/spirv/Section.zig index d5748afa39..5059b2c866 100644 --- a/src/codegen/spirv/Section.zig +++ b/src/codegen/spirv/Section.zig @@ -13,7 +13,7 @@ const Log2Word = std.math.Log2Int(Word); const Opcode = spec.Opcode; -instructions: std.ArrayListUnmanaged(Word) = .empty, +instructions: std.ArrayList(Word) = .empty, pub fn deinit(section: *Section, allocator: Allocator) void { section.instructions.deinit(allocator); diff --git a/src/codegen/wasm/CodeGen.zig b/src/codegen/wasm/CodeGen.zig index 1d83474cc3..5d78b46702 100644 --- a/src/codegen/wasm/CodeGen.zig +++ b/src/codegen/wasm/CodeGen.zig @@ -53,7 +53,7 @@ func_index: InternPool.Index, /// When we return from a branch, the branch will be popped from this list, /// which means branches can only contain references from within its own branch, /// or a branch higher (lower index) in the tree. -branches: std.ArrayListUnmanaged(Branch) = .empty, +branches: std.ArrayList(Branch) = .empty, /// Table to save `WValue`'s generated by an `Air.Inst` // values: ValueTable, /// Mapping from Air.Inst.Index to block ids @@ -73,7 +73,7 @@ arg_index: u32 = 0, /// List of simd128 immediates. Each value is stored as an array of bytes. /// This list will only be populated for 128bit-simd values when the target features /// are enabled also. -simd_immediates: std.ArrayListUnmanaged([16]u8) = .empty, +simd_immediates: std.ArrayList([16]u8) = .empty, /// The Target we're emitting (used to call intInfo) target: *const std.Target, ptr_size: enum { wasm32, wasm64 }, @@ -81,10 +81,10 @@ pt: Zcu.PerThread, /// List of MIR Instructions mir_instructions: std.MultiArrayList(Mir.Inst), /// Contains extra data for MIR -mir_extra: std.ArrayListUnmanaged(u32), +mir_extra: std.ArrayList(u32), /// List of all locals' types generated throughout this declaration /// used to emit locals count at start of 'code' section. -mir_locals: std.ArrayListUnmanaged(std.wasm.Valtype), +mir_locals: std.ArrayList(std.wasm.Valtype), /// Set of all UAVs referenced by this function. Key is the UAV value, value is the alignment. /// `.none` means naturally aligned. An explicit alignment is never less than the natural alignment. mir_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment), @@ -121,19 +121,19 @@ stack_alignment: Alignment = .@"16", // allows us to re-use locals that are no longer used. e.g. a temporary local. /// A list of indexes which represents a local of valtype `i32`. /// It is illegal to store a non-i32 valtype in this list. -free_locals_i32: std.ArrayListUnmanaged(u32) = .empty, +free_locals_i32: std.ArrayList(u32) = .empty, /// A list of indexes which represents a local of valtype `i64`. /// It is illegal to store a non-i64 valtype in this list. -free_locals_i64: std.ArrayListUnmanaged(u32) = .empty, +free_locals_i64: std.ArrayList(u32) = .empty, /// A list of indexes which represents a local of valtype `f32`. /// It is illegal to store a non-f32 valtype in this list. -free_locals_f32: std.ArrayListUnmanaged(u32) = .empty, +free_locals_f32: std.ArrayList(u32) = .empty, /// A list of indexes which represents a local of valtype `f64`. /// It is illegal to store a non-f64 valtype in this list. -free_locals_f64: std.ArrayListUnmanaged(u32) = .empty, +free_locals_f64: std.ArrayList(u32) = .empty, /// A list of indexes which represents a local of valtype `v127`. /// It is illegal to store a non-v128 valtype in this list. -free_locals_v128: std.ArrayListUnmanaged(u32) = .empty, +free_locals_v128: std.ArrayList(u32) = .empty, /// When in debug mode, this tracks if no `finishAir` was missed. /// Forgetting to call `finishAir` will cause the result to not be diff --git a/src/codegen/wasm/Mir.zig b/src/codegen/wasm/Mir.zig index af6e0eb40b..7f0ea1bc02 100644 --- a/src/codegen/wasm/Mir.zig +++ b/src/codegen/wasm/Mir.zig @@ -669,7 +669,7 @@ pub fn deinit(mir: *Mir, gpa: std.mem.Allocator) void { mir.* = undefined; } -pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayListUnmanaged(u8)) std.mem.Allocator.Error!void { +pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayList(u8)) std.mem.Allocator.Error!void { const gpa = wasm.base.comp.gpa; // Write the locals in the prologue of the function body. diff --git a/src/codegen/x86_64/CodeGen.zig b/src/codegen/x86_64/CodeGen.zig index b43b359de1..80798969eb 100644 --- a/src/codegen/x86_64/CodeGen.zig +++ b/src/codegen/x86_64/CodeGen.zig @@ -113,21 +113,21 @@ eflags_inst: ?Air.Inst.Index = null, /// MIR Instructions mir_instructions: std.MultiArrayList(Mir.Inst) = .empty, /// MIR extra data -mir_extra: std.ArrayListUnmanaged(u32) = .empty, -mir_string_bytes: std.ArrayListUnmanaged(u8) = .empty, +mir_extra: std.ArrayList(u32) = .empty, +mir_string_bytes: std.ArrayList(u8) = .empty, mir_strings: std.HashMapUnmanaged( u32, void, std.hash_map.StringIndexContext, std.hash_map.default_max_load_percentage, ) = .empty, -mir_locals: std.ArrayListUnmanaged(Mir.Local) = .empty, -mir_table: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty, +mir_locals: std.ArrayList(Mir.Local) = .empty, +mir_table: std.ArrayList(Mir.Inst.Index) = .empty, /// The value is an offset into the `Function` `code` from the beginning. /// To perform the reloc, write 32-bit signed little-endian integer /// which is a relative jump, based on the address following the reloc. -epilogue_relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty, +epilogue_relocs: std.ArrayList(Mir.Inst.Index) = .empty, reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined, inst_tracking: InstTrackingMap = .empty, @@ -156,7 +156,7 @@ loop_switches: std.AutoHashMapUnmanaged(Air.Inst.Index, struct { min: Value, else_relocs: union(enum) { @"unreachable", - forward: std.ArrayListUnmanaged(Mir.Inst.Index), + forward: std.ArrayList(Mir.Inst.Index), backward: Mir.Inst.Index, }, }) = .empty, @@ -855,7 +855,7 @@ const FrameAlloc = struct { }; const BlockData = struct { - relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty, + relocs: std.ArrayList(Mir.Inst.Index) = .empty, state: State, fn deinit(self: *BlockData, gpa: Allocator) void { @@ -177329,7 +177329,7 @@ fn airAsm(self: *CodeGen, inst: Air.Inst.Index) !void { const Label = struct { target: Mir.Inst.Index = undefined, - pending_relocs: std.ArrayListUnmanaged(Mir.Inst.Index) = .empty, + pending_relocs: std.ArrayList(Mir.Inst.Index) = .empty, const Kind = enum { definition, reference }; diff --git a/src/codegen/x86_64/Emit.zig b/src/codegen/x86_64/Emit.zig index 206b3414e3..18846aaf99 100644 --- a/src/codegen/x86_64/Emit.zig +++ b/src/codegen/x86_64/Emit.zig @@ -12,9 +12,9 @@ prev_di_loc: Loc, /// Relative to the beginning of `code`. prev_di_pc: usize, -code_offset_mapping: std.ArrayListUnmanaged(u32), -relocs: std.ArrayListUnmanaged(Reloc), -table_relocs: std.ArrayListUnmanaged(TableReloc), +code_offset_mapping: std.ArrayList(u32), +relocs: std.ArrayList(Reloc), +table_relocs: std.ArrayList(TableReloc), pub const Error = Lower.Error || error{ EmitFail, diff --git a/src/link.zig b/src/link.zig index b0964d6f86..31ba3aca7d 100644 --- a/src/link.zig +++ b/src/link.zig @@ -35,9 +35,9 @@ pub const Diags = struct { /// needing an allocator for things besides error reporting. gpa: Allocator, mutex: std.Thread.Mutex, - msgs: std.ArrayListUnmanaged(Msg), + msgs: std.ArrayList(Msg), flags: Flags, - lld: std.ArrayListUnmanaged(Lld), + lld: std.ArrayList(Lld), pub const SourceLocation = union(enum) { none, @@ -1775,19 +1775,19 @@ pub fn resolveInputs( target: *const std.Target, /// This function mutates this array but does not take ownership. /// Allocated with `gpa`. - unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput), + unresolved_inputs: *std.ArrayList(UnresolvedInput), /// Allocated with `gpa`. - resolved_inputs: *std.ArrayListUnmanaged(Input), + resolved_inputs: *std.ArrayList(Input), lib_directories: []const Cache.Directory, color: std.zig.Color, ) Allocator.Error!void { - var checked_paths: std.ArrayListUnmanaged(u8) = .empty; + var checked_paths: std.ArrayList(u8) = .empty; defer checked_paths.deinit(gpa); - var ld_script_bytes: std.ArrayListUnmanaged(u8) = .empty; + var ld_script_bytes: std.ArrayList(u8) = .empty; defer ld_script_bytes.deinit(gpa); - var failed_libs: std.ArrayListUnmanaged(struct { + var failed_libs: std.ArrayList(struct { name: []const u8, strategy: UnresolvedInput.SearchStrategy, checked_paths: []const u8, @@ -2007,13 +2007,13 @@ fn resolveLibInput( gpa: Allocator, arena: Allocator, /// Allocated via `gpa`. - unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput), + unresolved_inputs: *std.ArrayList(UnresolvedInput), /// Allocated via `gpa`. - resolved_inputs: *std.ArrayListUnmanaged(Input), + resolved_inputs: *std.ArrayList(Input), /// Allocated via `gpa`. - checked_paths: *std.ArrayListUnmanaged(u8), + checked_paths: *std.ArrayList(u8), /// Allocated via `gpa`. - ld_script_bytes: *std.ArrayListUnmanaged(u8), + ld_script_bytes: *std.ArrayList(u8), lib_directory: Directory, name_query: UnresolvedInput.NameQuery, target: *const std.Target, @@ -2097,7 +2097,7 @@ fn resolveLibInput( } fn finishResolveLibInput( - resolved_inputs: *std.ArrayListUnmanaged(Input), + resolved_inputs: *std.ArrayList(Input), path: Path, file: std.fs.File, link_mode: std.builtin.LinkMode, @@ -2125,11 +2125,11 @@ fn resolvePathInput( gpa: Allocator, arena: Allocator, /// Allocated with `gpa`. - unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput), + unresolved_inputs: *std.ArrayList(UnresolvedInput), /// Allocated with `gpa`. - resolved_inputs: *std.ArrayListUnmanaged(Input), + resolved_inputs: *std.ArrayList(Input), /// Allocated via `gpa`. - ld_script_bytes: *std.ArrayListUnmanaged(u8), + ld_script_bytes: *std.ArrayList(u8), target: *const std.Target, pq: UnresolvedInput.PathQuery, color: std.zig.Color, @@ -2167,11 +2167,11 @@ fn resolvePathInputLib( gpa: Allocator, arena: Allocator, /// Allocated with `gpa`. - unresolved_inputs: *std.ArrayListUnmanaged(UnresolvedInput), + unresolved_inputs: *std.ArrayList(UnresolvedInput), /// Allocated with `gpa`. - resolved_inputs: *std.ArrayListUnmanaged(Input), + resolved_inputs: *std.ArrayList(Input), /// Allocated via `gpa`. - ld_script_bytes: *std.ArrayListUnmanaged(u8), + ld_script_bytes: *std.ArrayList(u8), target: *const std.Target, pq: UnresolvedInput.PathQuery, link_mode: std.builtin.LinkMode, diff --git a/src/link/C.zig b/src/link/C.zig index 5f08f53654..ce48e85851 100644 --- a/src/link/C.zig +++ b/src/link/C.zig @@ -29,7 +29,7 @@ navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvBlock), /// All the string bytes of rendered C code, all squished into one array. /// While in progress, a separate buffer is used, and then when finished, the /// buffer is copied into this one. -string_bytes: std.ArrayListUnmanaged(u8), +string_bytes: std.ArrayList(u8), /// Tracks all the anonymous decls that are used by all the decls so they can /// be rendered during flush(). uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, AvBlock), @@ -519,16 +519,16 @@ pub fn flush(self: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.P const Flush = struct { ctype_pool: codegen.CType.Pool, - ctype_global_from_decl_map: std.ArrayListUnmanaged(codegen.CType), - ctypes: std.ArrayListUnmanaged(u8), + ctype_global_from_decl_map: std.ArrayList(codegen.CType), + ctypes: std.ArrayList(u8), lazy_ctype_pool: codegen.CType.Pool, lazy_fns: LazyFns, - lazy_fwd_decl: std.ArrayListUnmanaged(u8), - lazy_code: std.ArrayListUnmanaged(u8), + lazy_fwd_decl: std.ArrayList(u8), + lazy_code: std.ArrayList(u8), /// We collect a list of buffers to write, and write them all at once with pwritev 😎 - all_buffers: std.ArrayListUnmanaged([]const u8), + all_buffers: std.ArrayList([]const u8), /// Keeps track of the total bytes of `all_buffers`. file_size: u64, diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig index e8fea3c988..1fd1840da7 100644 --- a/src/link/Dwarf.zig +++ b/src/link/Dwarf.zig @@ -211,7 +211,7 @@ const DebugRngLists = struct { }; const StringSection = struct { - contents: std.ArrayListUnmanaged(u8), + contents: std.ArrayList(u8), map: std.AutoArrayHashMapUnmanaged(void, void), section: Section, @@ -275,7 +275,7 @@ pub const Section = struct { first: Unit.Index.Optional, last: Unit.Index.Optional, len: u64, - units: std.ArrayListUnmanaged(Unit), + units: std.ArrayList(Unit), pub const Index = enum { debug_abbrev, @@ -511,9 +511,9 @@ const Unit = struct { trailer_len: u32, /// data length in bytes len: u32, - entries: std.ArrayListUnmanaged(Entry), - cross_unit_relocs: std.ArrayListUnmanaged(CrossUnitReloc), - cross_section_relocs: std.ArrayListUnmanaged(CrossSectionReloc), + entries: std.ArrayList(Entry), + cross_unit_relocs: std.ArrayList(CrossUnitReloc), + cross_section_relocs: std.ArrayList(CrossSectionReloc), const Index = enum(u32) { main, @@ -790,10 +790,10 @@ const Entry = struct { off: u32, /// data length in bytes len: u32, - cross_entry_relocs: std.ArrayListUnmanaged(CrossEntryReloc), - cross_unit_relocs: std.ArrayListUnmanaged(CrossUnitReloc), - cross_section_relocs: std.ArrayListUnmanaged(CrossSectionReloc), - external_relocs: std.ArrayListUnmanaged(ExternalReloc), + cross_entry_relocs: std.ArrayList(CrossEntryReloc), + cross_unit_relocs: std.ArrayList(CrossUnitReloc), + cross_section_relocs: std.ArrayList(CrossSectionReloc), + external_relocs: std.ArrayList(ExternalReloc), fn clear(entry: *Entry) void { entry.cross_entry_relocs.clearRetainingCapacity(); @@ -1474,7 +1474,7 @@ pub const WipNav = struct { func: InternPool.Index, func_sym_index: u32, func_high_pc: u32, - blocks: std.ArrayListUnmanaged(struct { + blocks: std.ArrayList(struct { abbrev_code: u32, low_pc_off: u64, high_pc: u32, @@ -2300,8 +2300,8 @@ pub const WipNav = struct { } const PendingLazy = struct { - types: std.ArrayListUnmanaged(InternPool.Index), - values: std.ArrayListUnmanaged(InternPool.Index), + types: std.ArrayList(InternPool.Index), + values: std.ArrayList(InternPool.Index), const empty: PendingLazy = .{ .types = .empty, .values = .empty }; }; diff --git a/src/link/Elf.zig b/src/link/Elf.zig index 1a7cb4c14a..fa41c6b1de 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -26,10 +26,10 @@ files: std.MultiArrayList(File.Entry) = .{}, /// Long-lived list of all file descriptors. /// We store them globally rather than per actual File so that we can re-use /// one file handle per every object file within an archive. -file_handles: std.ArrayListUnmanaged(File.Handle) = .empty, +file_handles: std.ArrayList(File.Handle) = .empty, zig_object_index: ?File.Index = null, linker_defined_index: ?File.Index = null, -objects: std.ArrayListUnmanaged(File.Index) = .empty, +objects: std.ArrayList(File.Index) = .empty, shared_objects: std.StringArrayHashMapUnmanaged(File.Index) = .empty, /// List of all output sections and their associated metadata. @@ -49,23 +49,23 @@ page_size: u32, default_sym_version: elf.Versym, /// .shstrtab buffer -shstrtab: std.ArrayListUnmanaged(u8) = .empty, +shstrtab: std.ArrayList(u8) = .empty, /// .symtab buffer -symtab: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty, +symtab: std.ArrayList(elf.Elf64_Sym) = .empty, /// .strtab buffer -strtab: std.ArrayListUnmanaged(u8) = .empty, +strtab: std.ArrayList(u8) = .empty, /// Dynamic symbol table. Only populated and emitted when linking dynamically. dynsym: DynsymSection = .{}, /// .dynstrtab buffer -dynstrtab: std.ArrayListUnmanaged(u8) = .empty, +dynstrtab: std.ArrayList(u8) = .empty, /// Version symbol table. Only populated and emitted when linking dynamically. -versym: std.ArrayListUnmanaged(elf.Versym) = .empty, +versym: std.ArrayList(elf.Versym) = .empty, /// .verneed section verneed: VerneedSection = .{}, /// .got section got: GotSection = .{}, /// .rela.dyn section -rela_dyn: std.ArrayListUnmanaged(elf.Elf64_Rela) = .empty, +rela_dyn: std.ArrayList(elf.Elf64_Rela) = .empty, /// .dynamic section dynamic: DynamicSection = .{}, /// .hash section @@ -81,10 +81,10 @@ plt_got: PltGotSection = .{}, /// .copyrel section copy_rel: CopyRelSection = .{}, /// .rela.plt section -rela_plt: std.ArrayListUnmanaged(elf.Elf64_Rela) = .empty, +rela_plt: std.ArrayList(elf.Elf64_Rela) = .empty, /// SHT_GROUP sections /// Applies only to a relocatable. -group_sections: std.ArrayListUnmanaged(GroupSection) = .empty, +group_sections: std.ArrayList(GroupSection) = .empty, resolver: SymbolResolver = .{}, @@ -92,15 +92,15 @@ has_text_reloc: bool = false, num_ifunc_dynrelocs: usize = 0, /// List of range extension thunks. -thunks: std.ArrayListUnmanaged(Thunk) = .empty, +thunks: std.ArrayList(Thunk) = .empty, /// List of output merge sections with deduped contents. -merge_sections: std.ArrayListUnmanaged(Merge.Section) = .empty, +merge_sections: std.ArrayList(Merge.Section) = .empty, comment_merge_section_index: ?Merge.Section.Index = null, /// `--verbose-link` output. /// Initialized on creation, appended to as inputs are added, printed during `flush`. -dump_argv_list: std.ArrayListUnmanaged([]const u8), +dump_argv_list: std.ArrayList([]const u8), const SectionIndexes = struct { copy_rel: ?u32 = null, @@ -127,7 +127,7 @@ const SectionIndexes = struct { symtab: ?u32 = null, }; -const ProgramHeaderList = std.ArrayListUnmanaged(elf.Elf64_Phdr); +const ProgramHeaderList = std.ArrayList(elf.Elf64_Phdr); const OptionalProgramHeaderIndex = enum(u16) { none = std.math.maxInt(u16), @@ -1098,12 +1098,12 @@ fn parseObject(self: *Elf, obj: link.Input.Object) !void { fn parseArchive( gpa: Allocator, diags: *Diags, - file_handles: *std.ArrayListUnmanaged(File.Handle), + file_handles: *std.ArrayList(File.Handle), files: *std.MultiArrayList(File.Entry), target: *const std.Target, debug_fmt_strip: bool, default_sym_version: elf.Versym, - objects: *std.ArrayListUnmanaged(File.Index), + objects: *std.ArrayList(File.Index), obj: link.Input.Object, is_static_lib: bool, ) !void { @@ -1748,7 +1748,7 @@ pub fn deleteExport( fn checkDuplicates(self: *Elf) !void { const gpa = self.base.comp.gpa; - var dupes = std.AutoArrayHashMap(SymbolResolver.Index, std.ArrayListUnmanaged(File.Index)).init(gpa); + var dupes = std.AutoArrayHashMap(SymbolResolver.Index, std.ArrayList(File.Index)).init(gpa); defer { for (dupes.values()) |*list| { list.deinit(gpa); @@ -3647,7 +3647,7 @@ fn fileLookup(files: std.MultiArrayList(File.Entry), index: File.Index, zig_obje pub fn addFileHandle( gpa: Allocator, - file_handles: *std.ArrayListUnmanaged(File.Handle), + file_handles: *std.ArrayList(File.Handle), handle: fs.File, ) Allocator.Error!File.HandleIndex { try file_handles.append(gpa, handle); @@ -4204,8 +4204,8 @@ pub const Ref = struct { }; pub const SymbolResolver = struct { - keys: std.ArrayListUnmanaged(Key) = .empty, - values: std.ArrayListUnmanaged(Ref) = .empty, + keys: std.ArrayList(Key) = .empty, + values: std.ArrayList(Ref) = .empty, table: std.AutoArrayHashMapUnmanaged(void, void) = .empty, const Result = struct { @@ -4303,7 +4303,7 @@ const Section = struct { /// List of atoms contributing to this section. /// TODO currently this is only used for relocations tracking in relocatable mode /// but will be merged with atom_list_2. - atom_list: std.ArrayListUnmanaged(Ref) = .empty, + atom_list: std.ArrayList(Ref) = .empty, /// List of atoms contributing to this section. /// This can be used by sections that require special handling such as init/fini array, etc. @@ -4327,7 +4327,7 @@ const Section = struct { /// overcapacity can be negative. A simple way to have negative overcapacity is to /// allocate a fresh text block, which will have ideal capacity, and then grow it /// by 1 byte. It will then have -1 overcapacity. - free_list: std.ArrayListUnmanaged(Ref) = .empty, + free_list: std.ArrayList(Ref) = .empty, }; pub fn sectionSize(self: *Elf, shndx: u32) u64 { diff --git a/src/link/Elf/Archive.zig b/src/link/Elf/Archive.zig index dc9b6f2edf..a9961bf8f9 100644 --- a/src/link/Elf/Archive.zig +++ b/src/link/Elf/Archive.zig @@ -11,7 +11,7 @@ pub fn deinit(a: *Archive, gpa: Allocator) void { pub fn parse( gpa: Allocator, diags: *Diags, - file_handles: *const std.ArrayListUnmanaged(File.Handle), + file_handles: *const std.ArrayList(File.Handle), path: Path, handle_index: File.HandleIndex, ) !Archive { @@ -27,10 +27,10 @@ pub fn parse( const size = (try handle.stat()).size; - var objects: std.ArrayListUnmanaged(Object) = .empty; + var objects: std.ArrayList(Object) = .empty; defer objects.deinit(gpa); - var strtab: std.ArrayListUnmanaged(u8) = .empty; + var strtab: std.ArrayList(u8) = .empty; defer strtab.deinit(gpa); while (pos < size) { @@ -145,7 +145,7 @@ const strtab_delimiter = '\n'; pub const max_member_name_len = 15; pub const ArSymtab = struct { - symtab: std.ArrayListUnmanaged(Entry) = .empty, + symtab: std.ArrayList(Entry) = .empty, strtab: StringTable = .{}, pub fn deinit(ar: *ArSymtab, allocator: Allocator) void { @@ -239,7 +239,7 @@ pub const ArSymtab = struct { }; pub const ArStrtab = struct { - buffer: std.ArrayListUnmanaged(u8) = .empty, + buffer: std.ArrayList(u8) = .empty, pub fn deinit(ar: *ArStrtab, allocator: Allocator) void { ar.buffer.deinit(allocator); diff --git a/src/link/Elf/AtomList.zig b/src/link/Elf/AtomList.zig index 4eb1cbdbbd..8fdf555115 100644 --- a/src/link/Elf/AtomList.zig +++ b/src/link/Elf/AtomList.zig @@ -2,7 +2,7 @@ value: i64 = 0, size: u64 = 0, alignment: Atom.Alignment = .@"1", output_section_index: u32 = 0, -// atoms: std.ArrayListUnmanaged(Elf.Ref) = .empty, +// atoms: std.ArrayList(Elf.Ref) = .empty, atoms: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty, dirty: bool = true, diff --git a/src/link/Elf/LinkerDefined.zig b/src/link/Elf/LinkerDefined.zig index d7e3cf62f3..3704de0dd7 100644 --- a/src/link/Elf/LinkerDefined.zig +++ b/src/link/Elf/LinkerDefined.zig @@ -1,11 +1,11 @@ index: File.Index, -symtab: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty, -strtab: std.ArrayListUnmanaged(u8) = .empty, +symtab: std.ArrayList(elf.Elf64_Sym) = .empty, +strtab: std.ArrayList(u8) = .empty, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index) = .empty, entry_index: ?Symbol.Index = null, dynamic_index: ?Symbol.Index = null, @@ -24,7 +24,7 @@ dso_handle_index: ?Symbol.Index = null, rela_iplt_start_index: ?Symbol.Index = null, rela_iplt_end_index: ?Symbol.Index = null, global_pointer_index: ?Symbol.Index = null, -start_stop_indexes: std.ArrayListUnmanaged(u32) = .empty, +start_stop_indexes: std.ArrayList(u32) = .empty, output_symtab_ctx: Elf.SymtabCtx = .{}, diff --git a/src/link/Elf/Merge.zig b/src/link/Elf/Merge.zig index 340a2e7f67..fb5bdaae08 100644 --- a/src/link/Elf/Merge.zig +++ b/src/link/Elf/Merge.zig @@ -7,15 +7,15 @@ pub const Section = struct { type: u32 = 0, flags: u64 = 0, output_section_index: u32 = 0, - bytes: std.ArrayListUnmanaged(u8) = .empty, + bytes: std.ArrayList(u8) = .empty, table: std.HashMapUnmanaged( String, Subsection.Index, IndexContext, std.hash_map.default_max_load_percentage, ) = .{}, - subsections: std.ArrayListUnmanaged(Subsection) = .empty, - finalized_subsections: std.ArrayListUnmanaged(Subsection.Index) = .empty, + subsections: std.ArrayList(Subsection) = .empty, + finalized_subsections: std.ArrayList(Subsection.Index) = .empty, pub fn deinit(msec: *Section, allocator: Allocator) void { msec.bytes.deinit(allocator); @@ -240,10 +240,10 @@ pub const Subsection = struct { pub const InputSection = struct { merge_section_index: Section.Index = 0, atom_index: Atom.Index = 0, - offsets: std.ArrayListUnmanaged(u32) = .empty, - subsections: std.ArrayListUnmanaged(Subsection.Index) = .empty, - bytes: std.ArrayListUnmanaged(u8) = .empty, - strings: std.ArrayListUnmanaged(String) = .empty, + offsets: std.ArrayList(u32) = .empty, + subsections: std.ArrayList(Subsection.Index) = .empty, + bytes: std.ArrayList(u8) = .empty, + strings: std.ArrayList(String) = .empty, pub fn deinit(imsec: *InputSection, allocator: Allocator) void { imsec.offsets.deinit(allocator); diff --git a/src/link/Elf/Object.zig b/src/link/Elf/Object.zig index 98f3e26431..d51a82b266 100644 --- a/src/link/Elf/Object.zig +++ b/src/link/Elf/Object.zig @@ -6,29 +6,29 @@ file_handle: File.HandleIndex, index: File.Index, header: ?elf.Elf64_Ehdr = null, -shdrs: std.ArrayListUnmanaged(elf.Elf64_Shdr) = .empty, +shdrs: std.ArrayList(elf.Elf64_Shdr) = .empty, -symtab: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty, -strtab: std.ArrayListUnmanaged(u8) = .empty, +symtab: std.ArrayList(elf.Elf64_Sym) = .empty, +strtab: std.ArrayList(u8) = .empty, first_global: ?Symbol.Index = null, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index) = .empty, -relocs: std.ArrayListUnmanaged(elf.Elf64_Rela) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index) = .empty, +relocs: std.ArrayList(elf.Elf64_Rela) = .empty, -atoms: std.ArrayListUnmanaged(Atom) = .empty, -atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty, -atoms_extra: std.ArrayListUnmanaged(u32) = .empty, +atoms: std.ArrayList(Atom) = .empty, +atoms_indexes: std.ArrayList(Atom.Index) = .empty, +atoms_extra: std.ArrayList(u32) = .empty, -groups: std.ArrayListUnmanaged(Elf.Group) = .empty, -group_data: std.ArrayListUnmanaged(u32) = .empty, +groups: std.ArrayList(Elf.Group) = .empty, +group_data: std.ArrayList(u32) = .empty, -input_merge_sections: std.ArrayListUnmanaged(Merge.InputSection) = .empty, -input_merge_sections_indexes: std.ArrayListUnmanaged(Merge.InputSection.Index) = .empty, +input_merge_sections: std.ArrayList(Merge.InputSection) = .empty, +input_merge_sections_indexes: std.ArrayList(Merge.InputSection.Index) = .empty, -fdes: std.ArrayListUnmanaged(Fde) = .empty, -cies: std.ArrayListUnmanaged(Cie) = .empty, -eh_frame_data: std.ArrayListUnmanaged(u8) = .empty, +fdes: std.ArrayList(Fde) = .empty, +cies: std.ArrayList(Cie) = .empty, +eh_frame_data: std.ArrayList(u8) = .empty, alive: bool = true, dirty: bool = true, diff --git a/src/link/Elf/SharedObject.zig b/src/link/Elf/SharedObject.zig index 4dce40e370..1e17aa34a8 100644 --- a/src/link/Elf/SharedObject.zig +++ b/src/link/Elf/SharedObject.zig @@ -3,11 +3,11 @@ index: File.Index, parsed: Parsed, -symbols: std.ArrayListUnmanaged(Symbol), -symbols_extra: std.ArrayListUnmanaged(u32), -symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index), +symbols: std.ArrayList(Symbol), +symbols_extra: std.ArrayList(u32), +symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index), -aliases: ?std.ArrayListUnmanaged(u32), +aliases: ?std.ArrayList(u32), needed: bool, alive: bool, @@ -35,7 +35,7 @@ pub const Header = struct { verdef_sect_index: ?u32, stat: Stat, - strtab: std.ArrayListUnmanaged(u8), + strtab: std.ArrayList(u8), pub fn deinit(header: *Header, gpa: Allocator) void { gpa.free(header.sections); @@ -149,7 +149,7 @@ pub fn parseHeader( } else &.{}; errdefer gpa.free(dynamic_table); - var strtab: std.ArrayListUnmanaged(u8) = .empty; + var strtab: std.ArrayList(u8) = .empty; errdefer strtab.deinit(gpa); if (dynsym_sect_index) |index| { @@ -206,7 +206,7 @@ pub fn parse( } else &.{}; defer gpa.free(symtab); - var verstrings: std.ArrayListUnmanaged(u32) = .empty; + var verstrings: std.ArrayList(u32) = .empty; defer verstrings.deinit(gpa); if (header.verdef_sect_index) |shndx| { @@ -243,13 +243,13 @@ pub fn parse( } else &.{}; defer gpa.free(versyms); - var nonlocal_esyms: std.ArrayListUnmanaged(elf.Elf64_Sym) = .empty; + var nonlocal_esyms: std.ArrayList(elf.Elf64_Sym) = .empty; defer nonlocal_esyms.deinit(gpa); - var nonlocal_versyms: std.ArrayListUnmanaged(elf.Versym) = .empty; + var nonlocal_versyms: std.ArrayList(elf.Versym) = .empty; defer nonlocal_versyms.deinit(gpa); - var nonlocal_symbols: std.ArrayListUnmanaged(Parsed.Symbol) = .empty; + var nonlocal_symbols: std.ArrayList(Parsed.Symbol) = .empty; defer nonlocal_symbols.deinit(gpa); var strtab = header.strtab; diff --git a/src/link/Elf/ZigObject.zig b/src/link/Elf/ZigObject.zig index a3ede11dc4..a77858f06c 100644 --- a/src/link/Elf/ZigObject.zig +++ b/src/link/Elf/ZigObject.zig @@ -3,24 +3,24 @@ //! and any relocations that may have been emitted. //! Think about this as fake in-memory Object file for the Zig module. -data: std.ArrayListUnmanaged(u8) = .empty, +data: std.ArrayList(u8) = .empty, /// Externally owned memory. basename: []const u8, index: File.Index, symtab: std.MultiArrayList(ElfSym) = .{}, strtab: StringTable = .{}, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -symbols_resolver: std.ArrayListUnmanaged(Elf.SymbolResolver.Index) = .empty, -local_symbols: std.ArrayListUnmanaged(Symbol.Index) = .empty, -global_symbols: std.ArrayListUnmanaged(Symbol.Index) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +symbols_resolver: std.ArrayList(Elf.SymbolResolver.Index) = .empty, +local_symbols: std.ArrayList(Symbol.Index) = .empty, +global_symbols: std.ArrayList(Symbol.Index) = .empty, globals_lookup: std.AutoHashMapUnmanaged(u32, Symbol.Index) = .empty, -atoms: std.ArrayListUnmanaged(Atom) = .empty, -atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty, -atoms_extra: std.ArrayListUnmanaged(u32) = .empty, -relocs: std.ArrayListUnmanaged(std.ArrayListUnmanaged(elf.Elf64_Rela)) = .empty, +atoms: std.ArrayList(Atom) = .empty, +atoms_indexes: std.ArrayList(Atom.Index) = .empty, +atoms_extra: std.ArrayList(u32) = .empty, +relocs: std.ArrayList(std.ArrayList(elf.Elf64_Rela)) = .empty, num_dynrelocs: u32 = 0, @@ -2369,7 +2369,7 @@ const LazySymbolMetadata = struct { const AvMetadata = struct { symbol_index: Symbol.Index, /// A list of all exports aliases of this Av. - exports: std.ArrayListUnmanaged(Symbol.Index) = .empty, + exports: std.ArrayList(Symbol.Index) = .empty, /// Set to true if the AV has been initialized and allocated. allocated: bool = false, @@ -2417,7 +2417,7 @@ const TlsVariable = struct { } }; -const AtomList = std.ArrayListUnmanaged(Atom.Index); +const AtomList = std.ArrayList(Atom.Index); const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata); const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata); const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata); diff --git a/src/link/Elf/synthetic_sections.zig b/src/link/Elf/synthetic_sections.zig index 839d10dfbc..27878204bb 100644 --- a/src/link/Elf/synthetic_sections.zig +++ b/src/link/Elf/synthetic_sections.zig @@ -1,6 +1,6 @@ pub const DynamicSection = struct { soname: ?u32 = null, - needed: std.ArrayListUnmanaged(u32) = .empty, + needed: std.ArrayList(u32) = .empty, rpath: u32 = 0, pub fn deinit(dt: *DynamicSection, allocator: Allocator) void { @@ -226,7 +226,7 @@ pub const DynamicSection = struct { }; pub const GotSection = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, + entries: std.ArrayList(Entry) = .empty, output_symtab_ctx: Elf.SymtabCtx = .{}, tlsld_index: ?u32 = null, flags: Flags = .{}, @@ -628,7 +628,7 @@ pub const GotSection = struct { }; pub const PltSection = struct { - symbols: std.ArrayListUnmanaged(Elf.Ref) = .empty, + symbols: std.ArrayList(Elf.Ref) = .empty, output_symtab_ctx: Elf.SymtabCtx = .{}, pub fn deinit(plt: *PltSection, allocator: Allocator) void { @@ -875,7 +875,7 @@ pub const GotPltSection = struct { }; pub const PltGotSection = struct { - symbols: std.ArrayListUnmanaged(Elf.Ref) = .empty, + symbols: std.ArrayList(Elf.Ref) = .empty, output_symtab_ctx: Elf.SymtabCtx = .{}, pub fn deinit(plt_got: *PltGotSection, allocator: Allocator) void { @@ -981,7 +981,7 @@ pub const PltGotSection = struct { }; pub const CopyRelSection = struct { - symbols: std.ArrayListUnmanaged(Elf.Ref) = .empty, + symbols: std.ArrayList(Elf.Ref) = .empty, pub fn deinit(copy_rel: *CopyRelSection, allocator: Allocator) void { copy_rel.symbols.deinit(allocator); @@ -1062,7 +1062,7 @@ pub const CopyRelSection = struct { }; pub const DynsymSection = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, + entries: std.ArrayList(Entry) = .empty, pub const Entry = struct { /// Ref of the symbol which gets privilege of getting a dynamic treatment @@ -1146,7 +1146,7 @@ pub const DynsymSection = struct { }; pub const HashSection = struct { - buffer: std.ArrayListUnmanaged(u8) = .empty, + buffer: std.ArrayList(u8) = .empty, pub fn deinit(hs: *HashSection, allocator: Allocator) void { hs.buffer.deinit(allocator); @@ -1307,8 +1307,8 @@ pub const GnuHashSection = struct { }; pub const VerneedSection = struct { - verneed: std.ArrayListUnmanaged(elf.Elf64_Verneed) = .empty, - vernaux: std.ArrayListUnmanaged(elf.Vernaux) = .empty, + verneed: std.ArrayList(elf.Elf64_Verneed) = .empty, + vernaux: std.ArrayList(elf.Vernaux) = .empty, index: elf.Versym = .{ .VERSION = elf.Versym.GLOBAL.VERSION + 1, .HIDDEN = false }, pub fn deinit(vern: *VerneedSection, allocator: Allocator) void { diff --git a/src/link/LdScript.zig b/src/link/LdScript.zig index 534f9766bb..43c196442f 100644 --- a/src/link/LdScript.zig +++ b/src/link/LdScript.zig @@ -26,9 +26,9 @@ pub fn parse( data: []const u8, ) Error!LdScript { var tokenizer = Tokenizer{ .source = data }; - var tokens: std.ArrayListUnmanaged(Token) = .empty; + var tokens: std.ArrayList(Token) = .empty; defer tokens.deinit(gpa); - var line_col: std.ArrayListUnmanaged(LineColumn) = .empty; + var line_col: std.ArrayList(LineColumn) = .empty; defer line_col.deinit(gpa); var line: usize = 0; @@ -117,7 +117,7 @@ const Parser = struct { it: *TokenIterator, cpu_arch: ?std.Target.Cpu.Arch, - args: std.ArrayListUnmanaged(Arg), + args: std.ArrayList(Arg), fn start(parser: *Parser) !void { while (true) { diff --git a/src/link/Lld.zig b/src/link/Lld.zig index 6b8307fa1a..7b1e34df78 100644 --- a/src/link/Lld.zig +++ b/src/link/Lld.zig @@ -312,7 +312,7 @@ fn linkAsArchive(lld: *Lld, arena: Allocator) !void { const link_inputs = comp.link_inputs; - var object_files: std.ArrayListUnmanaged([*:0]const u8) = .empty; + var object_files: std.ArrayList([*:0]const u8) = .empty; try object_files.ensureUnusedCapacity(arena, link_inputs.len); for (link_inputs) |input| { diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 7c6708983c..035bd60155 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -16,13 +16,13 @@ files: std.MultiArrayList(File.Entry) = .{}, /// Long-lived list of all file descriptors. /// We store them globally rather than per actual File so that we can re-use /// one file handle per every object file within an archive. -file_handles: std.ArrayListUnmanaged(File.Handle) = .empty, +file_handles: std.ArrayList(File.Handle) = .empty, zig_object: ?File.Index = null, internal_object: ?File.Index = null, -objects: std.ArrayListUnmanaged(File.Index) = .empty, -dylibs: std.ArrayListUnmanaged(File.Index) = .empty, +objects: std.ArrayList(File.Index) = .empty, +dylibs: std.ArrayList(File.Index) = .empty, -segments: std.ArrayListUnmanaged(macho.segment_command_64) = .empty, +segments: std.ArrayList(macho.segment_command_64) = .empty, sections: std.MultiArrayList(Section) = .{}, resolver: SymbolResolver = .{}, @@ -30,7 +30,7 @@ resolver: SymbolResolver = .{}, /// Key is symbol index. undefs: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, UndefRefs) = .empty, undefs_mutex: std.Thread.Mutex = .{}, -dupes: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, std.ArrayListUnmanaged(File.Index)) = .empty, +dupes: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, std.ArrayList(File.Index)) = .empty, dupes_mutex: std.Thread.Mutex = .{}, dyld_info_cmd: macho.dyld_info_command = .{}, @@ -55,11 +55,11 @@ eh_frame_sect_index: ?u8 = null, unwind_info_sect_index: ?u8 = null, objc_stubs_sect_index: ?u8 = null, -thunks: std.ArrayListUnmanaged(Thunk) = .empty, +thunks: std.ArrayList(Thunk) = .empty, /// Output synthetic sections -symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty, -strtab: std.ArrayListUnmanaged(u8) = .empty, +symtab: std.ArrayList(macho.nlist_64) = .empty, +strtab: std.ArrayList(u8) = .empty, indsymtab: Indsymtab = .{}, got: GotSection = .{}, stubs: StubsSection = .{}, @@ -4041,19 +4041,19 @@ const default_entry_symbol_name = "_main"; const Section = struct { header: macho.section_64, segment_id: u8, - atoms: std.ArrayListUnmanaged(Ref) = .empty, - free_list: std.ArrayListUnmanaged(Atom.Index) = .empty, + atoms: std.ArrayList(Ref) = .empty, + free_list: std.ArrayList(Atom.Index) = .empty, last_atom_index: Atom.Index = 0, - thunks: std.ArrayListUnmanaged(Thunk.Index) = .empty, - out: std.ArrayListUnmanaged(u8) = .empty, - relocs: std.ArrayListUnmanaged(macho.relocation_info) = .empty, + thunks: std.ArrayList(Thunk.Index) = .empty, + out: std.ArrayList(u8) = .empty, + relocs: std.ArrayList(macho.relocation_info) = .empty, }; pub const LiteralPool = struct { table: std.AutoArrayHashMapUnmanaged(void, void) = .empty, - keys: std.ArrayListUnmanaged(Key) = .empty, - values: std.ArrayListUnmanaged(MachO.Ref) = .empty, - data: std.ArrayListUnmanaged(u8) = .empty, + keys: std.ArrayList(Key) = .empty, + values: std.ArrayList(MachO.Ref) = .empty, + data: std.ArrayList(u8) = .empty, pub fn deinit(lp: *LiteralPool, allocator: Allocator) void { lp.table.deinit(allocator); @@ -4485,8 +4485,8 @@ pub const Ref = struct { }; pub const SymbolResolver = struct { - keys: std.ArrayListUnmanaged(Key) = .empty, - values: std.ArrayListUnmanaged(Ref) = .empty, + keys: std.ArrayList(Key) = .empty, + values: std.ArrayList(Ref) = .empty, table: std.AutoArrayHashMapUnmanaged(void, void) = .empty, const Result = struct { @@ -4586,7 +4586,7 @@ pub const UndefRefs = union(enum) { entry, dyld_stub_binder, objc_msgsend, - refs: std.ArrayListUnmanaged(Ref), + refs: std.ArrayList(Ref), pub fn deinit(self: *UndefRefs, allocator: Allocator) void { switch (self.*) { diff --git a/src/link/MachO/Archive.zig b/src/link/MachO/Archive.zig index 058efdbafc..d1962412c4 100644 --- a/src/link/MachO/Archive.zig +++ b/src/link/MachO/Archive.zig @@ -1,4 +1,4 @@ -objects: std.ArrayListUnmanaged(Object) = .empty, +objects: std.ArrayList(Object) = .empty, pub fn deinit(self: *Archive, allocator: Allocator) void { self.objects.deinit(allocator); @@ -172,7 +172,7 @@ pub const ar_hdr = extern struct { }; pub const ArSymtab = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, + entries: std.ArrayList(Entry) = .empty, strtab: StringTable = .{}, pub fn deinit(ar: *ArSymtab, allocator: Allocator) void { diff --git a/src/link/MachO/CodeSignature.zig b/src/link/MachO/CodeSignature.zig index 00b01a6eab..0390cc2fe4 100644 --- a/src/link/MachO/CodeSignature.zig +++ b/src/link/MachO/CodeSignature.zig @@ -53,7 +53,7 @@ const CodeDirectory = struct { inner: macho.CodeDirectory, ident: []const u8, special_slots: [n_special_slots][hash_size]u8, - code_slots: std.ArrayListUnmanaged([hash_size]u8) = .empty, + code_slots: std.ArrayList([hash_size]u8) = .empty, const n_special_slots: usize = 7; diff --git a/src/link/MachO/DebugSymbols.zig b/src/link/MachO/DebugSymbols.zig index a7aea586ad..5d7b9b88c3 100644 --- a/src/link/MachO/DebugSymbols.zig +++ b/src/link/MachO/DebugSymbols.zig @@ -4,8 +4,8 @@ file: ?fs.File, symtab_cmd: macho.symtab_command = .{}, uuid_cmd: macho.uuid_command = .{ .uuid = [_]u8{0} ** 16 }, -segments: std.ArrayListUnmanaged(macho.segment_command_64) = .empty, -sections: std.ArrayListUnmanaged(macho.section_64) = .empty, +segments: std.ArrayList(macho.segment_command_64) = .empty, +sections: std.ArrayList(macho.section_64) = .empty, dwarf_segment_cmd_index: ?u8 = null, linkedit_segment_cmd_index: ?u8 = null, @@ -19,11 +19,11 @@ debug_line_str_section_index: ?u8 = null, debug_loclists_section_index: ?u8 = null, debug_rnglists_section_index: ?u8 = null, -relocs: std.ArrayListUnmanaged(Reloc) = .empty, +relocs: std.ArrayList(Reloc) = .empty, /// Output synthetic sections -symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty, -strtab: std.ArrayListUnmanaged(u8) = .empty, +symtab: std.ArrayList(macho.nlist_64) = .empty, +strtab: std.ArrayList(u8) = .empty, pub const Reloc = struct { type: enum { diff --git a/src/link/MachO/Dylib.zig b/src/link/MachO/Dylib.zig index 64817ac433..69c64b6717 100644 --- a/src/link/MachO/Dylib.zig +++ b/src/link/MachO/Dylib.zig @@ -6,14 +6,14 @@ file_handle: File.HandleIndex, tag: enum { dylib, tbd }, exports: std.MultiArrayList(Export) = .{}, -strtab: std.ArrayListUnmanaged(u8) = .empty, +strtab: std.ArrayList(u8) = .empty, id: ?Id = null, ordinal: u16 = 0, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty, -dependents: std.ArrayListUnmanaged(Id) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty, +dependents: std.ArrayList(Id) = .empty, rpaths: std.StringArrayHashMapUnmanaged(void) = .empty, umbrella: File.Index, platform: ?MachO.Platform = null, @@ -695,7 +695,7 @@ pub const TargetMatcher = struct { allocator: Allocator, cpu_arch: std.Target.Cpu.Arch, platform: macho.PLATFORM, - target_strings: std.ArrayListUnmanaged([]const u8) = .empty, + target_strings: std.ArrayList([]const u8) = .empty, pub fn init(allocator: Allocator, cpu_arch: std.Target.Cpu.Arch, platform: macho.PLATFORM) !TargetMatcher { var self = TargetMatcher{ diff --git a/src/link/MachO/InternalObject.zig b/src/link/MachO/InternalObject.zig index f0c6c1fee7..802381207e 100644 --- a/src/link/MachO/InternalObject.zig +++ b/src/link/MachO/InternalObject.zig @@ -1,19 +1,19 @@ index: File.Index, sections: std.MultiArrayList(Section) = .{}, -atoms: std.ArrayListUnmanaged(Atom) = .empty, -atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty, -atoms_extra: std.ArrayListUnmanaged(u32) = .empty, -symtab: std.ArrayListUnmanaged(macho.nlist_64) = .empty, -strtab: std.ArrayListUnmanaged(u8) = .empty, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty, +atoms: std.ArrayList(Atom) = .empty, +atoms_indexes: std.ArrayList(Atom.Index) = .empty, +atoms_extra: std.ArrayList(u32) = .empty, +symtab: std.ArrayList(macho.nlist_64) = .empty, +strtab: std.ArrayList(u8) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty, -objc_methnames: std.ArrayListUnmanaged(u8) = .empty, +objc_methnames: std.ArrayList(u8) = .empty, objc_selrefs: [@sizeOf(u64)]u8 = [_]u8{0} ** @sizeOf(u64), -force_undefined: std.ArrayListUnmanaged(Symbol.Index) = .empty, +force_undefined: std.ArrayList(Symbol.Index) = .empty, entry_index: ?Symbol.Index = null, dyld_stub_binder_index: ?Symbol.Index = null, dyld_private_index: ?Symbol.Index = null, @@ -21,7 +21,7 @@ objc_msg_send_index: ?Symbol.Index = null, mh_execute_header_index: ?Symbol.Index = null, mh_dylib_header_index: ?Symbol.Index = null, dso_handle_index: ?Symbol.Index = null, -boundary_symbols: std.ArrayListUnmanaged(Symbol.Index) = .empty, +boundary_symbols: std.ArrayList(Symbol.Index) = .empty, output_symtab_ctx: MachO.SymtabCtx = .{}, @@ -880,7 +880,7 @@ pub fn fmtSymtab(self: *InternalObject, macho_file: *MachO) std.fmt.Alt(Format, const Section = struct { header: macho.section_64, - relocs: std.ArrayListUnmanaged(Relocation) = .empty, + relocs: std.ArrayList(Relocation) = .empty, extra: Extra = .{}, const Extra = packed struct { diff --git a/src/link/MachO/Object.zig b/src/link/MachO/Object.zig index 5f28d3dfda..5fc77fe763 100644 --- a/src/link/MachO/Object.zig +++ b/src/link/MachO/Object.zig @@ -12,27 +12,27 @@ in_archive: ?InArchive = null, header: ?macho.mach_header_64 = null, sections: std.MultiArrayList(Section) = .{}, symtab: std.MultiArrayList(Nlist) = .{}, -strtab: std.ArrayListUnmanaged(u8) = .empty, +strtab: std.ArrayList(u8) = .empty, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty, -atoms: std.ArrayListUnmanaged(Atom) = .empty, -atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty, -atoms_extra: std.ArrayListUnmanaged(u32) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty, +atoms: std.ArrayList(Atom) = .empty, +atoms_indexes: std.ArrayList(Atom.Index) = .empty, +atoms_extra: std.ArrayList(u32) = .empty, platform: ?MachO.Platform = null, compile_unit: ?CompileUnit = null, -stab_files: std.ArrayListUnmanaged(StabFile) = .empty, +stab_files: std.ArrayList(StabFile) = .empty, eh_frame_sect_index: ?u8 = null, compact_unwind_sect_index: ?u8 = null, -cies: std.ArrayListUnmanaged(Cie) = .empty, -fdes: std.ArrayListUnmanaged(Fde) = .empty, -eh_frame_data: std.ArrayListUnmanaged(u8) = .empty, -unwind_records: std.ArrayListUnmanaged(UnwindInfo.Record) = .empty, -unwind_records_indexes: std.ArrayListUnmanaged(UnwindInfo.Record.Index) = .empty, -data_in_code: std.ArrayListUnmanaged(macho.data_in_code_entry) = .empty, +cies: std.ArrayList(Cie) = .empty, +fdes: std.ArrayList(Fde) = .empty, +eh_frame_data: std.ArrayList(u8) = .empty, +unwind_records: std.ArrayList(UnwindInfo.Record) = .empty, +unwind_records_indexes: std.ArrayList(UnwindInfo.Record.Index) = .empty, +data_in_code: std.ArrayList(macho.data_in_code_entry) = .empty, alive: bool = true, hidden: bool = false, @@ -2603,8 +2603,8 @@ fn formatPath(object: Object, w: *Writer) Writer.Error!void { const Section = struct { header: macho.section_64, - subsections: std.ArrayListUnmanaged(Subsection) = .empty, - relocs: std.ArrayListUnmanaged(Relocation) = .empty, + subsections: std.ArrayList(Subsection) = .empty, + relocs: std.ArrayList(Relocation) = .empty, }; const Subsection = struct { @@ -2620,7 +2620,7 @@ pub const Nlist = struct { const StabFile = struct { comp_dir: u32, - stabs: std.ArrayListUnmanaged(Stab) = .empty, + stabs: std.ArrayList(Stab) = .empty, fn getCompDir(sf: StabFile, object: Object) [:0]const u8 { const nlist = object.symtab.items(.nlist)[sf.comp_dir]; @@ -2706,7 +2706,7 @@ const x86_64 = struct { self: *Object, n_sect: u8, sect: macho.section_64, - out: *std.ArrayListUnmanaged(Relocation), + out: *std.ArrayList(Relocation), handle: File.Handle, macho_file: *MachO, ) !void { @@ -2873,7 +2873,7 @@ const aarch64 = struct { self: *Object, n_sect: u8, sect: macho.section_64, - out: *std.ArrayListUnmanaged(Relocation), + out: *std.ArrayList(Relocation), handle: File.Handle, macho_file: *MachO, ) !void { diff --git a/src/link/MachO/UnwindInfo.zig b/src/link/MachO/UnwindInfo.zig index adfdcba81c..8bffdbcb4d 100644 --- a/src/link/MachO/UnwindInfo.zig +++ b/src/link/MachO/UnwindInfo.zig @@ -1,6 +1,6 @@ /// List of all unwind records gathered from all objects and sorted /// by allocated relative function address within the section. -records: std.ArrayListUnmanaged(Record.Ref) = .empty, +records: std.ArrayList(Record.Ref) = .empty, /// List of all personalities referenced by either unwind info entries /// or __eh_frame entries. @@ -12,11 +12,11 @@ common_encodings: [max_common_encodings]Encoding = undefined, common_encodings_count: u7 = 0, /// List of record indexes containing an LSDA pointer. -lsdas: std.ArrayListUnmanaged(u32) = .empty, -lsdas_lookup: std.ArrayListUnmanaged(u32) = .empty, +lsdas: std.ArrayList(u32) = .empty, +lsdas_lookup: std.ArrayList(u32) = .empty, /// List of second level pages. -pages: std.ArrayListUnmanaged(Page) = .empty, +pages: std.ArrayList(Page) = .empty, pub fn deinit(info: *UnwindInfo, allocator: Allocator) void { info.records.deinit(allocator); diff --git a/src/link/MachO/ZigObject.zig b/src/link/MachO/ZigObject.zig index 4a02802448..5a4ea65790 100644 --- a/src/link/MachO/ZigObject.zig +++ b/src/link/MachO/ZigObject.zig @@ -1,4 +1,4 @@ -data: std.ArrayListUnmanaged(u8) = .empty, +data: std.ArrayList(u8) = .empty, /// Externally owned memory. basename: []const u8, index: File.Index, @@ -6,15 +6,15 @@ index: File.Index, symtab: std.MultiArrayList(Nlist) = .{}, strtab: StringTable = .{}, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -symbols_extra: std.ArrayListUnmanaged(u32) = .empty, -globals: std.ArrayListUnmanaged(MachO.SymbolResolver.Index) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +symbols_extra: std.ArrayList(u32) = .empty, +globals: std.ArrayList(MachO.SymbolResolver.Index) = .empty, /// Maps string index (so name) into nlist index for the global symbol defined within this /// module. globals_lookup: std.AutoHashMapUnmanaged(u32, u32) = .empty, -atoms: std.ArrayListUnmanaged(Atom) = .empty, -atoms_indexes: std.ArrayListUnmanaged(Atom.Index) = .empty, -atoms_extra: std.ArrayListUnmanaged(u32) = .empty, +atoms: std.ArrayList(Atom) = .empty, +atoms_indexes: std.ArrayList(Atom.Index) = .empty, +atoms_extra: std.ArrayList(u32) = .empty, /// Table of tracked LazySymbols. lazy_syms: LazySymbolTable = .{}, @@ -1737,7 +1737,7 @@ pub fn fmtAtoms(self: *ZigObject, macho_file: *MachO) std.fmt.Alt(Format, Format const AvMetadata = struct { symbol_index: Symbol.Index, /// A list of all exports aliases of this Av. - exports: std.ArrayListUnmanaged(Symbol.Index) = .empty, + exports: std.ArrayList(Symbol.Index) = .empty, fn @"export"(m: AvMetadata, zig_object: *ZigObject, name: []const u8) ?*u32 { for (m.exports.items) |*exp| { @@ -1769,7 +1769,7 @@ const TlvInitializer = struct { const NavTable = std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, AvMetadata); const UavTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, AvMetadata); const LazySymbolTable = std.AutoArrayHashMapUnmanaged(InternPool.Index, LazySymbolMetadata); -const RelocationTable = std.ArrayListUnmanaged(std.ArrayListUnmanaged(Relocation)); +const RelocationTable = std.ArrayList(std.ArrayList(Relocation)); const TlvInitializerTable = std.AutoArrayHashMapUnmanaged(Atom.Index, TlvInitializer); const x86_64 = struct { diff --git a/src/link/MachO/dyld_info/Rebase.zig b/src/link/MachO/dyld_info/Rebase.zig index bab1ded6a0..a2c69fbb7a 100644 --- a/src/link/MachO/dyld_info/Rebase.zig +++ b/src/link/MachO/dyld_info/Rebase.zig @@ -1,5 +1,5 @@ -entries: std.ArrayListUnmanaged(Entry) = .empty, -buffer: std.ArrayListUnmanaged(u8) = .empty, +entries: std.ArrayList(Entry) = .empty, +buffer: std.ArrayList(u8) = .empty, pub const Entry = struct { offset: u64, diff --git a/src/link/MachO/dyld_info/Trie.zig b/src/link/MachO/dyld_info/Trie.zig index ea6f1a0666..b1fdc18d75 100644 --- a/src/link/MachO/dyld_info/Trie.zig +++ b/src/link/MachO/dyld_info/Trie.zig @@ -31,9 +31,9 @@ /// The root node of the trie. root: ?Node.Index = null, -buffer: std.ArrayListUnmanaged(u8) = .empty, +buffer: std.ArrayList(u8) = .empty, nodes: std.MultiArrayList(Node) = .{}, -edges: std.ArrayListUnmanaged(Edge) = .empty, +edges: std.ArrayList(Edge) = .empty, /// Insert a symbol into the trie, updating the prefixes in the process. /// This operation may change the layout of the trie by splicing edges in @@ -139,7 +139,7 @@ fn finalize(self: *Trie, allocator: Allocator) !void { try ordered_nodes.ensureTotalCapacityPrecise(self.nodes.items(.is_terminal).len); { - var fifo: std.ArrayListUnmanaged(Node.Index) = .empty; + var fifo: std.ArrayList(Node.Index) = .empty; defer fifo.deinit(allocator); try fifo.append(allocator, self.root.?); @@ -328,7 +328,7 @@ const Node = struct { trie_offset: u32 = 0, /// List of all edges originating from this node. - edges: std.ArrayListUnmanaged(Edge.Index) = .empty, + edges: std.ArrayList(Edge.Index) = .empty, const Index = u32; }; diff --git a/src/link/MachO/dyld_info/bind.zig b/src/link/MachO/dyld_info/bind.zig index 12f8dc0a76..66f7f09d44 100644 --- a/src/link/MachO/dyld_info/bind.zig +++ b/src/link/MachO/dyld_info/bind.zig @@ -17,8 +17,8 @@ pub const Entry = struct { }; pub const Bind = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, - buffer: std.ArrayListUnmanaged(u8) = .empty, + entries: std.ArrayList(Entry) = .empty, + buffer: std.ArrayList(u8) = .empty, const Self = @This(); @@ -271,8 +271,8 @@ pub const Bind = struct { }; pub const WeakBind = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, - buffer: std.ArrayListUnmanaged(u8) = .empty, + entries: std.ArrayList(Entry) = .empty, + buffer: std.ArrayList(u8) = .empty, const Self = @This(); @@ -515,9 +515,9 @@ pub const WeakBind = struct { }; pub const LazyBind = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, - buffer: std.ArrayListUnmanaged(u8) = .empty, - offsets: std.ArrayListUnmanaged(u32) = .empty, + entries: std.ArrayList(Entry) = .empty, + buffer: std.ArrayList(u8) = .empty, + offsets: std.ArrayList(u32) = .empty, const Self = @This(); diff --git a/src/link/MachO/synthetic.zig b/src/link/MachO/synthetic.zig index 79fbd8d3d0..36eb403470 100644 --- a/src/link/MachO/synthetic.zig +++ b/src/link/MachO/synthetic.zig @@ -1,5 +1,5 @@ pub const GotSection = struct { - symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty, + symbols: std.ArrayList(MachO.Ref) = .empty, pub const Index = u32; @@ -61,7 +61,7 @@ pub const GotSection = struct { }; pub const StubsSection = struct { - symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty, + symbols: std.ArrayList(MachO.Ref) = .empty, pub const Index = u32; @@ -296,7 +296,7 @@ pub const LaSymbolPtrSection = struct { }; pub const TlvPtrSection = struct { - symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty, + symbols: std.ArrayList(MachO.Ref) = .empty, pub const Index = u32; @@ -361,7 +361,7 @@ pub const TlvPtrSection = struct { }; pub const ObjcStubsSection = struct { - symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty, + symbols: std.ArrayList(MachO.Ref) = .empty, pub fn deinit(objc: *ObjcStubsSection, allocator: Allocator) void { objc.symbols.deinit(allocator); @@ -517,7 +517,7 @@ pub const Indsymtab = struct { }; pub const DataInCode = struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, + entries: std.ArrayList(Entry) = .empty, pub fn deinit(dice: *DataInCode, allocator: Allocator) void { dice.entries.deinit(allocator); diff --git a/src/link/StringTable.zig b/src/link/StringTable.zig index f8a917b249..6f2b14b4a7 100644 --- a/src/link/StringTable.zig +++ b/src/link/StringTable.zig @@ -1,4 +1,4 @@ -buffer: std.ArrayListUnmanaged(u8) = .empty, +buffer: std.ArrayList(u8) = .empty, table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty, pub fn deinit(self: *Self, gpa: Allocator) void { diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig index f47f7fbe2a..3ee6e842de 100644 --- a/src/link/Wasm.zig +++ b/src/link/Wasm.zig @@ -53,7 +53,7 @@ base: link.File, /// with a null byte so that deserialization does not attempt to create /// string_table entries for them. Alternately those sites could be moved to /// use a different byte array for this purpose. -string_bytes: std.ArrayListUnmanaged(u8), +string_bytes: std.ArrayList(u8), /// Sometimes we have logic that wants to borrow string bytes to store /// arbitrary things in there. In this case it is not allowed to intern new /// strings during this time. This safety lock is used to detect misuses. @@ -77,7 +77,7 @@ export_table: bool, /// Output name of the file name: []const u8, /// List of relocatable files to be linked into the final binary. -objects: std.ArrayListUnmanaged(Object) = .{}, +objects: std.ArrayList(Object) = .{}, func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty, /// Provides a mapping of both imports and provided functions to symbol name. @@ -85,23 +85,23 @@ func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty, /// Key is symbol name, however the `FunctionImport` may have an name override for the import name. object_function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImport) = .empty, /// All functions for all objects. -object_functions: std.ArrayListUnmanaged(ObjectFunction) = .empty, +object_functions: std.ArrayList(ObjectFunction) = .empty, /// Provides a mapping of both imports and provided globals to symbol name. /// Local globals may be unnamed. object_global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImport) = .empty, /// All globals for all objects. -object_globals: std.ArrayListUnmanaged(ObjectGlobal) = .empty, +object_globals: std.ArrayList(ObjectGlobal) = .empty, /// All table imports for all objects. object_table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport) = .empty, /// All parsed table sections for all objects. -object_tables: std.ArrayListUnmanaged(Table) = .empty, +object_tables: std.ArrayList(Table) = .empty, /// All memory imports for all objects. object_memory_imports: std.AutoArrayHashMapUnmanaged(String, MemoryImport) = .empty, /// All parsed memory sections for all objects. -object_memories: std.ArrayListUnmanaged(ObjectMemory) = .empty, +object_memories: std.ArrayList(ObjectMemory) = .empty, /// All relocations from all objects concatenated. `relocs_start` marks the end /// point of object relocations and start point of Zcu relocations. @@ -109,21 +109,21 @@ object_relocations: std.MultiArrayList(ObjectRelocation) = .empty, /// List of initialization functions. These must be called in order of priority /// by the (synthetic) `__wasm_call_ctors` function. -object_init_funcs: std.ArrayListUnmanaged(InitFunc) = .empty, +object_init_funcs: std.ArrayList(InitFunc) = .empty, /// The data section of an object has many segments. Each segment corresponds /// logically to an object file's .data section, or .rodata section. In /// the case of `-fdata-sections` there will be one segment per data symbol. -object_data_segments: std.ArrayListUnmanaged(ObjectDataSegment) = .empty, +object_data_segments: std.ArrayList(ObjectDataSegment) = .empty, /// Each segment has many data symbols, which correspond logically to global /// constants. -object_datas: std.ArrayListUnmanaged(ObjectData) = .empty, +object_datas: std.ArrayList(ObjectData) = .empty, object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty, /// Non-synthetic section that can essentially be mem-cpy'd into place after performing relocations. object_custom_segments: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, CustomSegment) = .empty, /// All comdat information for all objects. -object_comdats: std.ArrayListUnmanaged(Comdat) = .empty, +object_comdats: std.ArrayList(Comdat) = .empty, /// A table that maps the relocations to be performed where the key represents /// the section (across all objects) that the slice of relocations applies to. object_relocations_table: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, ObjectRelocation.Slice) = .empty, @@ -138,15 +138,15 @@ out_relocs: std.MultiArrayList(OutReloc) = .empty, /// List of locations within `string_bytes` that must be patched with the virtual /// memory address of a Uav during `flush`. /// When emitting an object file, `out_relocs` is used instead. -uav_fixups: std.ArrayListUnmanaged(UavFixup) = .empty, +uav_fixups: std.ArrayList(UavFixup) = .empty, /// List of locations within `string_bytes` that must be patched with the virtual /// memory address of a Nav during `flush`. /// When emitting an object file, `out_relocs` is used instead. /// No functions here only global variables. -nav_fixups: std.ArrayListUnmanaged(NavFixup) = .empty, +nav_fixups: std.ArrayList(NavFixup) = .empty, /// When a nav reference is a function pointer, this tracks the required function /// table entry index that needs to overwrite the code in the final output. -func_table_fixups: std.ArrayListUnmanaged(FuncTableFixup) = .empty, +func_table_fixups: std.ArrayList(FuncTableFixup) = .empty, /// Symbols to be emitted into an object file. Remains empty when not emitting /// an object file. symbol_table: std.AutoArrayHashMapUnmanaged(String, void) = .empty, @@ -167,7 +167,7 @@ memories: std.wasm.Memory = .{ .limits = .{ /// `--verbose-link` output. /// Initialized on creation, appended to as inputs are added, printed during `flush`. /// String data is allocated into Compilation arena. -dump_argv_list: std.ArrayListUnmanaged([]const u8), +dump_argv_list: std.ArrayList([]const u8), preloaded_strings: PreloadedStrings, @@ -205,7 +205,7 @@ entry_resolution: FunctionImport.Resolution = .unresolved, /// Empty when outputting an object. function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty, hidden_function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty, -global_exports: std.ArrayListUnmanaged(GlobalExport) = .empty, +global_exports: std.ArrayList(GlobalExport) = .empty, /// Tracks the value at the end of prelink. global_exports_len: u32 = 0, @@ -279,22 +279,22 @@ any_passive_inits: bool = false, /// All MIR instructions for all Zcu functions. mir_instructions: std.MultiArrayList(Mir.Inst) = .{}, /// Corresponds to `mir_instructions`. -mir_extra: std.ArrayListUnmanaged(u32) = .empty, +mir_extra: std.ArrayList(u32) = .empty, /// All local types for all Zcu functions. -mir_locals: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty, +mir_locals: std.ArrayList(std.wasm.Valtype) = .empty, -params_scratch: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty, -returns_scratch: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty, +params_scratch: std.ArrayList(std.wasm.Valtype) = .empty, +returns_scratch: std.ArrayList(std.wasm.Valtype) = .empty, /// All Zcu error names in order, null-terminated, concatenated. No need to /// serialize; trivially reconstructed. -error_name_bytes: std.ArrayListUnmanaged(u8) = .empty, +error_name_bytes: std.ArrayList(u8) = .empty, /// For each Zcu error, in order, offset into `error_name_bytes` where the name /// is stored. No need to serialize; trivially reconstructed. -error_name_offs: std.ArrayListUnmanaged(u32) = .empty, +error_name_offs: std.ArrayList(u32) = .empty, -tag_name_bytes: std.ArrayListUnmanaged(u8) = .empty, -tag_name_offs: std.ArrayListUnmanaged(u32) = .empty, +tag_name_bytes: std.ArrayList(u8) = .empty, +tag_name_offs: std.ArrayList(u32) = .empty, pub const TagNameOff = extern struct { off: u32, @@ -4196,8 +4196,8 @@ fn convertZcuFnType( params: []const InternPool.Index, return_type: Zcu.Type, target: *const std.Target, - params_buffer: *std.ArrayListUnmanaged(std.wasm.Valtype), - returns_buffer: *std.ArrayListUnmanaged(std.wasm.Valtype), + params_buffer: *std.ArrayList(std.wasm.Valtype), + returns_buffer: *std.ArrayList(std.wasm.Valtype), ) Allocator.Error!void { params_buffer.clearRetainingCapacity(); returns_buffer.clearRetainingCapacity(); diff --git a/src/link/Wasm/Archive.zig b/src/link/Wasm/Archive.zig index 2ad1b38579..9424eeabf4 100644 --- a/src/link/Wasm/Archive.zig +++ b/src/link/Wasm/Archive.zig @@ -12,7 +12,7 @@ toc: Toc, /// Key points into `LazyArchive` `file_contents`. /// Value is allocated with gpa. -const Toc = std.StringArrayHashMapUnmanaged(std.ArrayListUnmanaged(u32)); +const Toc = std.StringArrayHashMapUnmanaged(std.ArrayList(u32)); const ARMAG = std.elf.ARMAG; const ARFMAG = std.elf.ARFMAG; diff --git a/src/link/Wasm/Object.zig b/src/link/Wasm/Object.zig index a54025d09e..c55d36f05a 100644 --- a/src/link/Wasm/Object.zig +++ b/src/link/Wasm/Object.zig @@ -169,14 +169,14 @@ pub const Symbol = struct { }; pub const ScratchSpace = struct { - func_types: std.ArrayListUnmanaged(Wasm.FunctionType.Index) = .empty, - func_type_indexes: std.ArrayListUnmanaged(FuncTypeIndex) = .empty, - func_imports: std.ArrayListUnmanaged(FunctionImport) = .empty, - global_imports: std.ArrayListUnmanaged(GlobalImport) = .empty, - table_imports: std.ArrayListUnmanaged(TableImport) = .empty, - symbol_table: std.ArrayListUnmanaged(Symbol) = .empty, - segment_info: std.ArrayListUnmanaged(SegmentInfo) = .empty, - exports: std.ArrayListUnmanaged(Export) = .empty, + func_types: std.ArrayList(Wasm.FunctionType.Index) = .empty, + func_type_indexes: std.ArrayList(FuncTypeIndex) = .empty, + func_imports: std.ArrayList(FunctionImport) = .empty, + global_imports: std.ArrayList(GlobalImport) = .empty, + table_imports: std.ArrayList(TableImport) = .empty, + symbol_table: std.ArrayList(Symbol) = .empty, + segment_info: std.ArrayList(SegmentInfo) = .empty, + exports: std.ArrayList(Export) = .empty, const Export = struct { name: Wasm.String, diff --git a/src/link/table_section.zig b/src/link/table_section.zig index 9b98e77871..318e9ed27e 100644 --- a/src/link/table_section.zig +++ b/src/link/table_section.zig @@ -1,7 +1,7 @@ pub fn TableSection(comptime Entry: type) type { return struct { - entries: std.ArrayListUnmanaged(Entry) = .empty, - free_list: std.ArrayListUnmanaged(Index) = .empty, + entries: std.ArrayList(Entry) = .empty, + free_list: std.ArrayList(Index) = .empty, lookup: std.AutoHashMapUnmanaged(Entry, Index) = .empty, pub fn deinit(self: *Self, allocator: Allocator) void { diff --git a/src/link/tapi/parse.zig b/src/link/tapi/parse.zig index 7450d0ae3c..4483d359eb 100644 --- a/src/link/tapi/parse.zig +++ b/src/link/tapi/parse.zig @@ -103,7 +103,7 @@ pub const Node = struct { .start = undefined, .end = undefined, }, - values: std.ArrayListUnmanaged(Entry) = .empty, + values: std.ArrayList(Entry) = .empty, pub const base_tag: Node.Tag = .map; @@ -142,7 +142,7 @@ pub const Node = struct { .start = undefined, .end = undefined, }, - values: std.ArrayListUnmanaged(*Node) = .empty, + values: std.ArrayList(*Node) = .empty, pub const base_tag: Node.Tag = .list; @@ -169,7 +169,7 @@ pub const Node = struct { .start = undefined, .end = undefined, }, - string_value: std.ArrayListUnmanaged(u8) = .empty, + string_value: std.ArrayList(u8) = .empty, pub const base_tag: Node.Tag = .value; @@ -194,7 +194,7 @@ pub const Tree = struct { source: []const u8, tokens: []Token, line_cols: std.AutoHashMap(TokenIndex, LineCol), - docs: std.ArrayListUnmanaged(*Node) = .empty, + docs: std.ArrayList(*Node) = .empty, pub fn init(allocator: Allocator) Tree { return .{ diff --git a/src/main.zig b/src/main.zig index d52616aa77..21bbecea4a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -132,7 +132,7 @@ const debug_usage = normal_usage ++ const usage = if (build_options.enable_debug_extensions) debug_usage else normal_usage; -var log_scopes: std.ArrayListUnmanaged([]const u8) = .empty; +var log_scopes: std.ArrayList([]const u8) = .empty; pub fn log( comptime level: std.log.Level, @@ -884,7 +884,7 @@ fn buildOutputType( var link_emit_relocs = false; var build_id: ?std.zig.BuildId = null; var runtime_args_start: ?usize = null; - var test_filters: std.ArrayListUnmanaged([]const u8) = .empty; + var test_filters: std.ArrayList([]const u8) = .empty; var test_runner_path: ?[]const u8 = null; var override_local_cache_dir: ?[]const u8 = try EnvVar.ZIG_LOCAL_CACHE_DIR.get(arena); var override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena); @@ -912,12 +912,12 @@ fn buildOutputType( var pdb_out_path: ?[]const u8 = null; var error_limit: ?Zcu.ErrorInt = null; // These are before resolving sysroot. - var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty; - var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty; + var extra_cflags: std.ArrayList([]const u8) = .empty; + var extra_rcflags: std.ArrayList([]const u8) = .empty; var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty; var rc_includes: std.zig.RcIncludes = .any; var manifest_file: ?[]const u8 = null; - var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty; + var linker_export_symbol_names: std.ArrayList([]const u8) = .empty; // Tracks the position in c_source_files which have already their owner populated. var c_source_files_owner_index: usize = 0; @@ -925,7 +925,7 @@ fn buildOutputType( var rc_source_files_owner_index: usize = 0; // null means replace with the test executable binary - var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .empty; + var test_exec_args: std.ArrayList(?[]const u8) = .empty; // These get set by CLI flags and then snapshotted when a `-M` flag is // encountered. @@ -934,8 +934,8 @@ fn buildOutputType( // These get appended to by CLI flags and then slurped when a `-M` flag // is encountered. var cssan: ClangSearchSanitizer = .{}; - var cc_argv: std.ArrayListUnmanaged([]const u8) = .empty; - var deps: std.ArrayListUnmanaged(CliModule.Dep) = .empty; + var cc_argv: std.ArrayList([]const u8) = .empty; + var deps: std.ArrayList(CliModule.Dep) = .empty; // Contains every module specified via -M. The dependencies are added // after argument parsing is completed. We use a StringArrayHashMap to make @@ -3374,7 +3374,7 @@ fn buildOutputType( process.raiseFileDescriptorLimit(); - var file_system_inputs: std.ArrayListUnmanaged(u8) = .empty; + var file_system_inputs: std.ArrayList(u8) = .empty; defer file_system_inputs.deinit(gpa); // Deduplicate rpath entries @@ -3698,29 +3698,29 @@ const CreateModule = struct { /// directly after computing the target and used to compute link_libc, /// link_libcpp, and then the libraries are filtered into /// `unresolved_link_inputs` and `windows_libs`. - cli_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput), + cli_link_inputs: std.ArrayList(link.UnresolvedInput), windows_libs: std.StringArrayHashMapUnmanaged(void), /// The local variable `unresolved_link_inputs` is fed into library /// resolution, mutating the input array, and producing this data as /// output. Allocated with gpa. - link_inputs: std.ArrayListUnmanaged(link.Input), + link_inputs: std.ArrayList(link.Input), - c_source_files: std.ArrayListUnmanaged(Compilation.CSourceFile), - rc_source_files: std.ArrayListUnmanaged(Compilation.RcSourceFile), + c_source_files: std.ArrayList(Compilation.CSourceFile), + rc_source_files: std.ArrayList(Compilation.RcSourceFile), /// e.g. -m3dnow or -mno-outline-atomics. They correspond to std.Target llvm cpu feature names. /// This array is populated by zig cc frontend and then has to be converted to zig-style /// CPU features. - llvm_m_args: std.ArrayListUnmanaged([]const u8), + llvm_m_args: std.ArrayList([]const u8), sysroot: ?[]const u8, - lib_directories: std.ArrayListUnmanaged(Directory), - lib_dir_args: std.ArrayListUnmanaged([]const u8), + lib_directories: std.ArrayList(Directory), + lib_dir_args: std.ArrayList([]const u8), libc_installation: ?LibCInstallation, want_native_include_dirs: bool, frameworks: std.StringArrayHashMapUnmanaged(Framework), native_system_include_paths: []const []const u8, - framework_dirs: std.ArrayListUnmanaged([]const u8), - rpath_list: std.ArrayListUnmanaged([]const u8), + framework_dirs: std.ArrayList([]const u8), + rpath_list: std.ArrayList([]const u8), each_lib_rpath: ?bool, libc_paths_file: ?[]const u8, }; @@ -3826,7 +3826,7 @@ fn createModule( // We need to know whether the set of system libraries contains anything besides these // to decide whether to trigger native path detection logic. // Preserves linker input order. - var unresolved_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput) = .empty; + var unresolved_link_inputs: std.ArrayList(link.UnresolvedInput) = .empty; defer unresolved_link_inputs.deinit(gpa); try unresolved_link_inputs.ensureUnusedCapacity(gpa, create_module.cli_link_inputs.items.len); var any_name_queries_remaining = false; @@ -4215,11 +4215,11 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void { if (comp.time_report) |*tr| { var decls_len: u32 = 0; - var file_name_bytes: std.ArrayListUnmanaged(u8) = .empty; + var file_name_bytes: std.ArrayList(u8) = .empty; defer file_name_bytes.deinit(gpa); var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty; defer files.deinit(gpa); - var decl_data: std.ArrayListUnmanaged(u8) = .empty; + var decl_data: std.ArrayList(u8) = .empty; defer decl_data.deinit(gpa); // Each decl needs at least 34 bytes: @@ -4546,7 +4546,7 @@ fn cmdTranslateC( comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult, - file_system_inputs: ?*std.ArrayListUnmanaged(u8), + file_system_inputs: ?*std.ArrayList(u8), prog_node: std.Progress.Node, ) !void { dev.check(.translate_c_command); @@ -4754,7 +4754,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { } fn sanitizeExampleName(arena: Allocator, bytes: []const u8) error{OutOfMemory}![]const u8 { - var result: std.ArrayListUnmanaged(u8) = .empty; + var result: std.ArrayList(u8) = .empty; for (bytes, 0..) |byte, i| switch (byte) { '0'...'9' => { if (i == 0) try result.append(arena, '_'); @@ -5486,7 +5486,7 @@ fn jitCmd( }); defer thread_pool.deinit(); - var child_argv: std.ArrayListUnmanaged([]const u8) = .empty; + var child_argv: std.ArrayList([]const u8) = .empty; try child_argv.ensureUnusedCapacity(arena, args.len + 4); // We want to release all the locks before executing the child process, so we make a nice @@ -6687,7 +6687,7 @@ const ClangSearchSanitizer = struct { fn addIncludePath( self: *@This(), ally: Allocator, - argv: *std.ArrayListUnmanaged([]const u8), + argv: *std.ArrayList([]const u8), group: Group, arg: []const u8, dir: []const u8, @@ -7436,10 +7436,10 @@ fn handleModArg( opt_root_src_orig: ?[]const u8, create_module: *CreateModule, mod_opts: *Package.Module.CreateOptions.Inherited, - cc_argv: *std.ArrayListUnmanaged([]const u8), + cc_argv: *std.ArrayList([]const u8), target_arch_os_abi: *?[]const u8, target_mcpu: *?[]const u8, - deps: *std.ArrayListUnmanaged(CliModule.Dep), + deps: *std.ArrayList(CliModule.Dep), c_source_files_owner_index: *usize, rc_source_files_owner_index: *usize, cssan: *ClangSearchSanitizer, @@ -7513,12 +7513,12 @@ fn anyObjectLinkInputs(link_inputs: []const link.UnresolvedInput) bool { return false; } -fn addLibDirectoryWarn(lib_directories: *std.ArrayListUnmanaged(Directory), path: []const u8) void { +fn addLibDirectoryWarn(lib_directories: *std.ArrayList(Directory), path: []const u8) void { return addLibDirectoryWarn2(lib_directories, path, false); } fn addLibDirectoryWarn2( - lib_directories: *std.ArrayListUnmanaged(Directory), + lib_directories: *std.ArrayList(Directory), path: []const u8, ignore_not_found: bool, ) void { diff --git a/src/register_manager.zig b/src/register_manager.zig index bc6761ad3b..296025b8eb 100644 --- a/src/register_manager.zig +++ b/src/register_manager.zig @@ -483,7 +483,7 @@ fn MockFunction(comptime Register: type) type { return struct { allocator: Allocator, register_manager: Register.RM = .{}, - spilled: std.ArrayListUnmanaged(Register) = .empty, + spilled: std.ArrayList(Register) = .empty, const Self = @This(); diff --git a/test/behavior/fn.zig b/test/behavior/fn.zig index 2fe880d170..677a47a104 100644 --- a/test/behavior/fn.zig +++ b/test/behavior/fn.zig @@ -407,8 +407,8 @@ test "import passed byref to function in return type" { if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO const S = struct { - fn get() @import("std").ArrayListUnmanaged(i32) { - const x: @import("std").ArrayListUnmanaged(i32) = .empty; + fn get() @import("std").ArrayList(i32) { + const x: @import("std").ArrayList(i32) = .empty; return x; } }; diff --git a/tools/doctest.zig b/tools/doctest.zig index de8d3a80ee..63b7e50778 100644 --- a/tools/doctest.zig +++ b/tools/doctest.zig @@ -924,8 +924,8 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code { var mode: std.builtin.OptimizeMode = .Debug; var link_mode: ?std.builtin.LinkMode = null; - var link_objects: std.ArrayListUnmanaged([]const u8) = .empty; - var additional_options: std.ArrayListUnmanaged([]const u8) = .empty; + var link_objects: std.ArrayList([]const u8) = .empty; + var additional_options: std.ArrayList([]const u8) = .empty; var target_str: ?[]const u8 = null; var link_libc = false; var disable_cache = false; diff --git a/tools/incr-check.zig b/tools/incr-check.zig index 7f3bf75686..5023fb85dd 100644 --- a/tools/incr-check.zig +++ b/tools/incr-check.zig @@ -108,7 +108,7 @@ pub fn main() !void { if (debug_log_verbose) { std.log.scoped(.status).info("target: '{s}-{t}'", .{ target.query, target.backend }); } - var child_args: std.ArrayListUnmanaged([]const u8) = .empty; + var child_args: std.ArrayList([]const u8) = .empty; try child_args.appendSlice(arena, &.{ resolved_zig_exe, "build-exe", @@ -161,7 +161,7 @@ pub fn main() !void { child.cwd_dir = tmp_dir; child.cwd = tmp_dir_path; - var cc_child_args: std.ArrayListUnmanaged([]const u8) = .empty; + var cc_child_args: std.ArrayList([]const u8) = .empty; if (target.backend == .cbe) { const resolved_cc_zig_exe = if (opt_cc_zig) |cc_zig_exe| try std.fs.path.relative(arena, tmp_dir_path, cc_zig_exe) @@ -238,7 +238,7 @@ const Eval = struct { preserve_tmp_on_fatal: bool, /// When `target.backend == .cbe`, this contains the first few arguments to `zig cc` to build the generated binary. /// The arguments `out.c in.c` must be appended before spawning the subprocess. - cc_child_args: *std.ArrayListUnmanaged([]const u8), + cc_child_args: *std.ArrayList([]const u8), const StreamEnum = enum { stdout, stderr }; const Poller = Io.Poller(StreamEnum); @@ -664,11 +664,11 @@ const Case = struct { fn parse(arena: Allocator, io: Io, bytes: []const u8) !Case { const fatal = std.process.fatal; - var targets: std.ArrayListUnmanaged(Target) = .empty; - var modules: std.ArrayListUnmanaged(Module) = .empty; - var updates: std.ArrayListUnmanaged(Update) = .empty; - var changes: std.ArrayListUnmanaged(FullContents) = .empty; - var deletes: std.ArrayListUnmanaged([]const u8) = .empty; + var targets: std.ArrayList(Target) = .empty; + var modules: std.ArrayList(Module) = .empty; + var updates: std.ArrayList(Update) = .empty; + var changes: std.ArrayList(FullContents) = .empty; + var deletes: std.ArrayList([]const u8) = .empty; var it = std.mem.splitScalar(u8, bytes, '\n'); var line_n: usize = 1; var root_source_file: ?[]const u8 = null; @@ -731,7 +731,7 @@ const Case = struct { // Because Windows is so excellent, we need to convert CRLF to LF, so // can't just slice into the input here. How delightful! - var src: std.ArrayListUnmanaged(u8) = .empty; + var src: std.ArrayList(u8) = .empty; while (true) { const next_line_raw = it.peek() orelse fatal("line {d}: unexpected EOF", .{line_n}); @@ -767,7 +767,7 @@ const Case = struct { const last_update = &updates.items[updates.items.len - 1]; if (last_update.outcome != .unknown) fatal("line {d}: conflicting expect directive", .{line_n}); - var errors: std.ArrayListUnmanaged(ExpectedError) = .empty; + var errors: std.ArrayList(ExpectedError) = .empty; try errors.append(arena, parseExpectedError(val, line_n)); while (true) { const next_line = it.peek() orelse break; @@ -783,7 +783,7 @@ const Case = struct { try errors.append(arena, parseExpectedError(new_val, line_n)); } - var compile_log_output: std.ArrayListUnmanaged(u8) = .empty; + var compile_log_output: std.ArrayList(u8) = .empty; while (true) { const next_line = it.peek() orelse break; if (!std.mem.startsWith(u8, next_line, "#")) break;