mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
update deprecated ArrayListUnmanaged usage (#25958)
This commit is contained in:
parent
db622f14c4
commit
4b5351bc0d
@ -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;
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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| {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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,
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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, //
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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.
|
||||
///
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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", //
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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 = .{
|
||||
|
||||
@ -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(.{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -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 = "",
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 };
|
||||
|
||||
@ -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| {
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) };
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 {
|
||||
|
||||
52
src/Sema.zig
52
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;
|
||||
|
||||
40
src/Zcu.zig
40
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,
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 };
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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| {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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 };
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
36
src/link.zig
36
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,
|
||||
|
||||
@ -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,
|
||||
|
||||
|
||||
@ -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 };
|
||||
};
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 = .{},
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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| {
|
||||
|
||||
@ -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.*) {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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{
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user