mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
update deprecated ArrayListUnmanaged usage (#25958)
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
+13
-13
@@ -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) };
|
||||
|
||||
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+26
-26
@@ -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;
|
||||
|
||||
+20
-20
@@ -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);
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
+13
-13
@@ -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,
|
||||
|
||||
+18
-18
@@ -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,
|
||||
|
||||
+6
-6
@@ -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,
|
||||
|
||||
|
||||
+12
-12
@@ -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 };
|
||||
};
|
||||
|
||||
+22
-22
@@ -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);
|
||||
|
||||
+17
-17
@@ -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;
|
||||
|
||||
+12
-12
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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| {
|
||||
|
||||
+19
-19
@@ -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 {
|
||||
|
||||
+19
-19
@@ -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();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
pub const GotSection = struct {
|
||||
symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,
|
||||
symbols: std.ArrayList(MachO.Ref) = .empty,
|
||||
|
||||
pub const Index = u32;
|
||||
|
||||
@@ -61,7 +61,7 @@ pub const GotSection = struct {
|
||||
};
|
||||
|
||||
pub const StubsSection = struct {
|
||||
symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,
|
||||
symbols: std.ArrayList(MachO.Ref) = .empty,
|
||||
|
||||
pub const Index = u32;
|
||||
|
||||
@@ -296,7 +296,7 @@ pub const LaSymbolPtrSection = struct {
|
||||
};
|
||||
|
||||
pub const TlvPtrSection = struct {
|
||||
symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,
|
||||
symbols: std.ArrayList(MachO.Ref) = .empty,
|
||||
|
||||
pub const Index = u32;
|
||||
|
||||
@@ -361,7 +361,7 @@ pub const TlvPtrSection = struct {
|
||||
};
|
||||
|
||||
pub const ObjcStubsSection = struct {
|
||||
symbols: std.ArrayListUnmanaged(MachO.Ref) = .empty,
|
||||
symbols: std.ArrayList(MachO.Ref) = .empty,
|
||||
|
||||
pub fn deinit(objc: *ObjcStubsSection, allocator: Allocator) void {
|
||||
objc.symbols.deinit(allocator);
|
||||
@@ -517,7 +517,7 @@ pub const Indsymtab = struct {
|
||||
};
|
||||
|
||||
pub const DataInCode = struct {
|
||||
entries: std.ArrayListUnmanaged(Entry) = .empty,
|
||||
entries: std.ArrayList(Entry) = .empty,
|
||||
|
||||
pub fn deinit(dice: *DataInCode, allocator: Allocator) void {
|
||||
dice.entries.deinit(allocator);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
buffer: std.ArrayListUnmanaged(u8) = .empty,
|
||||
buffer: std.ArrayList(u8) = .empty,
|
||||
table: std.HashMapUnmanaged(u32, void, StringIndexContext, std.hash_map.default_max_load_percentage) = .empty,
|
||||
|
||||
pub fn deinit(self: *Self, gpa: Allocator) void {
|
||||
|
||||
+25
-25
@@ -53,7 +53,7 @@ base: link.File,
|
||||
/// with a null byte so that deserialization does not attempt to create
|
||||
/// string_table entries for them. Alternately those sites could be moved to
|
||||
/// use a different byte array for this purpose.
|
||||
string_bytes: std.ArrayListUnmanaged(u8),
|
||||
string_bytes: std.ArrayList(u8),
|
||||
/// Sometimes we have logic that wants to borrow string bytes to store
|
||||
/// arbitrary things in there. In this case it is not allowed to intern new
|
||||
/// strings during this time. This safety lock is used to detect misuses.
|
||||
@@ -77,7 +77,7 @@ export_table: bool,
|
||||
/// Output name of the file
|
||||
name: []const u8,
|
||||
/// List of relocatable files to be linked into the final binary.
|
||||
objects: std.ArrayListUnmanaged(Object) = .{},
|
||||
objects: std.ArrayList(Object) = .{},
|
||||
|
||||
func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,
|
||||
/// Provides a mapping of both imports and provided functions to symbol name.
|
||||
@@ -85,23 +85,23 @@ func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,
|
||||
/// Key is symbol name, however the `FunctionImport` may have an name override for the import name.
|
||||
object_function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImport) = .empty,
|
||||
/// All functions for all objects.
|
||||
object_functions: std.ArrayListUnmanaged(ObjectFunction) = .empty,
|
||||
object_functions: std.ArrayList(ObjectFunction) = .empty,
|
||||
|
||||
/// Provides a mapping of both imports and provided globals to symbol name.
|
||||
/// Local globals may be unnamed.
|
||||
object_global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImport) = .empty,
|
||||
/// All globals for all objects.
|
||||
object_globals: std.ArrayListUnmanaged(ObjectGlobal) = .empty,
|
||||
object_globals: std.ArrayList(ObjectGlobal) = .empty,
|
||||
|
||||
/// All table imports for all objects.
|
||||
object_table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport) = .empty,
|
||||
/// All parsed table sections for all objects.
|
||||
object_tables: std.ArrayListUnmanaged(Table) = .empty,
|
||||
object_tables: std.ArrayList(Table) = .empty,
|
||||
|
||||
/// All memory imports for all objects.
|
||||
object_memory_imports: std.AutoArrayHashMapUnmanaged(String, MemoryImport) = .empty,
|
||||
/// All parsed memory sections for all objects.
|
||||
object_memories: std.ArrayListUnmanaged(ObjectMemory) = .empty,
|
||||
object_memories: std.ArrayList(ObjectMemory) = .empty,
|
||||
|
||||
/// All relocations from all objects concatenated. `relocs_start` marks the end
|
||||
/// point of object relocations and start point of Zcu relocations.
|
||||
@@ -109,21 +109,21 @@ object_relocations: std.MultiArrayList(ObjectRelocation) = .empty,
|
||||
|
||||
/// List of initialization functions. These must be called in order of priority
|
||||
/// by the (synthetic) `__wasm_call_ctors` function.
|
||||
object_init_funcs: std.ArrayListUnmanaged(InitFunc) = .empty,
|
||||
object_init_funcs: std.ArrayList(InitFunc) = .empty,
|
||||
|
||||
/// The data section of an object has many segments. Each segment corresponds
|
||||
/// logically to an object file's .data section, or .rodata section. In
|
||||
/// the case of `-fdata-sections` there will be one segment per data symbol.
|
||||
object_data_segments: std.ArrayListUnmanaged(ObjectDataSegment) = .empty,
|
||||
object_data_segments: std.ArrayList(ObjectDataSegment) = .empty,
|
||||
/// Each segment has many data symbols, which correspond logically to global
|
||||
/// constants.
|
||||
object_datas: std.ArrayListUnmanaged(ObjectData) = .empty,
|
||||
object_datas: std.ArrayList(ObjectData) = .empty,
|
||||
object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty,
|
||||
/// Non-synthetic section that can essentially be mem-cpy'd into place after performing relocations.
|
||||
object_custom_segments: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, CustomSegment) = .empty,
|
||||
|
||||
/// All comdat information for all objects.
|
||||
object_comdats: std.ArrayListUnmanaged(Comdat) = .empty,
|
||||
object_comdats: std.ArrayList(Comdat) = .empty,
|
||||
/// A table that maps the relocations to be performed where the key represents
|
||||
/// the section (across all objects) that the slice of relocations applies to.
|
||||
object_relocations_table: std.AutoArrayHashMapUnmanaged(ObjectSectionIndex, ObjectRelocation.Slice) = .empty,
|
||||
@@ -138,15 +138,15 @@ out_relocs: std.MultiArrayList(OutReloc) = .empty,
|
||||
/// List of locations within `string_bytes` that must be patched with the virtual
|
||||
/// memory address of a Uav during `flush`.
|
||||
/// When emitting an object file, `out_relocs` is used instead.
|
||||
uav_fixups: std.ArrayListUnmanaged(UavFixup) = .empty,
|
||||
uav_fixups: std.ArrayList(UavFixup) = .empty,
|
||||
/// List of locations within `string_bytes` that must be patched with the virtual
|
||||
/// memory address of a Nav during `flush`.
|
||||
/// When emitting an object file, `out_relocs` is used instead.
|
||||
/// No functions here only global variables.
|
||||
nav_fixups: std.ArrayListUnmanaged(NavFixup) = .empty,
|
||||
nav_fixups: std.ArrayList(NavFixup) = .empty,
|
||||
/// When a nav reference is a function pointer, this tracks the required function
|
||||
/// table entry index that needs to overwrite the code in the final output.
|
||||
func_table_fixups: std.ArrayListUnmanaged(FuncTableFixup) = .empty,
|
||||
func_table_fixups: std.ArrayList(FuncTableFixup) = .empty,
|
||||
/// Symbols to be emitted into an object file. Remains empty when not emitting
|
||||
/// an object file.
|
||||
symbol_table: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
|
||||
@@ -167,7 +167,7 @@ memories: std.wasm.Memory = .{ .limits = .{
|
||||
/// `--verbose-link` output.
|
||||
/// Initialized on creation, appended to as inputs are added, printed during `flush`.
|
||||
/// String data is allocated into Compilation arena.
|
||||
dump_argv_list: std.ArrayListUnmanaged([]const u8),
|
||||
dump_argv_list: std.ArrayList([]const u8),
|
||||
|
||||
preloaded_strings: PreloadedStrings,
|
||||
|
||||
@@ -205,7 +205,7 @@ entry_resolution: FunctionImport.Resolution = .unresolved,
|
||||
/// Empty when outputting an object.
|
||||
function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,
|
||||
hidden_function_exports: std.AutoArrayHashMapUnmanaged(String, FunctionIndex) = .empty,
|
||||
global_exports: std.ArrayListUnmanaged(GlobalExport) = .empty,
|
||||
global_exports: std.ArrayList(GlobalExport) = .empty,
|
||||
/// Tracks the value at the end of prelink.
|
||||
global_exports_len: u32 = 0,
|
||||
|
||||
@@ -279,22 +279,22 @@ any_passive_inits: bool = false,
|
||||
/// All MIR instructions for all Zcu functions.
|
||||
mir_instructions: std.MultiArrayList(Mir.Inst) = .{},
|
||||
/// Corresponds to `mir_instructions`.
|
||||
mir_extra: std.ArrayListUnmanaged(u32) = .empty,
|
||||
mir_extra: std.ArrayList(u32) = .empty,
|
||||
/// All local types for all Zcu functions.
|
||||
mir_locals: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty,
|
||||
mir_locals: std.ArrayList(std.wasm.Valtype) = .empty,
|
||||
|
||||
params_scratch: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty,
|
||||
returns_scratch: std.ArrayListUnmanaged(std.wasm.Valtype) = .empty,
|
||||
params_scratch: std.ArrayList(std.wasm.Valtype) = .empty,
|
||||
returns_scratch: std.ArrayList(std.wasm.Valtype) = .empty,
|
||||
|
||||
/// All Zcu error names in order, null-terminated, concatenated. No need to
|
||||
/// serialize; trivially reconstructed.
|
||||
error_name_bytes: std.ArrayListUnmanaged(u8) = .empty,
|
||||
error_name_bytes: std.ArrayList(u8) = .empty,
|
||||
/// For each Zcu error, in order, offset into `error_name_bytes` where the name
|
||||
/// is stored. No need to serialize; trivially reconstructed.
|
||||
error_name_offs: std.ArrayListUnmanaged(u32) = .empty,
|
||||
error_name_offs: std.ArrayList(u32) = .empty,
|
||||
|
||||
tag_name_bytes: std.ArrayListUnmanaged(u8) = .empty,
|
||||
tag_name_offs: std.ArrayListUnmanaged(u32) = .empty,
|
||||
tag_name_bytes: std.ArrayList(u8) = .empty,
|
||||
tag_name_offs: std.ArrayList(u32) = .empty,
|
||||
|
||||
pub const TagNameOff = extern struct {
|
||||
off: u32,
|
||||
@@ -4196,8 +4196,8 @@ fn convertZcuFnType(
|
||||
params: []const InternPool.Index,
|
||||
return_type: Zcu.Type,
|
||||
target: *const std.Target,
|
||||
params_buffer: *std.ArrayListUnmanaged(std.wasm.Valtype),
|
||||
returns_buffer: *std.ArrayListUnmanaged(std.wasm.Valtype),
|
||||
params_buffer: *std.ArrayList(std.wasm.Valtype),
|
||||
returns_buffer: *std.ArrayList(std.wasm.Valtype),
|
||||
) Allocator.Error!void {
|
||||
params_buffer.clearRetainingCapacity();
|
||||
returns_buffer.clearRetainingCapacity();
|
||||
|
||||
@@ -12,7 +12,7 @@ toc: Toc,
|
||||
|
||||
/// Key points into `LazyArchive` `file_contents`.
|
||||
/// Value is allocated with gpa.
|
||||
const Toc = std.StringArrayHashMapUnmanaged(std.ArrayListUnmanaged(u32));
|
||||
const Toc = std.StringArrayHashMapUnmanaged(std.ArrayList(u32));
|
||||
|
||||
const ARMAG = std.elf.ARMAG;
|
||||
const ARFMAG = std.elf.ARFMAG;
|
||||
|
||||
@@ -169,14 +169,14 @@ pub const Symbol = struct {
|
||||
};
|
||||
|
||||
pub const ScratchSpace = struct {
|
||||
func_types: std.ArrayListUnmanaged(Wasm.FunctionType.Index) = .empty,
|
||||
func_type_indexes: std.ArrayListUnmanaged(FuncTypeIndex) = .empty,
|
||||
func_imports: std.ArrayListUnmanaged(FunctionImport) = .empty,
|
||||
global_imports: std.ArrayListUnmanaged(GlobalImport) = .empty,
|
||||
table_imports: std.ArrayListUnmanaged(TableImport) = .empty,
|
||||
symbol_table: std.ArrayListUnmanaged(Symbol) = .empty,
|
||||
segment_info: std.ArrayListUnmanaged(SegmentInfo) = .empty,
|
||||
exports: std.ArrayListUnmanaged(Export) = .empty,
|
||||
func_types: std.ArrayList(Wasm.FunctionType.Index) = .empty,
|
||||
func_type_indexes: std.ArrayList(FuncTypeIndex) = .empty,
|
||||
func_imports: std.ArrayList(FunctionImport) = .empty,
|
||||
global_imports: std.ArrayList(GlobalImport) = .empty,
|
||||
table_imports: std.ArrayList(TableImport) = .empty,
|
||||
symbol_table: std.ArrayList(Symbol) = .empty,
|
||||
segment_info: std.ArrayList(SegmentInfo) = .empty,
|
||||
exports: std.ArrayList(Export) = .empty,
|
||||
|
||||
const Export = struct {
|
||||
name: Wasm.String,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
pub fn TableSection(comptime Entry: type) type {
|
||||
return struct {
|
||||
entries: std.ArrayListUnmanaged(Entry) = .empty,
|
||||
free_list: std.ArrayListUnmanaged(Index) = .empty,
|
||||
entries: std.ArrayList(Entry) = .empty,
|
||||
free_list: std.ArrayList(Index) = .empty,
|
||||
lookup: std.AutoHashMapUnmanaged(Entry, Index) = .empty,
|
||||
|
||||
pub fn deinit(self: *Self, allocator: Allocator) void {
|
||||
|
||||
@@ -103,7 +103,7 @@ pub const Node = struct {
|
||||
.start = undefined,
|
||||
.end = undefined,
|
||||
},
|
||||
values: std.ArrayListUnmanaged(Entry) = .empty,
|
||||
values: std.ArrayList(Entry) = .empty,
|
||||
|
||||
pub const base_tag: Node.Tag = .map;
|
||||
|
||||
@@ -142,7 +142,7 @@ pub const Node = struct {
|
||||
.start = undefined,
|
||||
.end = undefined,
|
||||
},
|
||||
values: std.ArrayListUnmanaged(*Node) = .empty,
|
||||
values: std.ArrayList(*Node) = .empty,
|
||||
|
||||
pub const base_tag: Node.Tag = .list;
|
||||
|
||||
@@ -169,7 +169,7 @@ pub const Node = struct {
|
||||
.start = undefined,
|
||||
.end = undefined,
|
||||
},
|
||||
string_value: std.ArrayListUnmanaged(u8) = .empty,
|
||||
string_value: std.ArrayList(u8) = .empty,
|
||||
|
||||
pub const base_tag: Node.Tag = .value;
|
||||
|
||||
@@ -194,7 +194,7 @@ pub const Tree = struct {
|
||||
source: []const u8,
|
||||
tokens: []Token,
|
||||
line_cols: std.AutoHashMap(TokenIndex, LineCol),
|
||||
docs: std.ArrayListUnmanaged(*Node) = .empty,
|
||||
docs: std.ArrayList(*Node) = .empty,
|
||||
|
||||
pub fn init(allocator: Allocator) Tree {
|
||||
return .{
|
||||
|
||||
+29
-29
@@ -132,7 +132,7 @@ const debug_usage = normal_usage ++
|
||||
|
||||
const usage = if (build_options.enable_debug_extensions) debug_usage else normal_usage;
|
||||
|
||||
var log_scopes: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var log_scopes: std.ArrayList([]const u8) = .empty;
|
||||
|
||||
pub fn log(
|
||||
comptime level: std.log.Level,
|
||||
@@ -884,7 +884,7 @@ fn buildOutputType(
|
||||
var link_emit_relocs = false;
|
||||
var build_id: ?std.zig.BuildId = null;
|
||||
var runtime_args_start: ?usize = null;
|
||||
var test_filters: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var test_filters: std.ArrayList([]const u8) = .empty;
|
||||
var test_runner_path: ?[]const u8 = null;
|
||||
var override_local_cache_dir: ?[]const u8 = try EnvVar.ZIG_LOCAL_CACHE_DIR.get(arena);
|
||||
var override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena);
|
||||
@@ -912,12 +912,12 @@ fn buildOutputType(
|
||||
var pdb_out_path: ?[]const u8 = null;
|
||||
var error_limit: ?Zcu.ErrorInt = null;
|
||||
// These are before resolving sysroot.
|
||||
var extra_cflags: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var extra_rcflags: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var extra_cflags: std.ArrayList([]const u8) = .empty;
|
||||
var extra_rcflags: std.ArrayList([]const u8) = .empty;
|
||||
var symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .empty;
|
||||
var rc_includes: std.zig.RcIncludes = .any;
|
||||
var manifest_file: ?[]const u8 = null;
|
||||
var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var linker_export_symbol_names: std.ArrayList([]const u8) = .empty;
|
||||
|
||||
// Tracks the position in c_source_files which have already their owner populated.
|
||||
var c_source_files_owner_index: usize = 0;
|
||||
@@ -925,7 +925,7 @@ fn buildOutputType(
|
||||
var rc_source_files_owner_index: usize = 0;
|
||||
|
||||
// null means replace with the test executable binary
|
||||
var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .empty;
|
||||
var test_exec_args: std.ArrayList(?[]const u8) = .empty;
|
||||
|
||||
// These get set by CLI flags and then snapshotted when a `-M` flag is
|
||||
// encountered.
|
||||
@@ -934,8 +934,8 @@ fn buildOutputType(
|
||||
// These get appended to by CLI flags and then slurped when a `-M` flag
|
||||
// is encountered.
|
||||
var cssan: ClangSearchSanitizer = .{};
|
||||
var cc_argv: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var deps: std.ArrayListUnmanaged(CliModule.Dep) = .empty;
|
||||
var cc_argv: std.ArrayList([]const u8) = .empty;
|
||||
var deps: std.ArrayList(CliModule.Dep) = .empty;
|
||||
|
||||
// Contains every module specified via -M. The dependencies are added
|
||||
// after argument parsing is completed. We use a StringArrayHashMap to make
|
||||
@@ -3374,7 +3374,7 @@ fn buildOutputType(
|
||||
|
||||
process.raiseFileDescriptorLimit();
|
||||
|
||||
var file_system_inputs: std.ArrayListUnmanaged(u8) = .empty;
|
||||
var file_system_inputs: std.ArrayList(u8) = .empty;
|
||||
defer file_system_inputs.deinit(gpa);
|
||||
|
||||
// Deduplicate rpath entries
|
||||
@@ -3698,29 +3698,29 @@ const CreateModule = struct {
|
||||
/// directly after computing the target and used to compute link_libc,
|
||||
/// link_libcpp, and then the libraries are filtered into
|
||||
/// `unresolved_link_inputs` and `windows_libs`.
|
||||
cli_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput),
|
||||
cli_link_inputs: std.ArrayList(link.UnresolvedInput),
|
||||
windows_libs: std.StringArrayHashMapUnmanaged(void),
|
||||
/// The local variable `unresolved_link_inputs` is fed into library
|
||||
/// resolution, mutating the input array, and producing this data as
|
||||
/// output. Allocated with gpa.
|
||||
link_inputs: std.ArrayListUnmanaged(link.Input),
|
||||
link_inputs: std.ArrayList(link.Input),
|
||||
|
||||
c_source_files: std.ArrayListUnmanaged(Compilation.CSourceFile),
|
||||
rc_source_files: std.ArrayListUnmanaged(Compilation.RcSourceFile),
|
||||
c_source_files: std.ArrayList(Compilation.CSourceFile),
|
||||
rc_source_files: std.ArrayList(Compilation.RcSourceFile),
|
||||
|
||||
/// e.g. -m3dnow or -mno-outline-atomics. They correspond to std.Target llvm cpu feature names.
|
||||
/// This array is populated by zig cc frontend and then has to be converted to zig-style
|
||||
/// CPU features.
|
||||
llvm_m_args: std.ArrayListUnmanaged([]const u8),
|
||||
llvm_m_args: std.ArrayList([]const u8),
|
||||
sysroot: ?[]const u8,
|
||||
lib_directories: std.ArrayListUnmanaged(Directory),
|
||||
lib_dir_args: std.ArrayListUnmanaged([]const u8),
|
||||
lib_directories: std.ArrayList(Directory),
|
||||
lib_dir_args: std.ArrayList([]const u8),
|
||||
libc_installation: ?LibCInstallation,
|
||||
want_native_include_dirs: bool,
|
||||
frameworks: std.StringArrayHashMapUnmanaged(Framework),
|
||||
native_system_include_paths: []const []const u8,
|
||||
framework_dirs: std.ArrayListUnmanaged([]const u8),
|
||||
rpath_list: std.ArrayListUnmanaged([]const u8),
|
||||
framework_dirs: std.ArrayList([]const u8),
|
||||
rpath_list: std.ArrayList([]const u8),
|
||||
each_lib_rpath: ?bool,
|
||||
libc_paths_file: ?[]const u8,
|
||||
};
|
||||
@@ -3826,7 +3826,7 @@ fn createModule(
|
||||
// We need to know whether the set of system libraries contains anything besides these
|
||||
// to decide whether to trigger native path detection logic.
|
||||
// Preserves linker input order.
|
||||
var unresolved_link_inputs: std.ArrayListUnmanaged(link.UnresolvedInput) = .empty;
|
||||
var unresolved_link_inputs: std.ArrayList(link.UnresolvedInput) = .empty;
|
||||
defer unresolved_link_inputs.deinit(gpa);
|
||||
try unresolved_link_inputs.ensureUnusedCapacity(gpa, create_module.cli_link_inputs.items.len);
|
||||
var any_name_queries_remaining = false;
|
||||
@@ -4215,11 +4215,11 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {
|
||||
if (comp.time_report) |*tr| {
|
||||
var decls_len: u32 = 0;
|
||||
|
||||
var file_name_bytes: std.ArrayListUnmanaged(u8) = .empty;
|
||||
var file_name_bytes: std.ArrayList(u8) = .empty;
|
||||
defer file_name_bytes.deinit(gpa);
|
||||
var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty;
|
||||
defer files.deinit(gpa);
|
||||
var decl_data: std.ArrayListUnmanaged(u8) = .empty;
|
||||
var decl_data: std.ArrayList(u8) = .empty;
|
||||
defer decl_data.deinit(gpa);
|
||||
|
||||
// Each decl needs at least 34 bytes:
|
||||
@@ -4546,7 +4546,7 @@ fn cmdTranslateC(
|
||||
comp: *Compilation,
|
||||
arena: Allocator,
|
||||
fancy_output: ?*Compilation.CImportResult,
|
||||
file_system_inputs: ?*std.ArrayListUnmanaged(u8),
|
||||
file_system_inputs: ?*std.ArrayList(u8),
|
||||
prog_node: std.Progress.Node,
|
||||
) !void {
|
||||
dev.check(.translate_c_command);
|
||||
@@ -4754,7 +4754,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
|
||||
}
|
||||
|
||||
fn sanitizeExampleName(arena: Allocator, bytes: []const u8) error{OutOfMemory}![]const u8 {
|
||||
var result: std.ArrayListUnmanaged(u8) = .empty;
|
||||
var result: std.ArrayList(u8) = .empty;
|
||||
for (bytes, 0..) |byte, i| switch (byte) {
|
||||
'0'...'9' => {
|
||||
if (i == 0) try result.append(arena, '_');
|
||||
@@ -5486,7 +5486,7 @@ fn jitCmd(
|
||||
});
|
||||
defer thread_pool.deinit();
|
||||
|
||||
var child_argv: std.ArrayListUnmanaged([]const u8) = .empty;
|
||||
var child_argv: std.ArrayList([]const u8) = .empty;
|
||||
try child_argv.ensureUnusedCapacity(arena, args.len + 4);
|
||||
|
||||
// We want to release all the locks before executing the child process, so we make a nice
|
||||
@@ -6687,7 +6687,7 @@ const ClangSearchSanitizer = struct {
|
||||
fn addIncludePath(
|
||||
self: *@This(),
|
||||
ally: Allocator,
|
||||
argv: *std.ArrayListUnmanaged([]const u8),
|
||||
argv: *std.ArrayList([]const u8),
|
||||
group: Group,
|
||||
arg: []const u8,
|
||||
dir: []const u8,
|
||||
@@ -7436,10 +7436,10 @@ fn handleModArg(
|
||||
opt_root_src_orig: ?[]const u8,
|
||||
create_module: *CreateModule,
|
||||
mod_opts: *Package.Module.CreateOptions.Inherited,
|
||||
cc_argv: *std.ArrayListUnmanaged([]const u8),
|
||||
cc_argv: *std.ArrayList([]const u8),
|
||||
target_arch_os_abi: *?[]const u8,
|
||||
target_mcpu: *?[]const u8,
|
||||
deps: *std.ArrayListUnmanaged(CliModule.Dep),
|
||||
deps: *std.ArrayList(CliModule.Dep),
|
||||
c_source_files_owner_index: *usize,
|
||||
rc_source_files_owner_index: *usize,
|
||||
cssan: *ClangSearchSanitizer,
|
||||
@@ -7513,12 +7513,12 @@ fn anyObjectLinkInputs(link_inputs: []const link.UnresolvedInput) bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn addLibDirectoryWarn(lib_directories: *std.ArrayListUnmanaged(Directory), path: []const u8) void {
|
||||
fn addLibDirectoryWarn(lib_directories: *std.ArrayList(Directory), path: []const u8) void {
|
||||
return addLibDirectoryWarn2(lib_directories, path, false);
|
||||
}
|
||||
|
||||
fn addLibDirectoryWarn2(
|
||||
lib_directories: *std.ArrayListUnmanaged(Directory),
|
||||
lib_directories: *std.ArrayList(Directory),
|
||||
path: []const u8,
|
||||
ignore_not_found: bool,
|
||||
) void {
|
||||
|
||||
@@ -483,7 +483,7 @@ fn MockFunction(comptime Register: type) type {
|
||||
return struct {
|
||||
allocator: Allocator,
|
||||
register_manager: Register.RM = .{},
|
||||
spilled: std.ArrayListUnmanaged(Register) = .empty,
|
||||
spilled: std.ArrayList(Register) = .empty,
|
||||
|
||||
const Self = @This();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user