mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-10-28 10:45:48 +08:00
Replace usages of AutoArrayHashMapUnmanaged with array_hash_map.Auto
This commit is contained in:
53 files changed
+284
-284
No files matched your search
@@ -49,7 +49,7 @@ web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn,
|
||||
/// Allocated into `gpa`.
|
||||
memory_blocked_steps: std.ArrayList(Configuration.Step.Index),
|
||||
/// Allocated into `gpa`.
|
||||
step_stack: std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),
|
||||
step_stack: std.array_hash_map.Auto(Configuration.Step.Index, void),
|
||||
pkg_config: PkgConfig,
|
||||
|
||||
error_style: ErrorStyle,
|
||||
@@ -1217,7 +1217,7 @@ fn printTreeStep(
|
||||
step_index: Configuration.Step.Index,
|
||||
stderr: Io.Terminal,
|
||||
parent_node: *PrintNode,
|
||||
step_stack: *std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),
|
||||
step_stack: *std.array_hash_map.Auto(Configuration.Step.Index, void),
|
||||
) !void {
|
||||
const writer = stderr.writer;
|
||||
const first = step_stack.swapRemove(step_index);
|
||||
@@ -1502,7 +1502,7 @@ fn printChildNodePrefix(stderr: Io.Terminal) !void {
|
||||
fn constructGraphAndCheckForDependencyLoop(
|
||||
maker: *Maker,
|
||||
step_index: Configuration.Step.Index,
|
||||
step_stack: *std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void),
|
||||
step_stack: *std.array_hash_map.Auto(Configuration.Step.Index, void),
|
||||
rand: std.Random,
|
||||
) error{ DependencyLoopDetected, OutOfMemory }!void {
|
||||
const c = &maker.scanned_config.configuration;
|
||||
|
||||
@@ -27,7 +27,7 @@ prog_node: std.Progress.Node,
|
||||
|
||||
/// Protects `coverage_files`.
|
||||
coverage_mutex: Io.Mutex,
|
||||
coverage_files: std.AutoArrayHashMapUnmanaged(u64, CoverageMap),
|
||||
coverage_files: std.array_hash_map.Auto(u64, CoverageMap),
|
||||
|
||||
queue_mutex: Io.Mutex,
|
||||
queue_cond: Io.Condition,
|
||||
|
||||
@@ -119,7 +119,7 @@ fn updateGeneratedFile(
|
||||
|
||||
/// List of importable modules in a compilation's module graph, including
|
||||
/// the root module. The root module is guaranteed to be first.
|
||||
const ModuleList = std.AutoArrayHashMapUnmanaged(Configuration.Module.Index, Configuration.String);
|
||||
const ModuleList = std.array_hash_map.Auto(Configuration.Module.Index, Configuration.String);
|
||||
/// Keyed on the first key in the module list.
|
||||
pub const ModuleGraph = std.ArrayHashMapUnmanaged(ModuleList, void, ModuleListContext, false);
|
||||
|
||||
@@ -221,8 +221,8 @@ fn lowerZigArgs(
|
||||
// module, along with any C compiler arguments that need to be passed
|
||||
// to the compiler for each module individually as reported by
|
||||
// pkg-config.
|
||||
var seen_system_libs: std.AutoArrayHashMapUnmanaged(Configuration.String, []const []const u8) = .empty;
|
||||
var frameworks: std.AutoArrayHashMapUnmanaged(Configuration.String, Configuration.Module.Framework.Flags) = .empty;
|
||||
var seen_system_libs: std.array_hash_map.Auto(Configuration.String, []const []const u8) = .empty;
|
||||
var frameworks: std.array_hash_map.Auto(Configuration.String, Configuration.Module.Framework.Flags) = .empty;
|
||||
var module_graph: ModuleGraph = .empty;
|
||||
|
||||
var prev_has_cflags = false;
|
||||
@@ -1126,7 +1126,7 @@ fn moduleNeedsCliArg(mod: *const Configuration.Module, conf: *const Configuratio
|
||||
}
|
||||
|
||||
const CliNamedModules = struct {
|
||||
modules: std.AutoArrayHashMapUnmanaged(Configuration.Module.Index, void),
|
||||
modules: std.array_hash_map.Auto(Configuration.Module.Index, void),
|
||||
names: std.array_hash_map.String(void),
|
||||
|
||||
/// Traverse the whole dependency graph and give every module a unique
|
||||
@@ -1177,7 +1177,7 @@ pub fn getCompileDependencies(
|
||||
start: Configuration.Step.Index,
|
||||
chase_dynamic: bool,
|
||||
) ![]const Configuration.Step.Index {
|
||||
var compiles: std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, void) = .empty;
|
||||
var compiles: std.array_hash_map.Auto(Configuration.Step.Index, void) = .empty;
|
||||
var compiles_i: usize = 0;
|
||||
|
||||
try compiles.putNoClobber(arena, start, {});
|
||||
|
||||
@@ -66,7 +66,7 @@ pub fn make(
|
||||
|
||||
var prev_search_strategy: std.Build.Module.SystemLib.SearchStrategy = .paths_first;
|
||||
var prev_preferred_link_mode: std.builtin.LinkMode = .dynamic;
|
||||
var seen_system_libs: std.AutoArrayHashMapUnmanaged(Configuration.String, []const []const u8) = .empty;
|
||||
var seen_system_libs: std.array_hash_map.Auto(Configuration.String, []const []const u8) = .empty;
|
||||
|
||||
for (conf_tc.system_libs.slice) |system_lib_index| {
|
||||
const system_lib = system_lib_index.get(conf);
|
||||
|
||||
@@ -31,7 +31,7 @@ const DirTable = std.ArrayHashMapUnmanaged(Cache.Path, void, Cache.Path.TableAda
|
||||
|
||||
/// Special key of "." means any changes in this directory trigger the steps.
|
||||
const ReactionSet = std.array_hash_map.String(StepSet);
|
||||
const StepSet = std.AutoArrayHashMapUnmanaged(Configuration.Step.Index, Generation);
|
||||
const StepSet = std.array_hash_map.Auto(Configuration.Step.Index, Generation);
|
||||
|
||||
const Generation = u8;
|
||||
|
||||
@@ -46,7 +46,7 @@ const Os = switch (builtin.os.tag) {
|
||||
handle_table: HandleTable,
|
||||
/// fanotify file descriptors are keyed by mount id since marks
|
||||
/// are limited to a single filesystem.
|
||||
poll_fds: std.AutoArrayHashMapUnmanaged(MountId, posix.pollfd),
|
||||
poll_fds: std.array_hash_map.Auto(MountId, posix.pollfd),
|
||||
|
||||
const MountId = i32;
|
||||
const HandleTable = std.ArrayHashMapUnmanaged(FileHandle, struct { mount_id: MountId, reaction_set: ReactionSet }, FileHandle.Adapter, false);
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ const Limb = std.math.big.Limb;
|
||||
|
||||
const Interner = @This();
|
||||
|
||||
map: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
|
||||
map: std.array_hash_map.Auto(void, void) = .empty,
|
||||
items: std.MultiArrayList(struct {
|
||||
tag: Tag,
|
||||
data: u32,
|
||||
|
||||
Vendored
+1
-1
@@ -380,7 +380,7 @@ const REF = std.Io.Terminal.Color.bright_blue;
|
||||
const LITERAL = std.Io.Terminal.Color.bright_green;
|
||||
const ATTRIBUTE = std.Io.Terminal.Color.bright_yellow;
|
||||
|
||||
const RefMap = std.AutoArrayHashMapUnmanaged(Ref, void);
|
||||
const RefMap = std.array_hash_map.Auto(Ref, void);
|
||||
|
||||
pub const DumpError = std.Io.Terminal.SetColorError || std.mem.Allocator.Error;
|
||||
|
||||
|
||||
@@ -160,10 +160,10 @@ pub fn main(init: process.Init.Minimal) !void {
|
||||
const Serialize = struct {
|
||||
arena: Allocator,
|
||||
wc: *Configuration.Wip,
|
||||
module_map: std.AutoArrayHashMapUnmanaged(*std.Build.Module, Configuration.Module.Index) = .empty,
|
||||
package_map: std.AutoArrayHashMapUnmanaged(*std.Build, Configuration.Package.Index) = .empty,
|
||||
module_map: std.array_hash_map.Auto(*std.Build.Module, Configuration.Module.Index) = .empty,
|
||||
package_map: std.array_hash_map.Auto(*std.Build, Configuration.Package.Index) = .empty,
|
||||
/// Index corresponds to `Configuration.steps` index.
|
||||
step_map: std.AutoArrayHashMapUnmanaged(*Step, void) = .empty,
|
||||
step_map: std.array_hash_map.Auto(*Step, void) = .empty,
|
||||
|
||||
fn builderToPackage(s: *Serialize, b: *std.Build) !Configuration.Package.Index {
|
||||
if (b.pkg_hash.len == 0) return .root;
|
||||
|
||||
Vendored
+2
-2
@@ -3049,7 +3049,7 @@ pub const StringTablesByLanguage = struct {
|
||||
/// when the first STRINGTABLE for the language was defined, and all blocks for a given
|
||||
/// language are written contiguously.
|
||||
/// Using an ArrayHashMap here gives us this property for free.
|
||||
tables: std.AutoArrayHashMapUnmanaged(res.Language, StringTable) = .empty,
|
||||
tables: std.array_hash_map.Auto(res.Language, StringTable) = .empty,
|
||||
|
||||
pub fn deinit(self: *StringTablesByLanguage, allocator: Allocator) void {
|
||||
self.tables.deinit(allocator);
|
||||
@@ -3080,7 +3080,7 @@ pub const StringTable = struct {
|
||||
/// was added to the block (i.e. `STRINGTABLE { 16 "b" 0 "a" }` would then get written
|
||||
/// with block ID 2 (the one with "b") first and block ID 1 (the one with "a") second).
|
||||
/// Using an ArrayHashMap here gives us this property for free.
|
||||
blocks: std.AutoArrayHashMapUnmanaged(u16, Block) = .empty,
|
||||
blocks: std.array_hash_map.Auto(u16, Block) = .empty,
|
||||
|
||||
pub const Block = struct {
|
||||
strings: std.ArrayList(Token) = .empty,
|
||||
|
||||
Vendored
+1
-1
@@ -451,7 +451,7 @@ const ResourceTree = struct {
|
||||
resource: *const Resource,
|
||||
original_index: usize,
|
||||
};
|
||||
const LanguageToResourceMap = std.AutoArrayHashMapUnmanaged(Language, RelocatableResource);
|
||||
const LanguageToResourceMap = std.array_hash_map.Auto(Language, RelocatableResource);
|
||||
const NameToLanguageMap = std.ArrayHashMapUnmanaged(NameOrOrdinal, LanguageToResourceMap, NameOrOrdinalHashContext, true);
|
||||
|
||||
const NameOrOrdinalHashContext = struct {
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ global_scope: *Scope.Root,
|
||||
mangle_count: u32 = 0,
|
||||
|
||||
/// Table of declarations for enum, struct, union and typedef types.
|
||||
type_decls: std.AutoArrayHashMapUnmanaged(Node.Index, []const u8) = .empty,
|
||||
type_decls: std.array_hash_map.Auto(Node.Index, []const u8) = .empty,
|
||||
/// Table of record decls that have been demoted to opaques.
|
||||
opaque_demotes: std.HashMapUnmanaged(QualType, void, QualTypeHashContext, std.hash_map.default_max_load_percentage) = .empty,
|
||||
/// Table of unnamed enums and records that are child types of typedefs.
|
||||
|
||||
@@ -42,17 +42,17 @@ pub const Category = union(enum(u8)) {
|
||||
pub const File = struct {
|
||||
ast: Ast,
|
||||
/// Maps identifiers to the declarations they point to.
|
||||
ident_decls: std.AutoArrayHashMapUnmanaged(Ast.TokenIndex, Ast.Node.Index) = .empty,
|
||||
ident_decls: std.array_hash_map.Auto(Ast.TokenIndex, Ast.Node.Index) = .empty,
|
||||
/// Maps field access identifiers to the containing field access node.
|
||||
token_parents: std.AutoArrayHashMapUnmanaged(Ast.TokenIndex, Ast.Node.Index) = .empty,
|
||||
token_parents: std.array_hash_map.Auto(Ast.TokenIndex, Ast.Node.Index) = .empty,
|
||||
/// Maps declarations to their global index.
|
||||
node_decls: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, Decl.Index) = .empty,
|
||||
node_decls: std.array_hash_map.Auto(Ast.Node.Index, Decl.Index) = .empty,
|
||||
/// Maps function declarations to doctests.
|
||||
doctests: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, Ast.Node.Index) = .empty,
|
||||
doctests: std.array_hash_map.Auto(Ast.Node.Index, Ast.Node.Index) = .empty,
|
||||
/// root node => its namespace scope
|
||||
/// struct/union/enum/opaque decl node => its namespace scope
|
||||
/// local var decl node => its local variable scope
|
||||
scopes: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, *Scope) = .empty,
|
||||
scopes: std.array_hash_map.Auto(Ast.Node.Index, *Scope) = .empty,
|
||||
|
||||
pub fn lookup_token(file: *File, token: Ast.TokenIndex) Decl.Index {
|
||||
const decl_node = file.ident_decls.get(token) orelse return .none;
|
||||
|
||||
@@ -563,7 +563,7 @@ pub fn getGraph(root: *Module) Graph {
|
||||
|
||||
const arena = root.owner.graph.arena;
|
||||
|
||||
var modules: std.AutoArrayHashMapUnmanaged(*std.Build.Module, []const u8) = .empty;
|
||||
var modules: std.array_hash_map.Auto(*std.Build.Module, []const u8) = .empty;
|
||||
var next_idx: usize = 0;
|
||||
|
||||
modules.putNoClobber(arena, root, "root") catch @panic("OOM");
|
||||
|
||||
@@ -759,7 +759,7 @@ pub fn rootModuleTarget(c: *Compile) std.Target {
|
||||
pub fn getCompileDependencies(start: *Compile, chase_dynamic: bool) []const *Compile {
|
||||
const arena = start.step.owner.graph.arena;
|
||||
|
||||
var compiles: std.AutoArrayHashMapUnmanaged(*Compile, void) = .empty;
|
||||
var compiles: std.array_hash_map.Auto(*Compile, void) = .empty;
|
||||
var next_idx: usize = 0;
|
||||
|
||||
compiles.putNoClobber(arena, start, {}) catch @panic("OOM");
|
||||
|
||||
@@ -40,7 +40,7 @@ const Thread = struct {
|
||||
steal_ready_search_index: u32,
|
||||
/// For ensuring multiple fibers waiting on the same file descriptor and
|
||||
/// filter use the same kevent.
|
||||
wait_queues: std.AutoArrayHashMapUnmanaged(WaitQueueKey, *Fiber),
|
||||
wait_queues: std.array_hash_map.Auto(WaitQueueKey, *Fiber),
|
||||
|
||||
const WaitQueueKey = struct {
|
||||
ident: usize,
|
||||
|
||||
@@ -134,7 +134,7 @@ pub const CompileUnit = struct {
|
||||
files: []FileEntry,
|
||||
version: u16,
|
||||
|
||||
pub const LineTable = std.AutoArrayHashMapUnmanaged(u64, LineEntry);
|
||||
pub const LineTable = std.array_hash_map.Auto(u64, LineEntry);
|
||||
|
||||
pub const LineEntry = struct {
|
||||
line: u32,
|
||||
|
||||
@@ -4,7 +4,7 @@ strings: []const u8,
|
||||
text_vmaddr: u64,
|
||||
|
||||
/// Key is index into `strings` of the file path.
|
||||
ofiles: std.AutoArrayHashMapUnmanaged(u32, Error!OFile),
|
||||
ofiles: std.array_hash_map.Auto(u32, Error!OFile),
|
||||
|
||||
pub const Error = error{
|
||||
InvalidMachO,
|
||||
|
||||
@@ -52,7 +52,7 @@ within_fn: bool = false,
|
||||
fn_ret_ty: Zir.Inst.Ref = .none,
|
||||
/// Maps string table indexes to the first `@import` ZIR instruction
|
||||
/// that uses this string as the operand.
|
||||
imports: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, Ast.TokenIndex) = .empty,
|
||||
imports: std.array_hash_map.Auto(Zir.NullTerminatedString, Ast.TokenIndex) = .empty,
|
||||
/// Used for temporary storage when building payloads.
|
||||
scratch: std.ArrayList(u32) = .empty,
|
||||
/// Whenever a `ref` instruction is needed, it is created and saved in this
|
||||
@@ -11163,7 +11163,7 @@ const Scope = struct {
|
||||
declaring_gz: ?*GenZir,
|
||||
|
||||
/// Set of captures used by this namespace.
|
||||
captures: std.AutoArrayHashMapUnmanaged(Zir.Inst.Capture, Zir.NullTerminatedString) = .empty,
|
||||
captures: std.array_hash_map.Auto(Zir.Inst.Capture, Zir.NullTerminatedString) = .empty,
|
||||
|
||||
fn deinit(self: *Namespace, gpa: Allocator) void {
|
||||
self.decls.deinit(gpa);
|
||||
@@ -12856,9 +12856,9 @@ fn scanContainer(
|
||||
var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, astgen.gpa);
|
||||
const bfa = bfa_state.allocator();
|
||||
|
||||
var names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;
|
||||
var test_names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;
|
||||
var decltest_names: std.AutoArrayHashMapUnmanaged(Zir.NullTerminatedString, NameEntry) = .empty;
|
||||
var names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
|
||||
var test_names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
|
||||
var decltest_names: std.array_hash_map.Auto(Zir.NullTerminatedString, NameEntry) = .empty;
|
||||
defer {
|
||||
names.deinit(bfa);
|
||||
test_names.deinit(bfa);
|
||||
|
||||
@@ -21,25 +21,25 @@ data_layout: String,
|
||||
target_triple: String,
|
||||
module_asm: std.ArrayList(u8),
|
||||
|
||||
string_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
string_map: std.array_hash_map.Auto(void, void),
|
||||
string_indices: std.ArrayList(u32),
|
||||
string_bytes: std.ArrayList(u8),
|
||||
|
||||
types: std.AutoArrayHashMapUnmanaged(String, Type),
|
||||
types: std.array_hash_map.Auto(String, Type),
|
||||
next_unnamed_type: String,
|
||||
next_unique_type_id: std.AutoHashMapUnmanaged(String, u32),
|
||||
type_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
type_map: std.array_hash_map.Auto(void, void),
|
||||
type_items: std.ArrayList(Type.Item),
|
||||
type_extra: std.ArrayList(u32),
|
||||
|
||||
attributes: std.AutoArrayHashMapUnmanaged(Attribute.Storage, void),
|
||||
attributes_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
attributes: std.array_hash_map.Auto(Attribute.Storage, void),
|
||||
attributes_map: std.array_hash_map.Auto(void, void),
|
||||
attributes_indices: std.ArrayList(u32),
|
||||
attributes_extra: std.ArrayList(u32),
|
||||
|
||||
function_attributes_set: std.AutoArrayHashMapUnmanaged(FunctionAttributes, void),
|
||||
function_attributes_set: std.array_hash_map.Auto(FunctionAttributes, void),
|
||||
|
||||
globals: std.AutoArrayHashMapUnmanaged(StrtabString, Global),
|
||||
globals: std.array_hash_map.Auto(StrtabString, Global),
|
||||
next_unnamed_global: StrtabString,
|
||||
next_replaced_global: StrtabString,
|
||||
next_unique_global_id: std.AutoHashMapUnmanaged(StrtabString, u32),
|
||||
@@ -47,28 +47,28 @@ aliases: std.ArrayList(Alias),
|
||||
variables: std.ArrayList(Variable),
|
||||
functions: std.ArrayList(Function),
|
||||
|
||||
strtab_string_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
strtab_string_map: std.array_hash_map.Auto(void, void),
|
||||
strtab_string_indices: std.ArrayList(u32),
|
||||
strtab_string_bytes: std.ArrayList(u8),
|
||||
|
||||
constant_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
constant_map: std.array_hash_map.Auto(void, void),
|
||||
constant_items: std.MultiArrayList(Constant.Item),
|
||||
constant_extra: std.ArrayList(u32),
|
||||
constant_limbs: std.ArrayList(std.math.big.Limb),
|
||||
|
||||
alignment_forward_references: std.ArrayList(Alignment),
|
||||
|
||||
metadata_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
metadata_map: std.array_hash_map.Auto(void, void),
|
||||
metadata_items: std.MultiArrayList(Metadata.Item),
|
||||
metadata_extra: std.ArrayList(u32),
|
||||
metadata_limbs: std.ArrayList(std.math.big.Limb),
|
||||
metadata_forward_references: std.ArrayList(Metadata.Optional),
|
||||
metadata_named: std.AutoArrayHashMapUnmanaged(String, struct {
|
||||
metadata_named: std.array_hash_map.Auto(String, struct {
|
||||
len: u32,
|
||||
index: Metadata.Item.ExtraIndex,
|
||||
}),
|
||||
|
||||
metadata_string_map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
metadata_string_map: std.array_hash_map.Auto(void, void),
|
||||
metadata_string_indices: std.ArrayList(u32),
|
||||
metadata_string_bytes: std.ArrayList(u8),
|
||||
|
||||
@@ -1633,7 +1633,7 @@ pub const FunctionAttributes = enum(u32) {
|
||||
pub const Wip = struct {
|
||||
maps: Maps = .empty,
|
||||
|
||||
const Map = std.AutoArrayHashMapUnmanaged(Attribute.Kind, Attribute.Index);
|
||||
const Map = std.array_hash_map.Auto(Attribute.Kind, Attribute.Index);
|
||||
const Maps = std.ArrayList(Map);
|
||||
|
||||
pub fn deinit(self: *Wip, builder: *const Builder) void {
|
||||
@@ -5235,8 +5235,8 @@ pub const WipFunction = struct {
|
||||
instructions: std.MultiArrayList(Instruction),
|
||||
names: std.ArrayList(String),
|
||||
strip: bool,
|
||||
debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation),
|
||||
debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void),
|
||||
debug_locations: std.array_hash_map.Auto(Instruction.Index, DebugLocation),
|
||||
debug_values: std.array_hash_map.Auto(Instruction.Index, void),
|
||||
extra: std.ArrayList(u32),
|
||||
|
||||
pub const Cursor = struct { block: Block.Index, instruction: u32 = 0 };
|
||||
@@ -8451,7 +8451,7 @@ pub const Metadata = packed struct(u32) {
|
||||
const Formatter = struct {
|
||||
builder: *Builder,
|
||||
need_comma: bool,
|
||||
map: std.AutoArrayHashMapUnmanaged(union(enum) {
|
||||
map: std.array_hash_map.Auto(union(enum) {
|
||||
metadata: Metadata,
|
||||
debug_location: DebugLocation.Location,
|
||||
}, void) = .empty,
|
||||
@@ -9791,7 +9791,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
|
||||
}
|
||||
}
|
||||
|
||||
var attribute_groups: std.AutoArrayHashMapUnmanaged(Attributes, void) = .empty;
|
||||
var attribute_groups: std.array_hash_map.Auto(Attributes, void) = .empty;
|
||||
defer attribute_groups.deinit(self.gpa);
|
||||
|
||||
for (0.., self.functions.items) |function_i, function| {
|
||||
@@ -13507,7 +13507,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
|
||||
try type_block.end();
|
||||
}
|
||||
|
||||
var attributes_set: std.AutoArrayHashMapUnmanaged(struct {
|
||||
var attributes_set: std.array_hash_map.Auto(struct {
|
||||
attributes: Attributes,
|
||||
index: u32,
|
||||
}, void) = .{};
|
||||
@@ -13743,7 +13743,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
|
||||
try paramattr_block.end();
|
||||
}
|
||||
|
||||
var globals: std.AutoArrayHashMapUnmanaged(Global.Index, void) = .empty;
|
||||
var globals: std.array_hash_map.Auto(Global.Index, void) = .empty;
|
||||
defer globals.deinit(self.gpa);
|
||||
try globals.ensureUnusedCapacity(
|
||||
self.gpa,
|
||||
@@ -13784,7 +13784,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
|
||||
|
||||
const ConstantAdapter = struct {
|
||||
builder: *const Builder,
|
||||
globals: *const std.AutoArrayHashMapUnmanaged(Global.Index, void),
|
||||
globals: *const std.array_hash_map.Auto(Global.Index, void),
|
||||
|
||||
pub fn get(adapter: @This(), param: anytype) switch (@TypeOf(param)) {
|
||||
Constant => u32,
|
||||
@@ -13815,7 +13815,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
|
||||
|
||||
// Globals
|
||||
{
|
||||
var section_map: std.AutoArrayHashMapUnmanaged(String, void) = .empty;
|
||||
var section_map: std.array_hash_map.Auto(String, void) = .empty;
|
||||
defer section_map.deinit(self.gpa);
|
||||
try section_map.ensureUnusedCapacity(self.gpa, globals.count());
|
||||
|
||||
|
||||
+14
-14
@@ -103,8 +103,8 @@ native_system_include_paths: []const []const u8,
|
||||
/// Corresponds to `-u <symbol>` for ELF/MachO and `/include:<symbol>` for COFF/PE.
|
||||
force_undefined_symbols: std.array_hash_map.String(void),
|
||||
|
||||
c_object_table: std.AutoArrayHashMapUnmanaged(*CObject, void) = .empty,
|
||||
win32_resource_table: if (dev.env.supports(.win32_resource)) std.AutoArrayHashMapUnmanaged(*Win32Resource, void) else struct {
|
||||
c_object_table: std.array_hash_map.Auto(*CObject, void) = .empty,
|
||||
win32_resource_table: if (dev.env.supports(.win32_resource)) std.array_hash_map.Auto(*Win32Resource, void) else struct {
|
||||
pub fn keys(_: @This()) [0]void {
|
||||
return .{};
|
||||
}
|
||||
@@ -145,11 +145,11 @@ win32_resource_work_queue: if (dev.env.supports(.win32_resource)) std.Deque(*Win
|
||||
|
||||
/// The ErrorMsg memory is owned by the `CObject`, using Compilation's general purpose allocator.
|
||||
/// This data is accessed by multiple threads and is protected by `mutex`.
|
||||
failed_c_objects: std.AutoArrayHashMapUnmanaged(*CObject, *CObject.Diag.Bundle) = .empty,
|
||||
failed_c_objects: std.array_hash_map.Auto(*CObject, *CObject.Diag.Bundle) = .empty,
|
||||
|
||||
/// The ErrorBundle memory is owned by the `Win32Resource`, using Compilation's general purpose allocator.
|
||||
/// This data is accessed by multiple threads and is protected by `mutex`.
|
||||
failed_win32_resources: if (dev.env.supports(.win32_resource)) std.AutoArrayHashMapUnmanaged(*Win32Resource, ErrorBundle) else struct {
|
||||
failed_win32_resources: if (dev.env.supports(.win32_resource)) std.array_hash_map.Auto(*Win32Resource, ErrorBundle) else struct {
|
||||
pub fn values(_: @This()) [0]void {
|
||||
return .{};
|
||||
}
|
||||
@@ -157,7 +157,7 @@ failed_win32_resources: if (dev.env.supports(.win32_resource)) std.AutoArrayHash
|
||||
} = .{},
|
||||
|
||||
/// Miscellaneous things that can fail.
|
||||
misc_failures: std.AutoArrayHashMapUnmanaged(MiscTask, MiscError) = .empty,
|
||||
misc_failures: std.array_hash_map.Auto(MiscTask, MiscError) = .empty,
|
||||
|
||||
/// When this is `true` it means invoking clang as a sub-process is expected to inherit
|
||||
/// stdin, stdout, stderr, and if it returns non success, to forward the exit code.
|
||||
@@ -865,7 +865,7 @@ pub const TimeReport = struct {
|
||||
/// a function) all generic instances of this function. It also includes time spent analyzing
|
||||
/// function bodies if this is a function (generic or otherwise).
|
||||
/// An entry not existing means the declaration has not been analyzed (so far).
|
||||
decl_sema_info: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, struct {
|
||||
decl_sema_info: std.array_hash_map.Auto(InternPool.TrackedInst.Index, struct {
|
||||
ns: u64,
|
||||
count: u32,
|
||||
}),
|
||||
@@ -875,14 +875,14 @@ pub const TimeReport = struct {
|
||||
/// instances, both of this function itself and of its parent namespace.
|
||||
/// An entry not existing means the declaration has not been codegenned (so far).
|
||||
/// Every key in `decl_codegen_ns` is also in `decl_sema_ns`.
|
||||
decl_codegen_ns: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, u64),
|
||||
decl_codegen_ns: std.array_hash_map.Auto(InternPool.TrackedInst.Index, u64),
|
||||
|
||||
/// Key is a ZIR `declaration` instruction which is anything other than a `comptime` decl; value
|
||||
/// is the number of nanoseconds spent linking it into the binary. As above, this is the total
|
||||
/// across all generic instances.
|
||||
/// An entry not existing means the declaration has not been linked (so far).
|
||||
/// Every key in `decl_link_ns` is also in `decl_sema_ns`.
|
||||
decl_link_ns: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, u64),
|
||||
decl_link_ns: std.array_hash_map.Auto(InternPool.TrackedInst.Index, u64),
|
||||
|
||||
pub fn deinit(tr: *TimeReport, gpa: Allocator) void {
|
||||
tr.stats = undefined;
|
||||
@@ -1068,8 +1068,8 @@ pub const CObject = struct {
|
||||
}
|
||||
|
||||
pub const Bundle = struct {
|
||||
file_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty,
|
||||
category_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty,
|
||||
file_names: std.array_hash_map.Auto(u32, []const u8) = .empty,
|
||||
category_names: std.array_hash_map.Auto(u32, []const u8) = .empty,
|
||||
diags: []Diag = &.{},
|
||||
|
||||
pub fn destroy(bundle: *Bundle, gpa: Allocator) void {
|
||||
@@ -1122,13 +1122,13 @@ pub const CObject = struct {
|
||||
var bc = std.zig.llvm.BitcodeReader.init(gpa, .{ .reader = &file_reader.interface });
|
||||
defer bc.deinit();
|
||||
|
||||
var file_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty;
|
||||
var file_names: std.array_hash_map.Auto(u32, []const u8) = .empty;
|
||||
errdefer {
|
||||
for (file_names.values()) |file_name| gpa.free(file_name);
|
||||
file_names.deinit(gpa);
|
||||
}
|
||||
|
||||
var category_names: std.AutoArrayHashMapUnmanaged(u32, []const u8) = .empty;
|
||||
var category_names: std.array_hash_map.Auto(u32, []const u8) = .empty;
|
||||
errdefer {
|
||||
for (category_names.values()) |category_name| gpa.free(category_name);
|
||||
category_names.deinit(gpa);
|
||||
@@ -4064,7 +4064,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) error{OutOfMemory}!ErrorBundle {
|
||||
}
|
||||
}
|
||||
if (zcu.skip_analysis_this_update) break :zcu_errors;
|
||||
var sorted_failed_analysis: std.AutoArrayHashMapUnmanaged(InternPool.AnalUnit, *Zcu.ErrorMsg).DataList.Slice = s: {
|
||||
var sorted_failed_analysis: std.array_hash_map.Auto(InternPool.AnalUnit, *Zcu.ErrorMsg).DataList.Slice = s: {
|
||||
const SortOrder = struct {
|
||||
zcu: *Zcu,
|
||||
errors: []const *Zcu.ErrorMsg,
|
||||
@@ -4831,7 +4831,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
|
||||
var buffer: [1024]u8 = undefined;
|
||||
var tar_file_writer = tar_file.writer(io, &buffer);
|
||||
|
||||
var seen_table: std.AutoArrayHashMapUnmanaged(*Package.Module, []const u8) = .empty;
|
||||
var seen_table: std.array_hash_map.Auto(*Package.Module, []const u8) = .empty;
|
||||
defer seen_table.deinit(comp.gpa);
|
||||
|
||||
try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name);
|
||||
|
||||
+12
-12
@@ -41,22 +41,22 @@ tid_shift_32: if (single_threaded) u0 else std.math.Log2Int(u32),
|
||||
/// * For a `func`, this is the source of the full function signature.
|
||||
/// These are also invalidated if tracking fails for this instruction.
|
||||
/// Value is index into `dep_entries` of the first dependency on this hash.
|
||||
src_hash_deps: std.AutoArrayHashMapUnmanaged(TrackedInst.Index, DepEntry.Index),
|
||||
src_hash_deps: std.array_hash_map.Auto(TrackedInst.Index, DepEntry.Index),
|
||||
/// Dependencies on the value of a Nav.
|
||||
/// Value is index into `dep_entries` of the first dependency on this Nav value.
|
||||
nav_val_deps: std.AutoArrayHashMapUnmanaged(Nav.Index, DepEntry.Index),
|
||||
nav_val_deps: std.array_hash_map.Auto(Nav.Index, DepEntry.Index),
|
||||
/// Dependencies on the type of a Nav.
|
||||
/// Value is index into `dep_entries` of the first dependency on this Nav value.
|
||||
nav_ty_deps: std.AutoArrayHashMapUnmanaged(Nav.Index, DepEntry.Index),
|
||||
nav_ty_deps: std.array_hash_map.Auto(Nav.Index, DepEntry.Index),
|
||||
/// Dependencies on a function's inferred error set. Key is the function body, not the IES.
|
||||
/// Value is index into `dep_entries` of the first dependency on this function's IES.
|
||||
func_ies_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),
|
||||
func_ies_deps: std.array_hash_map.Auto(Index, DepEntry.Index),
|
||||
/// Dependencies on the resolved layout of a `struct`, `union`, or `enum` type.
|
||||
/// Value is index into `dep_entries` of the first dependency on this type's layout.
|
||||
type_layout_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),
|
||||
type_layout_deps: std.array_hash_map.Auto(Index, DepEntry.Index),
|
||||
/// Dependencies on the resolved default field values of a `struct` type.
|
||||
/// Value is index into `dep_entries` of the first dependency on this type's inits.
|
||||
struct_defaults_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),
|
||||
struct_defaults_deps: std.array_hash_map.Auto(Index, DepEntry.Index),
|
||||
/// Dependencies on a Zig or ZON source file. Triggered by `@import`.
|
||||
/// * For ZON source files, the dependency is invalidated if the file changes at all. The `@import`
|
||||
/// must be re-analyzed to return the new data structure.
|
||||
@@ -64,18 +64,18 @@ struct_defaults_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index),
|
||||
/// (which can only happen because the `.main_struct_inst` got lost). The `@import` must be
|
||||
/// re-analyzed to return the new type.
|
||||
/// Value is index into `dep_entries` of the first dependency on this Zig/ZON file.
|
||||
source_file_deps: std.AutoArrayHashMapUnmanaged(FileIndex, DepEntry.Index),
|
||||
source_file_deps: std.array_hash_map.Auto(FileIndex, DepEntry.Index),
|
||||
/// Dependencies on an embedded file.
|
||||
/// Introduced by `@embedFile`; invalidated when the file changes.
|
||||
/// Value is index into `dep_entries` of the first dependency on this `Zcu.EmbedFile`.
|
||||
embed_file_deps: std.AutoArrayHashMapUnmanaged(Zcu.EmbedFile.Index, DepEntry.Index),
|
||||
embed_file_deps: std.array_hash_map.Auto(Zcu.EmbedFile.Index, DepEntry.Index),
|
||||
/// Dependencies on the full set of names in a ZIR namespace.
|
||||
/// Key refers to a `struct_decl`, `union_decl`, etc.
|
||||
/// Value is index into `dep_entries` of the first dependency on this namespace.
|
||||
namespace_deps: std.AutoArrayHashMapUnmanaged(TrackedInst.Index, DepEntry.Index),
|
||||
namespace_deps: std.array_hash_map.Auto(TrackedInst.Index, DepEntry.Index),
|
||||
/// Dependencies on the (non-)existence of some name in a namespace.
|
||||
/// Value is index into `dep_entries` of the first dependency on this name.
|
||||
namespace_name_deps: std.AutoArrayHashMapUnmanaged(NamespaceNameKey, DepEntry.Index),
|
||||
namespace_name_deps: std.array_hash_map.Auto(NamespaceNameKey, DepEntry.Index),
|
||||
// Dependencies on the value of fields memoized on `Zcu` (`panic_messages` etc).
|
||||
// If set, these are indices into `dep_entries` of the first dependency on this state.
|
||||
memoized_state_main_deps: DepEntry.Index.Optional,
|
||||
@@ -86,7 +86,7 @@ memoized_state_assembly_deps: DepEntry.Index.Optional,
|
||||
/// Given a `Depender`, points to an entry in `dep_entries` whose `depender`
|
||||
/// matches. The `next_dependee` field can be used to iterate all such entries
|
||||
/// and remove them from the corresponding lists.
|
||||
first_dependency: std.AutoArrayHashMapUnmanaged(AnalUnit, DepEntry.Index),
|
||||
first_dependency: std.array_hash_map.Auto(AnalUnit, DepEntry.Index),
|
||||
|
||||
/// Stores dependency information. The hashmaps declared above are used to look
|
||||
/// up entries in this list as required. This is not stored in `extra` so that
|
||||
@@ -11039,7 +11039,7 @@ pub fn dumpGenericInstancesFallible(ip: *const InternPool, allocator: Allocator,
|
||||
defer arena_allocator.deinit();
|
||||
const arena = arena_allocator.allocator();
|
||||
|
||||
var instances: std.AutoArrayHashMapUnmanaged(Index, std.ArrayList(Index)) = .empty;
|
||||
var instances: std.array_hash_map.Auto(Index, std.ArrayList(Index)) = .empty;
|
||||
for (ip.locals, 0..) |*local, tid| {
|
||||
const items = local.shared.items.view().slice();
|
||||
const extra_list = local.shared.extra;
|
||||
|
||||
@@ -162,8 +162,8 @@ pub const JobQueue = struct {
|
||||
/// Both non-lazy and lazy dependencies are always fetched.
|
||||
all,
|
||||
};
|
||||
pub const Table = std.AutoArrayHashMapUnmanaged(Package.Hash, *Fetch);
|
||||
pub const UnlazySet = std.AutoArrayHashMapUnmanaged(Package.Hash, void);
|
||||
pub const Table = std.array_hash_map.Auto(Package.Hash, *Fetch);
|
||||
pub const UnlazySet = std.array_hash_map.Auto(Package.Hash, void);
|
||||
pub const ForkSet = std.ArrayHashMapUnmanaged(Fork, void, Fork.Context, false);
|
||||
|
||||
pub const Fork = struct {
|
||||
|
||||
@@ -39,7 +39,7 @@ pub const Deps = std.array_hash_map.String(*Module);
|
||||
|
||||
pub const Tree = struct {
|
||||
/// Each `Package` exposes a `Module` with build.zig as its root source file.
|
||||
build_module_table: std.AutoArrayHashMapUnmanaged(MultiHashHexDigest, *Module),
|
||||
build_module_table: std.array_hash_map.Auto(MultiHashHexDigest, *Module),
|
||||
};
|
||||
|
||||
pub const CreateOptions = struct {
|
||||
|
||||
+6
-6
@@ -88,7 +88,7 @@ err: ?*Zcu.ErrorMsg = null,
|
||||
|
||||
/// The temporary arena is used for the memory of the `InferredAlloc` values
|
||||
/// here so the values can be dropped without any cleanup.
|
||||
unresolved_inferred_allocs: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InferredAlloc) = .empty,
|
||||
unresolved_inferred_allocs: std.array_hash_map.Auto(Air.Inst.Index, InferredAlloc) = .empty,
|
||||
|
||||
/// Links every pointer derived from a base `alloc` back to that `alloc`. Used
|
||||
/// to detect comptime-known `const`s.
|
||||
@@ -119,13 +119,13 @@ 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
|
||||
/// a given `AnalUnit` multiple times.
|
||||
references: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,
|
||||
type_references: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,
|
||||
references: std.array_hash_map.Auto(AnalUnit, void) = .empty,
|
||||
type_references: std.array_hash_map.Auto(InternPool.Index, void) = .empty,
|
||||
|
||||
/// All dependencies registered so far by this `Sema`. This is a temporary duplicate
|
||||
/// of the main dependency data. It exists to avoid adding dependencies to a given
|
||||
/// `AnalUnit` multiple times.
|
||||
dependencies: std.AutoArrayHashMapUnmanaged(InternPool.Dependee, void) = .empty,
|
||||
dependencies: std.array_hash_map.Auto(InternPool.Dependee, void) = .empty,
|
||||
|
||||
/// Whether memoization of this call is permitted. Operations with side effects global
|
||||
/// to the `Sema`, such as `@setEvalBranchQuota`, set this to `false`. It is observed
|
||||
@@ -212,11 +212,11 @@ pub const InferredErrorSet = struct {
|
||||
/// are returned from any dependent functions.
|
||||
errors: NameMap = .{},
|
||||
/// Other inferred error sets which this inferred error set should include.
|
||||
inferred_error_sets: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty,
|
||||
inferred_error_sets: std.array_hash_map.Auto(InternPool.Index, void) = .empty,
|
||||
/// The regular error set created by resolving this inferred error set.
|
||||
resolved: InternPool.Index = .none,
|
||||
|
||||
pub const NameMap = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, void);
|
||||
pub const NameMap = std.array_hash_map.Auto(InternPool.NullTerminatedString, void);
|
||||
|
||||
pub fn addErrorSet(
|
||||
self: *InferredErrorSet,
|
||||
|
||||
+3
-3
@@ -3340,7 +3340,7 @@ pub fn assertHasLayout(ty: Type, zcu: *const Zcu) void {
|
||||
}
|
||||
|
||||
/// Recursively walks the type and marks for each subtype how many times it has been seen
|
||||
fn collectSubtypes(ty: Type, pt: Zcu.PerThread, visited: *std.AutoArrayHashMapUnmanaged(Type, u16)) error{OutOfMemory}!void {
|
||||
fn collectSubtypes(ty: Type, pt: Zcu.PerThread, visited: *std.array_hash_map.Auto(Type, u16)) error{OutOfMemory}!void {
|
||||
const zcu = pt.zcu;
|
||||
const ip = &zcu.intern_pool;
|
||||
|
||||
@@ -3455,8 +3455,8 @@ fn shouldDedupeType(ty: Type, ctx: *Comparison, pt: Zcu.PerThread) error{OutOfMe
|
||||
/// the subtype length and number of occurences. Placeholders are then found by
|
||||
/// iterating `type_dedupe_cache` which caches the inline/placeholder decisions.
|
||||
pub const Comparison = struct {
|
||||
type_occurrences: std.AutoArrayHashMapUnmanaged(Type, u16),
|
||||
type_dedupe_cache: std.AutoArrayHashMapUnmanaged(Type, DedupeEntry),
|
||||
type_occurrences: std.array_hash_map.Auto(Type, u16),
|
||||
type_dedupe_cache: std.array_hash_map.Auto(Type, DedupeEntry),
|
||||
placeholder_index: u8,
|
||||
|
||||
pub const Placeholder = struct {
|
||||
|
||||
+33
-33
@@ -97,20 +97,20 @@ 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.
|
||||
single_exports: std.AutoArrayHashMapUnmanaged(AnalUnit, Export.Index) = .empty,
|
||||
single_exports: std.array_hash_map.Auto(AnalUnit, Export.Index) = .empty,
|
||||
/// Like `single_exports`, but for `AnalUnit`s which perform multiple exports.
|
||||
/// The exports are `all_exports.items[index..][0..len]`.
|
||||
multi_exports: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct {
|
||||
multi_exports: std.array_hash_map.Auto(AnalUnit, extern struct {
|
||||
index: u32,
|
||||
len: u32,
|
||||
}) = .{},
|
||||
|
||||
/// Key is the digest returned by `Builtin.hash`; value is the corresponding module.
|
||||
builtin_modules: std.AutoArrayHashMapUnmanaged(Cache.BinDigest, *Package.Module) = .empty,
|
||||
builtin_modules: std.array_hash_map.Auto(Cache.BinDigest, *Package.Module) = .empty,
|
||||
|
||||
/// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones.
|
||||
/// Modules whose root file is not a Zig or ZON file have the value `.none`.
|
||||
module_roots: std.AutoArrayHashMapUnmanaged(*Package.Module, File.Index.Optional) = .empty,
|
||||
module_roots: std.array_hash_map.Auto(*Package.Module, File.Index.Optional) = .empty,
|
||||
|
||||
/// The set of all the Zig source files in the Zig Compilation Unit. Tracked in
|
||||
/// order to iterate over it and check which source files have been modified on
|
||||
@@ -141,7 +141,7 @@ import_table: std.ArrayHashMapUnmanaged(
|
||||
/// update removes an import, or if a module specified on the CLI is never imported.
|
||||
/// Reconstructed on every update, after AstGen and before Sema.
|
||||
/// Value is why the file is alive.
|
||||
alive_files: std.AutoArrayHashMapUnmanaged(File.Index, File.Reference) = .empty,
|
||||
alive_files: std.array_hash_map.Auto(File.Index, File.Reference) = .empty,
|
||||
|
||||
/// If this is populated, a "file exists in multiple modules" error should be emitted.
|
||||
/// This causes file errors to not be shown, because we don't really know which files
|
||||
@@ -179,27 +179,27 @@ intern_pool: InternPool = .empty,
|
||||
|
||||
/// Value explains why this `AnalUnit` is being analyzed. It is `null` for the topmost analysis
|
||||
/// (index 0), and non-`null` for all others.
|
||||
analysis_in_progress: std.AutoArrayHashMapUnmanaged(AnalUnit, ?*const DependencyReason) = .empty,
|
||||
analysis_in_progress: std.array_hash_map.Auto(AnalUnit, ?*const DependencyReason) = .empty,
|
||||
/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.
|
||||
failed_analysis: std.AutoArrayHashMapUnmanaged(AnalUnit, *ErrorMsg) = .empty,
|
||||
failed_analysis: std.array_hash_map.Auto(AnalUnit, *ErrorMsg) = .empty,
|
||||
/// This `AnalUnit` failed semantic analysis because it required analysis of another `AnalUnit` which itself failed.
|
||||
transitive_failed_analysis: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,
|
||||
transitive_failed_analysis: std.array_hash_map.Auto(AnalUnit, void) = .empty,
|
||||
/// This `Nav` succeeded analysis, but failed codegen.
|
||||
/// This may be a simple "value" `Nav`, or it may be a function.
|
||||
/// The ErrorMsg memory is owned by the `AnalUnit`, using Module's general purpose allocator.
|
||||
/// While multiple threads are active (most of the time!), this is guarded by `zcu.comp.mutex`, as
|
||||
/// codegen and linking run on a separate thread.
|
||||
failed_codegen: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, *ErrorMsg) = .empty,
|
||||
failed_types: std.AutoArrayHashMapUnmanaged(InternPool.Index, *ErrorMsg) = .empty,
|
||||
failed_codegen: std.array_hash_map.Auto(InternPool.Nav.Index, *ErrorMsg) = .empty,
|
||||
failed_types: std.array_hash_map.Auto(InternPool.Index, *ErrorMsg) = .empty,
|
||||
|
||||
/// Key is an `AnalUnit` which is in `dependency_loop_nodes`. For each dependency loop, exactly one
|
||||
/// unit in the loop is in this map, though the choice is arbitrary and not necessarily reproducible
|
||||
/// between compilations. So, instead of (for instance) defining where the dependency loop "starts",
|
||||
/// this map simply exists to allow easily iterating all dependency loops exactly once.
|
||||
dependency_loops: std.AutoArrayHashMapUnmanaged(AnalUnit, void) = .empty,
|
||||
dependency_loops: std.array_hash_map.Auto(AnalUnit, void) = .empty,
|
||||
/// Key is an `AnalUnit`, value is the `AnalUnit` which the key references and why it does so.
|
||||
/// All units in here form loops. To iterate loops, see `dependency_loops`.
|
||||
dependency_loop_nodes: std.AutoArrayHashMapUnmanaged(AnalUnit, struct {
|
||||
dependency_loop_nodes: std.array_hash_map.Auto(AnalUnit, struct {
|
||||
unit: AnalUnit,
|
||||
reason: DependencyReason,
|
||||
}) = .empty,
|
||||
@@ -207,7 +207,7 @@ dependency_loop_nodes: std.AutoArrayHashMapUnmanaged(AnalUnit, struct {
|
||||
/// Keep track of `@compileLog`s per `AnalUnit`.
|
||||
/// We track the source location of the first `@compileLog` call, and all logged lines as a linked list.
|
||||
/// The list is singly linked, but we do track its tail for fast appends (optimizing many logs in one unit).
|
||||
compile_logs: std.AutoArrayHashMapUnmanaged(AnalUnit, extern struct {
|
||||
compile_logs: std.array_hash_map.Auto(AnalUnit, extern struct {
|
||||
base_node_inst: InternPool.TrackedInst.Index,
|
||||
node_offset: Ast.Node.Offset,
|
||||
first_line: CompileLogLine.Index,
|
||||
@@ -228,7 +228,7 @@ free_compile_log_lines: std.ArrayList(CompileLogLine.Index) = .empty,
|
||||
/// We just store a `[]u8` instead of a full `*ErrorMsg`, because the source
|
||||
/// location is always the entire file. The `[]u8` memory is owned by the map
|
||||
/// and allocated into `gpa`.
|
||||
failed_files: std.AutoArrayHashMapUnmanaged(File.Index, ?[]u8) = .empty,
|
||||
failed_files: std.array_hash_map.Auto(File.Index, ?[]u8) = .empty,
|
||||
/// AstGen is not aware of modules, and so cannot determine whether an import
|
||||
/// string makes sense. That is the job of a traversal after AstGen.
|
||||
///
|
||||
@@ -256,10 +256,10 @@ failed_imports: std.ArrayList(struct {
|
||||
import_token: Ast.TokenIndex,
|
||||
kind: enum { file_outside_module_root, illegal_zig_import },
|
||||
}) = .empty,
|
||||
failed_exports: std.AutoArrayHashMapUnmanaged(Export.Index, *ErrorMsg) = .empty,
|
||||
failed_exports: std.array_hash_map.Auto(Export.Index, *ErrorMsg) = .empty,
|
||||
/// If analysis failed due to a cimport error, the corresponding Clang errors
|
||||
/// are stored here.
|
||||
cimport_errors: std.AutoArrayHashMapUnmanaged(AnalUnit, std.zig.ErrorBundle) = .empty,
|
||||
cimport_errors: std.array_hash_map.Auto(AnalUnit, std.zig.ErrorBundle) = .empty,
|
||||
|
||||
/// Maximum amount of distinct error values, set by --error-limit
|
||||
error_limit: ErrorInt,
|
||||
@@ -271,19 +271,19 @@ outdated_lock: if (std.debug.runtime_safety) std.Io.RwLock else void = if (std.d
|
||||
/// Value is the number of PO dependencies of this AnalUnit.
|
||||
/// This value will decrease as we perform semantic analysis to learn what is outdated.
|
||||
/// If any of these PO deps is outdated, this value will be moved to `outdated`.
|
||||
potentially_outdated: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,
|
||||
potentially_outdated: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
|
||||
/// Value is the number of PO dependencies of this AnalUnit.
|
||||
/// Once this value drops to 0, the AnalUnit is a candidate for re-analysis.
|
||||
outdated: std.AutoArrayHashMapUnmanaged(AnalUnit, u32) = .empty,
|
||||
outdated: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
|
||||
/// This is the set of all `AnalUnit`s in `outdated` whose PO dependency count is 0.
|
||||
/// Such `AnalUnit`s are ready for immediate re-analysis.
|
||||
/// See `findOutdatedToAnalyze` for details.
|
||||
outdated_ready: struct {
|
||||
/// These are separate from other units because it allows `findOutdatedToAnalyze` to prioritize
|
||||
/// functions, which is useful because it means they will be sent to codegen more quickly.
|
||||
funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
funcs: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
/// Does not contain `.func` units.
|
||||
other: std.AutoArrayHashMapUnmanaged(AnalUnit, void),
|
||||
other: std.array_hash_map.Auto(AnalUnit, void),
|
||||
} = .{ .funcs = .empty, .other = .empty },
|
||||
/// This contains a list of AnalUnit whose analysis or codegen failed, but the
|
||||
/// failure was something like running out of disk space, and trying again may
|
||||
@@ -298,23 +298,23 @@ analysis_roots_len: usize = 0,
|
||||
/// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and
|
||||
/// reset to `null` when any semantic analysis occurs (since this invalidates the data).
|
||||
/// Allocated into `gpa`.
|
||||
resolved_references: ?std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) = null,
|
||||
resolved_references: ?std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) = null,
|
||||
|
||||
/// If `true`, then semantic analysis must not occur on this update due to AstGen errors.
|
||||
/// Essentially the entire pipeline after AstGen, including Sema, codegen, and link, is skipped.
|
||||
/// Reset to `false` at the start of each update in `Compilation.update`.
|
||||
skip_analysis_this_update: bool = false,
|
||||
|
||||
test_functions: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,
|
||||
test_functions: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
|
||||
|
||||
global_assembly: std.AutoArrayHashMapUnmanaged(AnalUnit, []u8) = .empty,
|
||||
global_assembly: std.array_hash_map.Auto(AnalUnit, []u8) = .empty,
|
||||
|
||||
/// Key is the `AnalUnit` *performing* the reference. This representation allows
|
||||
/// incremental updates to quickly delete references caused by a specific `AnalUnit`.
|
||||
/// Value is index into `all_references` of the first reference triggered by the unit.
|
||||
/// 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,
|
||||
reference_table: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
|
||||
all_references: std.ArrayList(Reference) = .empty,
|
||||
/// Freelist of indices in `all_references`.
|
||||
free_references: std.ArrayList(u32) = .empty,
|
||||
@@ -327,7 +327,7 @@ free_inline_reference_frames: std.ArrayList(InlineReferenceFrame.Index) = .empty
|
||||
/// Value is index into `all_type_reference` of the first reference triggered by the unit.
|
||||
/// 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,
|
||||
type_reference_table: std.array_hash_map.Auto(AnalUnit, u32) = .empty,
|
||||
all_type_references: std.ArrayList(TypeReference) = .empty,
|
||||
/// Freelist of indices in `all_type_references`.
|
||||
free_type_references: std.ArrayList(u32) = .empty,
|
||||
@@ -355,12 +355,12 @@ pub const DependencyReason = struct {
|
||||
pub const IncrementalDebugState = struct {
|
||||
/// All container types in the ZCU, even dead ones.
|
||||
/// Value is the generation the type was created on.
|
||||
types: std.AutoArrayHashMapUnmanaged(InternPool.Index, u32),
|
||||
types: std.array_hash_map.Auto(InternPool.Index, u32),
|
||||
/// All `Nav`s in the ZCU, even dead ones.
|
||||
/// Value is the generation the `Nav` was created on.
|
||||
navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, u32),
|
||||
navs: std.array_hash_map.Auto(InternPool.Nav.Index, u32),
|
||||
/// All `AnalUnit`s in the ZCU, even dead ones.
|
||||
units: std.AutoArrayHashMapUnmanaged(AnalUnit, UnitInfo),
|
||||
units: std.array_hash_map.Auto(AnalUnit, UnitInfo),
|
||||
|
||||
pub const init: IncrementalDebugState = .{
|
||||
.types = .empty,
|
||||
@@ -681,7 +681,7 @@ pub const SimplePanicId = enum {
|
||||
}
|
||||
};
|
||||
|
||||
pub const GlobalErrorSet = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, void);
|
||||
pub const GlobalErrorSet = std.array_hash_map.Auto(InternPool.NullTerminatedString, void);
|
||||
|
||||
pub const CImportError = struct {
|
||||
offset: u32,
|
||||
@@ -4188,13 +4188,13 @@ pub const ResolvedReference = struct {
|
||||
/// If an `AnalUnit` is not in the returned map, it is unreferenced.
|
||||
/// The returned hashmap is owned by the `Zcu`, so should not be freed by the caller.
|
||||
/// This hashmap is cached, so repeated calls to this function are cheap.
|
||||
pub fn resolveReferences(zcu: *Zcu) Allocator.Error!*const std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) {
|
||||
pub fn resolveReferences(zcu: *Zcu) Allocator.Error!*const std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) {
|
||||
if (zcu.resolved_references == null) {
|
||||
zcu.resolved_references = try zcu.resolveReferencesInner();
|
||||
}
|
||||
return &zcu.resolved_references.?;
|
||||
}
|
||||
fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) {
|
||||
fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) {
|
||||
const trace = tracy.trace(@src());
|
||||
defer trace.end();
|
||||
|
||||
@@ -4202,8 +4202,8 @@ fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.AutoArrayHashMapUnmanag
|
||||
const comp = zcu.comp;
|
||||
const ip = &zcu.intern_pool;
|
||||
|
||||
var units: std.AutoArrayHashMapUnmanaged(AnalUnit, ?ResolvedReference) = .empty;
|
||||
var types: std.AutoArrayHashMapUnmanaged(InternPool.Index, ?ResolvedReference) = .empty;
|
||||
var units: std.array_hash_map.Auto(AnalUnit, ?ResolvedReference) = .empty;
|
||||
var types: std.array_hash_map.Auto(InternPool.Index, ?ResolvedReference) = .empty;
|
||||
defer {
|
||||
units.deinit(gpa);
|
||||
types.deinit(gpa);
|
||||
|
||||
@@ -787,7 +787,7 @@ const UpdatedFile = struct {
|
||||
inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index),
|
||||
};
|
||||
|
||||
fn cleanupUpdatedFiles(gpa: Allocator, updated_files: *std.AutoArrayHashMapUnmanaged(Zcu.File.Index, UpdatedFile)) void {
|
||||
fn cleanupUpdatedFiles(gpa: Allocator, updated_files: *std.array_hash_map.Auto(Zcu.File.Index, UpdatedFile)) void {
|
||||
for (updated_files.values()) |*elem| elem.inst_map.deinit(gpa);
|
||||
updated_files.deinit(gpa);
|
||||
}
|
||||
@@ -805,7 +805,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {
|
||||
|
||||
// We need to visit every updated File for every TrackedInst in InternPool.
|
||||
// This only includes Zig files; ZON files are omitted.
|
||||
var updated_files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, UpdatedFile) = .empty;
|
||||
var updated_files: std.array_hash_map.Auto(Zcu.File.Index, UpdatedFile) = .empty;
|
||||
defer cleanupUpdatedFiles(gpa, &updated_files);
|
||||
|
||||
for (zcu.import_table.keys()) |file_index| {
|
||||
@@ -907,7 +907,7 @@ fn updateZirRefs(pt: Zcu.PerThread) (Io.Cancelable || Allocator.Error)!void {
|
||||
if (!has_namespace) continue;
|
||||
|
||||
// Value is whether the declaration is `pub`.
|
||||
var old_names: std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, bool) = .empty;
|
||||
var old_names: std.array_hash_map.Auto(InternPool.NullTerminatedString, bool) = .empty;
|
||||
defer old_names.deinit(zcu.gpa);
|
||||
for (old_zir.typeDecls(old_inst)) |decl_inst| {
|
||||
const old_decl = old_zir.getDeclaration(decl_inst);
|
||||
@@ -3568,8 +3568,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.ArrayList(Zcu.Export.Index)) = .empty;
|
||||
var uav_exports: std.AutoArrayHashMapUnmanaged(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
|
||||
var nav_exports: std.array_hash_map.Auto(InternPool.Nav.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
|
||||
var uav_exports: std.array_hash_map.Auto(InternPool.Index, std.ArrayList(Zcu.Export.Index)) = .empty;
|
||||
defer {
|
||||
for (nav_exports.values()) |*exports| {
|
||||
exports.deinit(gpa);
|
||||
@@ -3665,7 +3665,7 @@ pub fn processExports(pt: Zcu.PerThread) !void {
|
||||
}
|
||||
}
|
||||
|
||||
const SymbolExports = std.AutoArrayHashMapUnmanaged(InternPool.NullTerminatedString, Zcu.Export.Index);
|
||||
const SymbolExports = std.array_hash_map.Auto(InternPool.NullTerminatedString, Zcu.Export.Index);
|
||||
|
||||
fn processExportsInner(
|
||||
pt: Zcu.PerThread,
|
||||
|
||||
@@ -4,12 +4,12 @@ air: Air,
|
||||
nav_index: InternPool.Nav.Index,
|
||||
|
||||
// Blocks
|
||||
def_order: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, void),
|
||||
blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Block),
|
||||
loops: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, Loop),
|
||||
def_order: std.array_hash_map.Auto(Air.Inst.Index, void),
|
||||
blocks: std.array_hash_map.Auto(Air.Inst.Index, Block),
|
||||
loops: std.array_hash_map.Auto(Air.Inst.Index, Loop),
|
||||
active_loops: std.ArrayList(Loop.Index),
|
||||
loop_live: struct {
|
||||
set: std.AutoArrayHashMapUnmanaged(struct { Loop.Index, Air.Inst.Index }, void),
|
||||
set: std.array_hash_map.Auto(struct { Loop.Index, Air.Inst.Index }, void),
|
||||
list: std.ArrayList(Air.Inst.Index),
|
||||
},
|
||||
dom_start: u32,
|
||||
@@ -11225,7 +11225,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
|
||||
defer std.debug.unlockStderr();
|
||||
const stderr = &locked_stderr.file_writer.interface;
|
||||
|
||||
var reverse_live_values: std.AutoArrayHashMapUnmanaged(Value.Index, std.ArrayList(Air.Inst.Index)) = .empty;
|
||||
var reverse_live_values: std.array_hash_map.Auto(Value.Index, std.ArrayList(Air.Inst.Index)) = .empty;
|
||||
defer {
|
||||
for (reverse_live_values.values()) |*list| list.deinit(gpa);
|
||||
reverse_live_values.deinit(gpa);
|
||||
@@ -11254,7 +11254,7 @@ fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
|
||||
};
|
||||
}
|
||||
|
||||
var roots: std.AutoArrayHashMapUnmanaged(Value.Index, u32) = .empty;
|
||||
var roots: std.array_hash_map.Auto(Value.Index, u32) = .empty;
|
||||
defer roots.deinit(gpa);
|
||||
{
|
||||
try roots.ensureTotalCapacity(gpa, isel.values.items.len);
|
||||
|
||||
+11
-11
@@ -59,14 +59,14 @@ pub const Mir = struct {
|
||||
/// Key is the value of the UAV; value is the UAV's alignment, or
|
||||
/// `.none` for natural alignment. The specified alignment is never
|
||||
/// less than the natural alignment.
|
||||
need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
|
||||
need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
ctype_deps: CType.Dependencies,
|
||||
/// Key is an enum type for which we need a generated `@tagName` function.
|
||||
need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
/// Key is a function Nav for which we need a generated `zig_never_tail` wrapper.
|
||||
need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
/// Key is a function Nav for which we need a generated `zig_never_inline` wrapper.
|
||||
need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
|
||||
pub fn deinit(mir: *Mir, gpa: Allocator) void {
|
||||
gpa.free(mir.fwd_decl);
|
||||
@@ -164,8 +164,8 @@ const LocalType = struct {
|
||||
};
|
||||
|
||||
const LocalIndex = u16;
|
||||
const LocalsList = std.AutoArrayHashMapUnmanaged(LocalIndex, void);
|
||||
const LocalsMap = std.AutoArrayHashMapUnmanaged(LocalType, LocalsList);
|
||||
const LocalsList = std.array_hash_map.Auto(LocalIndex, void);
|
||||
const LocalsMap = std.array_hash_map.Auto(LocalType, LocalsList);
|
||||
|
||||
const ValueRenderLocation = enum {
|
||||
initializer,
|
||||
@@ -391,11 +391,11 @@ pub const Function = struct {
|
||||
code: Writer.Allocating,
|
||||
indent_counter: usize,
|
||||
/// Key is an enum type for which we need a generated `@tagName` function.
|
||||
need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
/// Key is a function Nav for which we need a generated `zig_never_tail` wrapper.
|
||||
need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
/// Key is a function Nav for which we need a generated `zig_never_inline` wrapper.
|
||||
need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
func_index: InternPool.Index,
|
||||
/// All the locals, to be emitted at the top of the function.
|
||||
locals: std.ArrayList(LocalType) = .empty,
|
||||
@@ -407,7 +407,7 @@ pub const Function = struct {
|
||||
/// of variable declarations at the top of a function, sorted descending
|
||||
/// by type alignment.
|
||||
/// The value is whether the alloc needs to be emitted in the header.
|
||||
allocs: std.AutoArrayHashMapUnmanaged(LocalIndex, bool) = .empty,
|
||||
allocs: std.array_hash_map.Auto(LocalIndex, bool) = .empty,
|
||||
/// Maps from `loop_switch_br` instructions to the allocated local used
|
||||
/// for the switch cond. Dispatches should set this local to the new cond.
|
||||
loop_switch_conds: std.AutoHashMapUnmanaged(Air.Inst.Index, LocalIndex) = .empty,
|
||||
@@ -643,7 +643,7 @@ pub const DeclGen = struct {
|
||||
/// Key is the value of the UAV; value is the UAV's alignment, or
|
||||
/// `.none` for natural alignment. The specified alignment is never
|
||||
/// less than the natural alignment.
|
||||
uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
|
||||
uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
|
||||
fn fail(dg: *DeclGen, comptime format: []const u8, args: anytype) Error {
|
||||
@branchHint(.cold);
|
||||
|
||||
@@ -572,30 +572,30 @@ pub const CType = union(enum) {
|
||||
pub const Dependencies = struct {
|
||||
/// Key is any Zig type which corresponds to a C `struct`, `union`, or `typedef`. That C
|
||||
/// type must be declared and complete.
|
||||
type: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
type: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
|
||||
/// Key is a Zig type which is the *payload* of an error union. The C `struct` type
|
||||
/// corresponding to such an error union must be declared and complete.
|
||||
///
|
||||
/// These are separate from `type` to avoid redundant types for every different error set
|
||||
/// used with the same payload type---for instance a different C type for every `E!void`.
|
||||
errunion_type: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
errunion_type: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
|
||||
/// Like `type`, but the type does not necessarily need to be completed yet: a forward
|
||||
/// declaration is sufficient.
|
||||
type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
type_fwd: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
|
||||
/// Like `errunion_type`, but the type does not necessarily need to be completed yet: a
|
||||
/// forward declaration is sufficient.
|
||||
errunion_type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
errunion_type_fwd: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
|
||||
/// Key is a Zig type; value is a bitmask of alignments. For every bit which is set, an
|
||||
/// aligned typedef is required. For instance, if bit 3 is set, the C type 'aligned__8_foo'
|
||||
/// must be declared through `typedef` (but not necessarily completed yet).
|
||||
aligned_type_fwd: std.AutoArrayHashMapUnmanaged(InternPool.Index, u64),
|
||||
aligned_type_fwd: std.array_hash_map.Auto(InternPool.Index, u64),
|
||||
|
||||
/// Key specifies a big-int type whose C `struct` must be declared and complete.
|
||||
bigint: std.AutoArrayHashMapUnmanaged(BigInt, void),
|
||||
bigint: std.array_hash_map.Auto(BigInt, void),
|
||||
|
||||
pub const empty: Dependencies = .{
|
||||
.type = .empty,
|
||||
|
||||
@@ -112,7 +112,7 @@ const_tracking: ConstTrackingMap = .{},
|
||||
inst_tracking: InstTrackingMap = .{},
|
||||
|
||||
frame_allocs: std.MultiArrayList(FrameAlloc) = .{},
|
||||
free_frame_indices: std.AutoArrayHashMapUnmanaged(FrameIndex, void) = .empty,
|
||||
free_frame_indices: std.array_hash_map.Auto(FrameIndex, void) = .empty,
|
||||
frame_locs: std.MultiArrayList(Mir.FrameLoc) = .{},
|
||||
|
||||
loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
|
||||
@@ -338,7 +338,7 @@ const MCValue = union(enum) {
|
||||
};
|
||||
|
||||
const Branch = struct {
|
||||
inst_table: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, MCValue) = .empty,
|
||||
inst_table: std.array_hash_map.Auto(Air.Inst.Index, MCValue) = .empty,
|
||||
|
||||
fn deinit(func: *Branch, gpa: Allocator) void {
|
||||
func.inst_table.deinit(gpa);
|
||||
@@ -346,8 +346,8 @@ const Branch = struct {
|
||||
}
|
||||
};
|
||||
|
||||
const InstTrackingMap = std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InstTracking);
|
||||
const ConstTrackingMap = std.AutoArrayHashMapUnmanaged(InternPool.Index, InstTracking);
|
||||
const InstTrackingMap = std.array_hash_map.Auto(Air.Inst.Index, InstTracking);
|
||||
const ConstTrackingMap = std.array_hash_map.Auto(InternPool.Index, InstTracking);
|
||||
|
||||
const InstTracking = struct {
|
||||
long: MCValue,
|
||||
|
||||
@@ -200,7 +200,7 @@ const MCValue = union(enum) {
|
||||
};
|
||||
|
||||
const Branch = struct {
|
||||
inst_table: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, MCValue) = .empty,
|
||||
inst_table: std.array_hash_map.Auto(Air.Inst.Index, MCValue) = .empty,
|
||||
|
||||
fn deinit(self: *Branch, gpa: Allocator) void {
|
||||
self.inst_table.deinit(gpa);
|
||||
|
||||
@@ -28,7 +28,7 @@ uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass
|
||||
intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
|
||||
decls: std.ArrayList(Decl) = .empty,
|
||||
decl_deps: std.ArrayList(Decl.Index) = .empty,
|
||||
entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
|
||||
entry_points: std.array_hash_map.Auto(Id, EntryPoint) = .empty,
|
||||
/// This map serves a dual purpose:
|
||||
/// - It keeps track of pointers that are currently being emitted, so that we can tell
|
||||
/// if they are recursive and need an OpTypeForwardPointer.
|
||||
|
||||
@@ -141,7 +141,7 @@ 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
|
||||
blocks: std.AutoArrayHashMapUnmanaged(Air.Inst.Index, struct {
|
||||
blocks: std.array_hash_map.Auto(Air.Inst.Index, struct {
|
||||
label: u32,
|
||||
value: WValue,
|
||||
}) = .{},
|
||||
@@ -171,12 +171,12 @@ mir_extra: std.ArrayList(u32),
|
||||
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),
|
||||
mir_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
/// Set of all functions whose address this function has taken and which therefore might be called
|
||||
/// via a `call_indirect` function.
|
||||
mir_indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
mir_indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
/// Set of all function types used by this function. These must be interned by the linker.
|
||||
mir_func_tys: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
mir_func_tys: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
/// The number of `error_name_table_ref` instructions emitted.
|
||||
error_name_table_ref_count: u32,
|
||||
/// When a function is executing, we store the the current stack pointer's value within this local.
|
||||
@@ -322,7 +322,7 @@ const WValue = union(enum) {
|
||||
};
|
||||
|
||||
/// Hashmap to store generated `WValue` for each `Air.Inst.Ref`
|
||||
const ValueTable = std.AutoArrayHashMapUnmanaged(Air.Inst.Ref, WValue);
|
||||
const ValueTable = std.array_hash_map.Auto(Air.Inst.Ref, WValue);
|
||||
|
||||
const bookkeeping_init = if (std.debug.runtime_safety) @as(usize, 0) else {};
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ prologue: Prologue,
|
||||
|
||||
/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.
|
||||
/// Value is the explicit alignment if greater than natural alignment, `.none` otherwise.
|
||||
uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
|
||||
uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
/// Not directly used by `Emit`, but the linker needs this to merge it with a global set.
|
||||
indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
/// Not directly used by `Emit`, but the linker needs this to ensure these types are interned.
|
||||
func_tys: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
func_tys: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
/// Not directly used by `Emit`, but the linker needs this to add it to its own refcount.
|
||||
error_name_table_ref_count: u32,
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ register_manager: RegisterManager = .{},
|
||||
scope_generation: u32 = 0,
|
||||
|
||||
frame_allocs: std.MultiArrayList(FrameAlloc) = .empty,
|
||||
free_frame_indices: std.AutoArrayHashMapUnmanaged(FrameIndex, void) = .empty,
|
||||
free_frame_indices: std.array_hash_map.Auto(FrameIndex, void) = .empty,
|
||||
frame_locs: std.MultiArrayList(Mir.FrameLoc) = .empty,
|
||||
|
||||
loops: std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
|
||||
@@ -569,8 +569,8 @@ pub const MCValue = union(enum) {
|
||||
}
|
||||
};
|
||||
|
||||
const InstTrackingMap = std.AutoArrayHashMapUnmanaged(Air.Inst.Index, InstTracking);
|
||||
const ConstTrackingMap = std.AutoArrayHashMapUnmanaged(InternPool.Index, InstTracking);
|
||||
const InstTrackingMap = std.array_hash_map.Auto(Air.Inst.Index, InstTracking);
|
||||
const ConstTrackingMap = std.array_hash_map.Auto(InternPool.Index, InstTracking);
|
||||
const InstTracking = struct {
|
||||
long: MCValue,
|
||||
short: MCValue,
|
||||
|
||||
+26
-26
@@ -44,10 +44,10 @@ type_dependencies: std.ArrayList(link.ConstPool.Index),
|
||||
align_dependency_masks: std.ArrayList(u64),
|
||||
|
||||
/// All NAVs, regardless of whether they are functions or simple constants, are put in this map.
|
||||
navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, RenderedDecl),
|
||||
navs: std.array_hash_map.Auto(InternPool.Nav.Index, RenderedDecl),
|
||||
/// All UAVs which may be referenced are in this map. The UAV alignment is not included in the
|
||||
/// rendered C code stored here, because we don't know the alignment a UAV needs until `flush`.
|
||||
uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, RenderedDecl),
|
||||
uavs: std.array_hash_map.Auto(InternPool.Index, RenderedDecl),
|
||||
/// Contains all types which are needed by some other rendered code. Does not contain any constants
|
||||
/// other than types.
|
||||
type_pool: link.ConstPool,
|
||||
@@ -59,10 +59,10 @@ types: std.ArrayList(RenderedType),
|
||||
/// The set of big int types required by *any* generated code so far. These are always safe to emit,
|
||||
/// so they do not participate in the dependency graph traversal in `flush`. Therefore, redundant
|
||||
/// big-int types may be emitted under incremental compilation.
|
||||
bigint_types: std.AutoArrayHashMapUnmanaged(codegen.CType.BigInt, void),
|
||||
bigint_types: std.array_hash_map.Auto(codegen.CType.BigInt, void),
|
||||
|
||||
exported_navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, String),
|
||||
exported_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, String),
|
||||
exported_navs: std.array_hash_map.Auto(InternPool.Nav.Index, String),
|
||||
exported_uavs: std.array_hash_map.Auto(InternPool.Index, String),
|
||||
|
||||
/// A reference into `string_bytes`.
|
||||
const String = extern struct {
|
||||
@@ -133,10 +133,10 @@ const RenderedDecl = struct {
|
||||
fwd_decl: String,
|
||||
code: String,
|
||||
ctype_deps: CTypeDependencies,
|
||||
need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
|
||||
need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void),
|
||||
need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void),
|
||||
|
||||
const init: RenderedDecl = .{
|
||||
.fwd_decl = .empty,
|
||||
@@ -746,7 +746,7 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog
|
||||
// incremental updates which is invalid C (due to e.g. types changing). Machine code backends
|
||||
// don't have this problem because there are, of course, no type checking performed when you
|
||||
// *execute* a binary!
|
||||
var need_navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;
|
||||
var need_navs: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty;
|
||||
defer need_navs.deinit(gpa);
|
||||
{
|
||||
const unit_references = try zcu.resolveReferences();
|
||||
@@ -774,23 +774,23 @@ pub fn flush(c: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Prog
|
||||
//
|
||||
// At the same time, we will discover the set of lazy functions which are referenced.
|
||||
|
||||
var need_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment) = .empty;
|
||||
var need_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment) = .empty;
|
||||
defer need_uavs.deinit(gpa);
|
||||
|
||||
var need_types: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void) = .empty;
|
||||
var need_types: std.array_hash_map.Auto(link.ConstPool.Index, void) = .empty;
|
||||
defer need_types.deinit(gpa);
|
||||
var need_errunion_types: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void) = .empty;
|
||||
var need_errunion_types: std.array_hash_map.Auto(link.ConstPool.Index, void) = .empty;
|
||||
defer need_errunion_types.deinit(gpa);
|
||||
var need_aligned_types: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64) = .empty;
|
||||
var need_aligned_types: std.array_hash_map.Auto(link.ConstPool.Index, u64) = .empty;
|
||||
defer need_aligned_types.deinit(gpa);
|
||||
|
||||
var need_tag_name_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .empty;
|
||||
var need_tag_name_funcs: std.array_hash_map.Auto(InternPool.Index, void) = .empty;
|
||||
defer need_tag_name_funcs.deinit(gpa);
|
||||
|
||||
var need_never_tail_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;
|
||||
var need_never_tail_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty;
|
||||
defer need_never_tail_funcs.deinit(gpa);
|
||||
|
||||
var need_never_inline_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;
|
||||
var need_never_inline_funcs: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty;
|
||||
defer need_never_inline_funcs.deinit(gpa);
|
||||
|
||||
// As mentioned above, we need this type for error names.
|
||||
@@ -1284,9 +1284,9 @@ pub fn deleteExport(
|
||||
|
||||
fn mergeNeededCTypes(
|
||||
c: *C,
|
||||
need_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),
|
||||
need_errunion_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),
|
||||
need_aligned_types: *std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64),
|
||||
need_types: *std.array_hash_map.Auto(link.ConstPool.Index, void),
|
||||
need_errunion_types: *std.array_hash_map.Auto(link.ConstPool.Index, void),
|
||||
need_aligned_types: *std.array_hash_map.Auto(link.ConstPool.Index, u64),
|
||||
deps: *const CTypeDependencies,
|
||||
) Allocator.Error!void {
|
||||
const gpa = c.base.comp.gpa;
|
||||
@@ -1312,8 +1312,8 @@ fn mergeNeededCTypes(
|
||||
|
||||
fn mergeNeededUavs(
|
||||
zcu: *const Zcu,
|
||||
global: *std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
|
||||
new: *const std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
|
||||
global: *std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
new: *const std.array_hash_map.Auto(InternPool.Index, Alignment),
|
||||
) Allocator.Error!void {
|
||||
const gpa = zcu.comp.gpa;
|
||||
|
||||
@@ -1422,12 +1422,12 @@ const FlushTypes = struct {
|
||||
c: *C,
|
||||
f: *Flush,
|
||||
|
||||
aligned_types: *const std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, u64),
|
||||
aligned_types: *const std.array_hash_map.Auto(link.ConstPool.Index, u64),
|
||||
aligned_type_strings: []const []const u8,
|
||||
|
||||
status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, bool),
|
||||
errunion_status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, bool),
|
||||
aligned_status: std.AutoArrayHashMapUnmanaged(link.ConstPool.Index, void),
|
||||
status: std.array_hash_map.Auto(link.ConstPool.Index, bool),
|
||||
errunion_status: std.array_hash_map.Auto(link.ConstPool.Index, bool),
|
||||
aligned_status: std.array_hash_map.Auto(link.ConstPool.Index, void),
|
||||
|
||||
fn processDeps(ft: *FlushTypes, deps: *const CTypeDependencies) void {
|
||||
const resolved = deps.get(ft.c);
|
||||
|
||||
+8
-8
@@ -30,18 +30,18 @@ strings: std.HashMapUnmanaged(
|
||||
),
|
||||
string_bytes: std.ArrayList(u8),
|
||||
image_section_table: std.ArrayList(Symbol.Index),
|
||||
pseudo_section_table: std.AutoArrayHashMapUnmanaged(String, Symbol.Index),
|
||||
object_section_table: std.AutoArrayHashMapUnmanaged(String, Symbol.Index),
|
||||
pseudo_section_table: std.array_hash_map.Auto(String, Symbol.Index),
|
||||
object_section_table: std.array_hash_map.Auto(String, Symbol.Index),
|
||||
symbol_table: std.ArrayList(Symbol),
|
||||
globals: std.AutoArrayHashMapUnmanaged(GlobalName, Symbol.Index),
|
||||
globals: std.array_hash_map.Auto(GlobalName, Symbol.Index),
|
||||
global_pending_index: u32,
|
||||
navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, Symbol.Index),
|
||||
uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Symbol.Index),
|
||||
navs: std.array_hash_map.Auto(InternPool.Nav.Index, Symbol.Index),
|
||||
uavs: std.array_hash_map.Auto(InternPool.Index, Symbol.Index),
|
||||
lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {
|
||||
map: std.AutoArrayHashMapUnmanaged(InternPool.Index, Symbol.Index),
|
||||
map: std.array_hash_map.Auto(InternPool.Index, Symbol.Index),
|
||||
pending_index: u32,
|
||||
}),
|
||||
pending_uavs: std.AutoArrayHashMapUnmanaged(Node.UavMapIndex, struct {
|
||||
pending_uavs: std.array_hash_map.Auto(Node.UavMapIndex, struct {
|
||||
alignment: InternPool.Alignment,
|
||||
}),
|
||||
relocs: std.ArrayList(Reloc),
|
||||
@@ -272,7 +272,7 @@ pub const Node = union(enum) {
|
||||
|
||||
pub const ImportTable = struct {
|
||||
ni: MappedFile.Node.Index,
|
||||
entries: std.AutoArrayHashMapUnmanaged(void, Entry),
|
||||
entries: std.array_hash_map.Auto(void, Entry),
|
||||
|
||||
pub const Entry = struct {
|
||||
import_lookup_table_ni: MappedFile.Node.Index,
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
/// * ensure that any `get` call is eventually followed by a `flushPending` call
|
||||
const ConstPool = @This();
|
||||
|
||||
values: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
values: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
pending: std.ArrayList(Index),
|
||||
complete_containers: std.AutoArrayHashMapUnmanaged(InternPool.Index, void),
|
||||
container_deps: std.AutoArrayHashMapUnmanaged(InternPool.Index, ContainerDepEntry.Index),
|
||||
complete_containers: std.array_hash_map.Auto(InternPool.Index, void),
|
||||
container_deps: std.array_hash_map.Auto(InternPool.Index, ContainerDepEntry.Index),
|
||||
container_dep_entries: std.ArrayList(ContainerDepEntry),
|
||||
|
||||
pub const empty: ConstPool = .{
|
||||
|
||||
+6
-6
@@ -27,11 +27,11 @@ address_size: AddressSize,
|
||||
|
||||
const_pool: link.ConstPool,
|
||||
|
||||
mods: std.AutoArrayHashMapUnmanaged(*Module, ModInfo),
|
||||
mods: std.array_hash_map.Auto(*Module, ModInfo),
|
||||
/// Indices are `link.ConstPool.Index`.
|
||||
values: std.ArrayList(struct { Unit.Index, Entry.Index }),
|
||||
navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, Entry.Index),
|
||||
decls: std.AutoArrayHashMapUnmanaged(InternPool.TrackedInst.Index, Entry.Index),
|
||||
navs: std.array_hash_map.Auto(InternPool.Nav.Index, Entry.Index),
|
||||
decls: std.array_hash_map.Auto(InternPool.TrackedInst.Index, Entry.Index),
|
||||
|
||||
debug_abbrev: DebugAbbrev,
|
||||
debug_aranges: DebugAranges,
|
||||
@@ -69,8 +69,8 @@ pub const AddressSize = enum(u8) {
|
||||
|
||||
const ModInfo = struct {
|
||||
root_dir_path: Entry.Index,
|
||||
dirs: std.AutoArrayHashMapUnmanaged(Unit.Index, void),
|
||||
files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void),
|
||||
dirs: std.array_hash_map.Auto(Unit.Index, void),
|
||||
files: std.array_hash_map.Auto(Zcu.File.Index, void),
|
||||
|
||||
fn deinit(mod_info: *ModInfo, gpa: Allocator) void {
|
||||
mod_info.dirs.deinit(gpa);
|
||||
@@ -236,7 +236,7 @@ const DebugRngLists = struct {
|
||||
|
||||
const StringSection = struct {
|
||||
contents: std.ArrayList(u8),
|
||||
map: std.AutoArrayHashMapUnmanaged(void, void),
|
||||
map: std.array_hash_map.Auto(void, void),
|
||||
section: Section,
|
||||
|
||||
const unit: Unit.Index = @enumFromInt(0);
|
||||
|
||||
+1
-1
@@ -4153,7 +4153,7 @@ pub const Ref = struct {
|
||||
pub const SymbolResolver = struct {
|
||||
keys: std.ArrayList(Key) = .empty,
|
||||
values: std.ArrayList(Ref) = .empty,
|
||||
table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
|
||||
table: std.array_hash_map.Auto(void, void) = .empty,
|
||||
|
||||
const Result = struct {
|
||||
found_existing: bool,
|
||||
|
||||
@@ -3,7 +3,7 @@ size: u64 = 0,
|
||||
alignment: Atom.Alignment = .@"1",
|
||||
output_section_index: u32 = 0,
|
||||
// atoms: std.ArrayList(Elf.Ref) = .empty,
|
||||
atoms: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,
|
||||
atoms: std.array_hash_map.Auto(Elf.Ref, void) = .empty,
|
||||
|
||||
dirty: bool = true,
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
value: i64 = 0,
|
||||
output_section_index: u32 = 0,
|
||||
symbols: std.AutoArrayHashMapUnmanaged(Elf.Ref, void) = .empty,
|
||||
symbols: std.array_hash_map.Auto(Elf.Ref, void) = .empty,
|
||||
output_symtab_ctx: Elf.SymtabCtx = .{},
|
||||
|
||||
pub fn deinit(thunk: *Thunk, allocator: Allocator) void {
|
||||
|
||||
@@ -2408,10 +2408,10 @@ const TlsVariable = struct {
|
||||
};
|
||||
|
||||
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);
|
||||
const TlsTable = std.AutoArrayHashMapUnmanaged(Atom.Index, void);
|
||||
const NavTable = std.array_hash_map.Auto(InternPool.Nav.Index, AvMetadata);
|
||||
const UavTable = std.array_hash_map.Auto(InternPool.Index, AvMetadata);
|
||||
const LazySymbolTable = std.array_hash_map.Auto(InternPool.Index, LazySymbolMetadata);
|
||||
const TlsTable = std.array_hash_map.Auto(Atom.Index, void);
|
||||
|
||||
const x86_64 = struct {
|
||||
fn writeTrampolineCode(source_addr: i64, target_addr: i64, buf: *[max_trampoline_len]u8) ![]u8 {
|
||||
|
||||
+4
-4
@@ -112,7 +112,7 @@ plt_first_symbol_reloc: SymbolReloc.Index,
|
||||
/// The `.dynamic` section contains zero or more symbol relocations starting at this index.
|
||||
dynamic_first_symbol_reloc: SymbolReloc.Index,
|
||||
|
||||
needed: std.AutoArrayHashMapUnmanaged(String(.dynstr), void),
|
||||
needed: std.array_hash_map.Auto(String(.dynstr), void),
|
||||
inputs: std.ArrayList(struct {
|
||||
path: std.Build.Cache.Path,
|
||||
member: ?[]const u8,
|
||||
@@ -120,21 +120,21 @@ inputs: std.ArrayList(struct {
|
||||
}),
|
||||
input_sections: std.ArrayList(InputSection),
|
||||
input_section_pending_index: u32,
|
||||
navs: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, struct {
|
||||
navs: std.array_hash_map.Auto(InternPool.Nav.Index, struct {
|
||||
lsi: Symbol.LocalIndex,
|
||||
/// The start index of the contiguous sequence of symbol relocations in this NAV.
|
||||
first_symbol_reloc: SymbolReloc.Index,
|
||||
/// The start index of the contiguous sequence of GOT relocations in this NAV.
|
||||
first_got_reloc: GotReloc.Index,
|
||||
}),
|
||||
uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, struct {
|
||||
uavs: std.array_hash_map.Auto(InternPool.Index, struct {
|
||||
lsi: Symbol.LocalIndex,
|
||||
/// The start index of the contiguous sequence of symbol relocations in this UAV.
|
||||
first_symbol_reloc: SymbolReloc.Index,
|
||||
// No `first_got_reloc` field because a UAV never contains GOT relocations.
|
||||
}),
|
||||
lazy: std.EnumArray(link.File.LazySymbol.Kind, struct {
|
||||
map: std.AutoArrayHashMapUnmanaged(InternPool.Index, struct {
|
||||
map: std.array_hash_map.Auto(InternPool.Index, struct {
|
||||
lsi: Symbol.LocalIndex,
|
||||
/// The start index of the contiguous sequence of symbol relocations in this lazy code/data.
|
||||
first_symbol_reloc: SymbolReloc.Index,
|
||||
|
||||
+4
-4
@@ -28,9 +28,9 @@ sections: std.MultiArrayList(Section) = .{},
|
||||
resolver: SymbolResolver = .{},
|
||||
/// This table will be populated after `scanRelocs` has run.
|
||||
/// Key is symbol index.
|
||||
undefs: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, UndefRefs) = .empty,
|
||||
undefs: std.array_hash_map.Auto(SymbolResolver.Index, UndefRefs) = .empty,
|
||||
undefs_mutex: std.Io.Mutex = .init,
|
||||
dupes: std.AutoArrayHashMapUnmanaged(SymbolResolver.Index, std.ArrayList(File.Index)) = .empty,
|
||||
dupes: std.array_hash_map.Auto(SymbolResolver.Index, std.ArrayList(File.Index)) = .empty,
|
||||
dupes_mutex: std.Io.Mutex = .init,
|
||||
|
||||
dyld_info_cmd: macho.dyld_info_command = .{},
|
||||
@@ -4102,7 +4102,7 @@ const Section = struct {
|
||||
};
|
||||
|
||||
pub const LiteralPool = struct {
|
||||
table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
|
||||
table: std.array_hash_map.Auto(void, void) = .empty,
|
||||
keys: std.ArrayList(Key) = .empty,
|
||||
values: std.ArrayList(MachO.Ref) = .empty,
|
||||
data: std.ArrayList(u8) = .empty,
|
||||
@@ -4541,7 +4541,7 @@ pub const Ref = struct {
|
||||
pub const SymbolResolver = struct {
|
||||
keys: std.ArrayList(Key) = .empty,
|
||||
values: std.ArrayList(Ref) = .empty,
|
||||
table: std.AutoArrayHashMapUnmanaged(void, void) = .empty,
|
||||
table: std.array_hash_map.Auto(void, void) = .empty,
|
||||
|
||||
const Result = struct {
|
||||
found_existing: bool,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
value: u64 = 0,
|
||||
out_n_sect: u8 = 0,
|
||||
symbols: std.AutoArrayHashMapUnmanaged(MachO.Ref, void) = .empty,
|
||||
symbols: std.array_hash_map.Auto(MachO.Ref, void) = .empty,
|
||||
output_symtab_ctx: MachO.SymtabCtx = .{},
|
||||
|
||||
pub fn deinit(thunk: *Thunk, allocator: Allocator) void {
|
||||
|
||||
@@ -1750,11 +1750,11 @@ 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 NavTable = std.array_hash_map.Auto(InternPool.Nav.Index, AvMetadata);
|
||||
const UavTable = std.array_hash_map.Auto(InternPool.Index, AvMetadata);
|
||||
const LazySymbolTable = std.array_hash_map.Auto(InternPool.Index, LazySymbolMetadata);
|
||||
const RelocationTable = std.ArrayList(std.ArrayList(Relocation));
|
||||
const TlvInitializerTable = std.AutoArrayHashMapUnmanaged(Atom.Index, TlvInitializer);
|
||||
const TlvInitializerTable = std.array_hash_map.Auto(Atom.Index, TlvInitializer);
|
||||
|
||||
const x86_64 = struct {
|
||||
fn writeTrampolineCode(source_addr: u64, target_addr: u64, buf: *[max_trampoline_len]u8) ![]u8 {
|
||||
|
||||
@@ -23,14 +23,14 @@ const ModuleInfo = struct {
|
||||
/// The set of (result-id's of) invocation globals that are accessed
|
||||
/// in this function, or after resolution, that are accessed in this
|
||||
/// function or any of it's callees.
|
||||
invocation_globals: std.AutoArrayHashMapUnmanaged(ResultId, void),
|
||||
invocation_globals: std.array_hash_map.Auto(ResultId, void),
|
||||
};
|
||||
|
||||
/// Information about a particular invocation global
|
||||
const InvocationGlobal = struct {
|
||||
/// The list of invocation globals that this invocation global
|
||||
/// depends on.
|
||||
dependencies: std.AutoArrayHashMapUnmanaged(ResultId, void),
|
||||
dependencies: std.array_hash_map.Auto(ResultId, void),
|
||||
/// The invocation global's type
|
||||
ty: ResultId,
|
||||
/// Initializer function. May be `none`.
|
||||
@@ -39,13 +39,13 @@ const ModuleInfo = struct {
|
||||
};
|
||||
|
||||
/// Maps function result-id -> Fn information structure.
|
||||
functions: std.AutoArrayHashMapUnmanaged(ResultId, Fn),
|
||||
functions: std.array_hash_map.Auto(ResultId, Fn),
|
||||
/// Set of OpFunction result-ids in this module.
|
||||
entry_points: std.AutoArrayHashMapUnmanaged(ResultId, void),
|
||||
entry_points: std.array_hash_map.Auto(ResultId, void),
|
||||
/// For each function, a list of function result-ids that it calls.
|
||||
callee_store: []const ResultId,
|
||||
/// Maps each invocation global result-id to a type-id.
|
||||
invocation_globals: std.AutoArrayHashMapUnmanaged(ResultId, InvocationGlobal),
|
||||
invocation_globals: std.array_hash_map.Auto(ResultId, InvocationGlobal),
|
||||
|
||||
/// Fetch the list of callees per function. Guaranteed to contain only unique IDs.
|
||||
fn callees(self: ModuleInfo, fn_id: ResultId) []const ResultId {
|
||||
@@ -344,7 +344,7 @@ const ModuleBuilder = struct {
|
||||
/// and until a general type deduplication pass is programmed, we just handle it here via this.
|
||||
function_types: std.ArrayHashMapUnmanaged(FunctionType, ResultId, FunctionType.Context, true) = .empty,
|
||||
/// Maps functions to new information required for creating the module
|
||||
function_new_info: std.AutoArrayHashMapUnmanaged(ResultId, FunctionNewInfo) = .empty,
|
||||
function_new_info: std.array_hash_map.Auto(ResultId, FunctionNewInfo) = .empty,
|
||||
/// Offset of the functions section in the new binary.
|
||||
new_functions_section: ?usize,
|
||||
|
||||
|
||||
+32
-32
@@ -80,27 +80,27 @@ name: []const u8,
|
||||
/// List of relocatable files to be linked into the final binary.
|
||||
objects: std.ArrayList(Object) = .empty,
|
||||
|
||||
func_types: std.AutoArrayHashMapUnmanaged(FunctionType, void) = .empty,
|
||||
func_types: std.array_hash_map.Auto(FunctionType, void) = .empty,
|
||||
/// Provides a mapping of both imports and provided functions to symbol name.
|
||||
/// Local functions may be unnamed.
|
||||
/// Key is symbol name, however the `FunctionImport` may have an name override for the import name.
|
||||
object_function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImport) = .empty,
|
||||
object_function_imports: std.array_hash_map.Auto(String, FunctionImport) = .empty,
|
||||
/// All functions for all objects.
|
||||
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,
|
||||
object_global_imports: std.array_hash_map.Auto(String, GlobalImport) = .empty,
|
||||
/// All globals for all objects.
|
||||
object_globals: std.ArrayList(ObjectGlobal) = .empty,
|
||||
|
||||
/// All table imports for all objects.
|
||||
object_table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport) = .empty,
|
||||
object_table_imports: std.array_hash_map.Auto(String, TableImport) = .empty,
|
||||
/// All parsed table sections for all objects.
|
||||
object_tables: std.ArrayList(Table) = .empty,
|
||||
|
||||
/// All memory imports for all objects.
|
||||
object_memory_imports: std.AutoArrayHashMapUnmanaged(String, MemoryImport) = .empty,
|
||||
object_memory_imports: std.array_hash_map.Auto(String, MemoryImport) = .empty,
|
||||
/// All parsed memory sections for all objects.
|
||||
object_memories: std.ArrayList(ObjectMemory) = .empty,
|
||||
|
||||
@@ -119,15 +119,15 @@ object_data_segments: std.ArrayList(ObjectDataSegment) = .empty,
|
||||
/// Each segment has many data symbols, which correspond logically to global
|
||||
/// constants.
|
||||
object_datas: std.ArrayList(ObjectData) = .empty,
|
||||
object_data_imports: std.AutoArrayHashMapUnmanaged(String, ObjectDataImport) = .empty,
|
||||
object_data_imports: std.array_hash_map.Auto(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,
|
||||
object_custom_segments: std.array_hash_map.Auto(ObjectSectionIndex, CustomSegment) = .empty,
|
||||
|
||||
/// All comdat information for all objects.
|
||||
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,
|
||||
object_relocations_table: std.array_hash_map.Auto(ObjectSectionIndex, ObjectRelocation.Slice) = .empty,
|
||||
/// Incremented across all objects in order to enable calculation of `ObjectSectionIndex` values.
|
||||
object_total_sections: u32 = 0,
|
||||
/// All comdat symbols from all objects concatenated.
|
||||
@@ -150,7 +150,7 @@ nav_fixups: std.ArrayList(NavFixup) = .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,
|
||||
symbol_table: std.array_hash_map.Auto(String, void) = .empty,
|
||||
|
||||
/// When importing objects from the host environment, a name must be supplied.
|
||||
/// LLVM uses "env" by default when none is given.
|
||||
@@ -174,24 +174,24 @@ preloaded_strings: PreloadedStrings,
|
||||
|
||||
/// This field is used when emitting an object; `navs_exe` used otherwise.
|
||||
/// Does not include externs since that data lives elsewhere.
|
||||
navs_obj: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, ZcuDataObj) = .empty,
|
||||
navs_obj: std.array_hash_map.Auto(InternPool.Nav.Index, ZcuDataObj) = .empty,
|
||||
/// This field is unused when emitting an object; `navs_obj` used otherwise.
|
||||
/// Does not include externs since that data lives elsewhere.
|
||||
navs_exe: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, ZcuDataExe) = .empty,
|
||||
navs_exe: std.array_hash_map.Auto(InternPool.Nav.Index, ZcuDataExe) = .empty,
|
||||
/// Tracks all InternPool values referenced by codegen. Needed for outputting
|
||||
/// the data segment. This one does not track ref count because object files
|
||||
/// require using max LEB encoding for these references anyway.
|
||||
uavs_obj: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuDataObj) = .empty,
|
||||
uavs_obj: std.array_hash_map.Auto(InternPool.Index, ZcuDataObj) = .empty,
|
||||
/// Tracks ref count to optimize LEB encodings for UAV references.
|
||||
uavs_exe: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuDataExe) = .empty,
|
||||
uavs_exe: std.array_hash_map.Auto(InternPool.Index, ZcuDataExe) = .empty,
|
||||
/// Sparse table of uavs that need to be emitted with greater alignment than
|
||||
/// the default for the type.
|
||||
overaligned_uavs: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment) = .empty,
|
||||
overaligned_uavs: std.array_hash_map.Auto(InternPool.Index, Alignment) = .empty,
|
||||
/// When the key is an enum type, this represents a `@tagName` function.
|
||||
zcu_funcs: std.AutoArrayHashMapUnmanaged(InternPool.Index, ZcuFunc) = .empty,
|
||||
nav_exports: std.AutoArrayHashMapUnmanaged(NavExport, Zcu.Export.Index) = .empty,
|
||||
uav_exports: std.AutoArrayHashMapUnmanaged(UavExport, Zcu.Export.Index) = .empty,
|
||||
imports: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,
|
||||
zcu_funcs: std.array_hash_map.Auto(InternPool.Index, ZcuFunc) = .empty,
|
||||
nav_exports: std.array_hash_map.Auto(NavExport, Zcu.Export.Index) = .empty,
|
||||
uav_exports: std.array_hash_map.Auto(UavExport, Zcu.Export.Index) = .empty,
|
||||
imports: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
|
||||
|
||||
dwarf: ?Dwarf = null,
|
||||
|
||||
@@ -200,19 +200,19 @@ flush_buffer: Flush = .{},
|
||||
/// Empty until `prelink`. There it is populated based on object files.
|
||||
/// Next, it is copied into `Flush.missing_exports` just before `flush`
|
||||
/// and that data is used during `flush`.
|
||||
missing_exports: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
|
||||
missing_exports: std.array_hash_map.Auto(String, void) = .empty,
|
||||
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,
|
||||
function_exports: std.array_hash_map.Auto(String, FunctionIndex) = .empty,
|
||||
hidden_function_exports: std.array_hash_map.Auto(String, FunctionIndex) = .empty,
|
||||
global_exports: std.ArrayList(GlobalExport) = .empty,
|
||||
/// Tracks the value at the end of prelink.
|
||||
global_exports_len: u32 = 0,
|
||||
|
||||
/// Ordered list of non-import functions that will appear in the final binary.
|
||||
/// Empty until prelink.
|
||||
functions: std.AutoArrayHashMapUnmanaged(FunctionImport.Resolution, void) = .empty,
|
||||
functions: std.array_hash_map.Auto(FunctionImport.Resolution, void) = .empty,
|
||||
/// Tracks the value at the end of prelink, at which point `functions`
|
||||
/// contains only object file functions, and nothing from the Zcu yet.
|
||||
functions_end_prelink: u32 = 0,
|
||||
@@ -230,7 +230,7 @@ data_imports_len_prelink: u32 = 0,
|
||||
/// `flush` gets a copy of this table, and then Zcu exports are applied to
|
||||
/// remove elements from the table, and the remainder are either undefined
|
||||
/// symbol errors, or import section entries depending on the output mode.
|
||||
function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImportId) = .empty,
|
||||
function_imports: std.array_hash_map.Auto(String, FunctionImportId) = .empty,
|
||||
|
||||
/// At the end of prelink, this is populated with data symbols needed by
|
||||
/// objects.
|
||||
@@ -243,29 +243,29 @@ function_imports: std.AutoArrayHashMapUnmanaged(String, FunctionImportId) = .emp
|
||||
/// `flush` gets a copy of this table, and then Zcu exports are applied to
|
||||
/// remove elements from the table, and the remainder are either undefined
|
||||
/// symbol errors, or symbol table entries depending on the output mode.
|
||||
data_imports: std.AutoArrayHashMapUnmanaged(String, DataImportId) = .empty,
|
||||
data_imports: std.array_hash_map.Auto(String, DataImportId) = .empty,
|
||||
/// Set of data symbols that will appear in the final binary. Used to populate
|
||||
/// `Flush.data_segments` before sorting.
|
||||
data_segments: std.AutoArrayHashMapUnmanaged(DataSegmentId, void) = .empty,
|
||||
data_segments: std.array_hash_map.Auto(DataSegmentId, void) = .empty,
|
||||
|
||||
/// Ordered list of non-import globals that will appear in the final binary.
|
||||
/// Empty until prelink.
|
||||
globals: std.AutoArrayHashMapUnmanaged(GlobalImport.Resolution, void) = .empty,
|
||||
globals: std.array_hash_map.Auto(GlobalImport.Resolution, void) = .empty,
|
||||
/// Tracks the value at the end of prelink, at which point `globals`
|
||||
/// contains only object file globals, and nothing from the Zcu yet.
|
||||
globals_end_prelink: u32 = 0,
|
||||
global_imports: std.AutoArrayHashMapUnmanaged(String, GlobalImportId) = .empty,
|
||||
global_imports: std.array_hash_map.Auto(String, GlobalImportId) = .empty,
|
||||
|
||||
/// Ordered list of non-import tables that will appear in the final binary.
|
||||
/// Empty until prelink.
|
||||
tables: std.AutoArrayHashMapUnmanaged(TableImport.Resolution, void) = .empty,
|
||||
table_imports: std.AutoArrayHashMapUnmanaged(String, TableImport.Index) = .empty,
|
||||
tables: std.array_hash_map.Auto(TableImport.Resolution, void) = .empty,
|
||||
table_imports: std.array_hash_map.Auto(String, TableImport.Index) = .empty,
|
||||
|
||||
/// All functions that have had their address taken and therefore might be
|
||||
/// called via a `call_indirect` function.
|
||||
zcu_indirect_function_set: std.AutoArrayHashMapUnmanaged(InternPool.Nav.Index, void) = .empty,
|
||||
object_indirect_function_import_set: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
|
||||
object_indirect_function_set: std.AutoArrayHashMapUnmanaged(ObjectFunctionIndex, void) = .empty,
|
||||
zcu_indirect_function_set: std.array_hash_map.Auto(InternPool.Nav.Index, void) = .empty,
|
||||
object_indirect_function_import_set: std.array_hash_map.Auto(String, void) = .empty,
|
||||
object_indirect_function_set: std.array_hash_map.Auto(ObjectFunctionIndex, void) = .empty,
|
||||
|
||||
error_name_table_ref_count: u32 = 0,
|
||||
tag_name_table_ref_count: u32 = 0,
|
||||
|
||||
@@ -24,22 +24,22 @@ const ArrayList = std.ArrayList;
|
||||
/// Ordered list of data segments that will appear in the final binary.
|
||||
/// When sorted, to-be-merged segments will be made adjacent.
|
||||
/// Values are virtual address.
|
||||
data_segments: std.AutoArrayHashMapUnmanaged(Wasm.DataSegmentId, u32) = .empty,
|
||||
data_segments: std.array_hash_map.Auto(Wasm.DataSegmentId, u32) = .empty,
|
||||
/// Each time a `data_segment` offset equals zero it indicates a new group, and
|
||||
/// the next element in this array will contain the total merged segment size.
|
||||
/// Value is the virtual memory address of the end of the segment.
|
||||
data_segment_groups: ArrayList(DataSegmentGroup) = .empty,
|
||||
|
||||
binary_bytes: ArrayList(u8) = .empty,
|
||||
missing_exports: std.AutoArrayHashMapUnmanaged(String, void) = .empty,
|
||||
function_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.FunctionImportId) = .empty,
|
||||
global_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.GlobalImportId) = .empty,
|
||||
data_imports: std.AutoArrayHashMapUnmanaged(String, Wasm.DataImportId) = .empty,
|
||||
missing_exports: std.array_hash_map.Auto(String, void) = .empty,
|
||||
function_imports: std.array_hash_map.Auto(String, Wasm.FunctionImportId) = .empty,
|
||||
global_imports: std.array_hash_map.Auto(String, Wasm.GlobalImportId) = .empty,
|
||||
data_imports: std.array_hash_map.Auto(String, Wasm.DataImportId) = .empty,
|
||||
|
||||
indirect_function_table: std.AutoArrayHashMapUnmanaged(Wasm.OutputFunctionIndex, void) = .empty,
|
||||
indirect_function_table: std.array_hash_map.Auto(Wasm.OutputFunctionIndex, void) = .empty,
|
||||
|
||||
/// A subset of the full interned function type list created only during flush.
|
||||
func_types: std.AutoArrayHashMapUnmanaged(Wasm.FunctionType.Index, void) = .empty,
|
||||
func_types: std.array_hash_map.Auto(Wasm.FunctionType.Index, void) = .empty,
|
||||
|
||||
/// For debug purposes only.
|
||||
memory_layout_finished: bool = false,
|
||||
|
||||
+1
-1
@@ -4419,7 +4419,7 @@ fn serveUpdateResults(s: *Server, comp: *Compilation) !void {
|
||||
|
||||
var file_name_bytes: std.ArrayList(u8) = .empty;
|
||||
defer file_name_bytes.deinit(gpa);
|
||||
var files: std.AutoArrayHashMapUnmanaged(Zcu.File.Index, void) = .empty;
|
||||
var files: std.array_hash_map.Auto(Zcu.File.Index, void) = .empty;
|
||||
defer files.deinit(gpa);
|
||||
var decl_data: std.ArrayList(u8) = .empty;
|
||||
defer decl_data.deinit(gpa);
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ pub fn main(init: std.process.Init) !void {
|
||||
try stdout.print("{any}\n", .{header.*});
|
||||
const pcs = header.pcAddrs();
|
||||
|
||||
var indexed_pcs: std.AutoArrayHashMapUnmanaged(usize, void) = .empty;
|
||||
var indexed_pcs: std.array_hash_map.Auto(usize, void) = .empty;
|
||||
try indexed_pcs.entries.resize(arena, pcs.len);
|
||||
@memcpy(indexed_pcs.entries.items(.key), pcs);
|
||||
try indexed_pcs.reIndex(arena);
|
||||
|
||||
Reference in new issue
Block a user