commit 4c330e053ba45f383a7642da53482dfbce1b50cf (tree) parent e133f793ee42cae28d68eaab442bf243489993d6 Author: Matthew Lugg <mlugg@mlugg.co.uk> Date: Sat, 2 May 2026 10:59:45 +0100 compiler: use 'std.lang' instead of 'std.builtin' Diffstat:
59 files changed, 578 insertions(+), 579 deletions(-)
diff --git a/build.zig b/build.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const builtin = std.builtin; const BufMap = std.BufMap; const mem = std.mem; const fs = std.fs; @@ -398,22 +397,22 @@ pub fn build(b: *std.Build) !void { const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{}; const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false; - var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined; + var chosen_opt_modes_buf: [4]std.lang.OptimizeMode = undefined; var chosen_mode_index: usize = 0; if (!skip_debug) { - chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.Debug; + chosen_opt_modes_buf[chosen_mode_index] = .Debug; chosen_mode_index += 1; } if (!skip_release_safe) { - chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.ReleaseSafe; + chosen_opt_modes_buf[chosen_mode_index] = .ReleaseSafe; chosen_mode_index += 1; } if (!skip_release_fast) { - chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.ReleaseFast; + chosen_opt_modes_buf[chosen_mode_index] = .ReleaseFast; chosen_mode_index += 1; } if (!skip_release_small) { - chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.ReleaseSmall; + chosen_opt_modes_buf[chosen_mode_index] = .ReleaseSmall; chosen_mode_index += 1; } const optimize_modes = chosen_opt_modes_buf[0..chosen_mode_index]; @@ -706,11 +705,11 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { // // * We lose a small amount of performance. This is essentially irrelevant for zig1. // - // * We lose the ability to perform trivial renames on certain `std.builtin` types without + // * We lose the ability to perform trivial renames on certain `std.lang` types without // zig1.wasm updates. For instance, we cannot rename an enum from PascalCase fields to // snake_case fields without an update. // - // * We gain the ability to add and remove fields to and from `std.builtin` types without + // * We gain the ability to add and remove fields to and from `std.lang` types without // zig1.wasm updates. For instance, we can add a new tag to `CallingConvention` without // an update. // @@ -740,7 +739,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { } const AddCompilerModOptions = struct { - optimize: std.builtin.OptimizeMode, + optimize: std.lang.OptimizeMode, target: std.Build.ResolvedTarget, strip: ?bool = null, valgrind: ?bool = null, @@ -1029,7 +1028,7 @@ fn addCMakeLibraryList(mod: *std.Build.Module, list: []const u8) void { } const CMakeConfig = struct { - llvm_linkage: std.builtin.LinkMode, + llvm_linkage: std.lang.LinkMode, cmake_binary_dir: []const u8, cmake_prefix_path: []const u8, cmake_static_library_prefix: []const u8, diff --git a/lib/std/zig/Ast.zig b/lib/std/zig/Ast.zig @@ -2103,7 +2103,7 @@ fn fullFnProtoComponents(tree: Ast, info: full.FnProto.Components) full.FnProto } fn fullPtrTypeComponents(tree: Ast, info: full.PtrType.Components) full.PtrType { - const size: std.builtin.Type.Pointer.Size = switch (tree.tokenTag(info.main_token)) { + const size: std.lang.Type.Pointer.Size = switch (tree.tokenTag(info.main_token)) { .asterisk => .one, .l_bracket => switch (tree.tokenTag(info.main_token + 1)) { .asterisk => if (tree.tokenTag(info.main_token + 2) == .identifier) .c else .many, @@ -2726,7 +2726,7 @@ pub const full = struct { }; pub const PtrType = struct { - size: std.builtin.Type.Pointer.Size, + size: std.lang.Type.Pointer.Size, allowzero_token: ?TokenIndex, const_token: ?TokenIndex, volatile_token: ?TokenIndex, diff --git a/lib/std/zig/AstGen.zig b/lib/std/zig/AstGen.zig @@ -4815,7 +4815,7 @@ fn structDeclInner( scope: *Scope, node: Ast.Node.Index, container_decl: Ast.full.ContainerDecl, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, maybe_backing_int_node: Ast.Node.OptionalIndex, name_strat: Zir.Inst.NameStrategy, ) InnerError!Zir.Inst.Ref { @@ -5020,7 +5020,7 @@ fn tupleDecl( scope: *Scope, node: Ast.Node.Index, container_decl: Ast.full.ContainerDecl, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, backing_int_node: Ast.Node.OptionalIndex, ) InnerError!Zir.Inst.Ref { const astgen = gz.astgen; @@ -5117,7 +5117,7 @@ fn unionDeclInner( scope: *Scope, node: Ast.Node.Index, members: []const Ast.Node.Index, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, opt_arg_node: Ast.Node.OptionalIndex, auto_enum_tok: ?Ast.TokenIndex, name_strat: Zir.Inst.NameStrategy, @@ -5324,7 +5324,7 @@ fn containerDecl( switch (tree.tokenTag(container_decl.ast.main_token)) { .keyword_struct => { - const layout: std.builtin.Type.ContainerLayout = if (container_decl.layout_token) |t| switch (tree.tokenTag(t)) { + const layout: std.lang.Type.ContainerLayout = if (container_decl.layout_token) |t| switch (tree.tokenTag(t)) { .keyword_packed => .@"packed", .keyword_extern => .@"extern", else => unreachable, @@ -5334,7 +5334,7 @@ fn containerDecl( return rvalue(gz, ri, result, node); }, .keyword_union => { - const layout: std.builtin.Type.ContainerLayout = if (container_decl.layout_token) |t| switch (tree.tokenTag(t)) { + const layout: std.lang.Type.ContainerLayout = if (container_decl.layout_token) |t| switch (tree.tokenTag(t)) { .keyword_packed => .@"packed", .keyword_extern => .@"extern", else => unreachable, @@ -8060,7 +8060,7 @@ fn identifier( int_type: { if (ident_name_raw.len < 2) break :int_type; - const signedness: std.builtin.Signedness = switch (ident_name_raw[0]) { + const signedness: std.lang.Signedness = switch (ident_name_raw[0]) { 'u' => .unsigned, 'i' => .signed, else => break :int_type, @@ -9925,7 +9925,7 @@ fn callExpr( const astgen = gz.astgen; const callee = try calleeExpr(gz, scope, ri.rl, override_decl_literal_type, call.ast.fn_expr); - const modifier: std.builtin.CallModifier = blk: { + const modifier: std.lang.CallModifier = blk: { if (gz.nosuspend_node != .none) { break :blk .no_suspend; } @@ -12350,7 +12350,7 @@ const GenZir = struct { fn setStruct(gz: *GenZir, inst: Zir.Inst.Index, args: struct { src_node: Ast.Node.Index, name_strat: Zir.Inst.NameStrategy, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, backing_int_type_body_len: ?u32, decls_len: u32, fields_len: u32, diff --git a/lib/std/zig/LibCInstallation.zig b/lib/std/zig/LibCInstallation.zig @@ -703,8 +703,8 @@ pub const CrtBasenames = struct { pub const GetArgs = struct { target: *const std.Target, link_libc: bool, - output_mode: std.builtin.OutputMode, - link_mode: std.builtin.LinkMode, + output_mode: std.lang.OutputMode, + link_mode: std.lang.LinkMode, pie: bool, }; diff --git a/lib/std/zig/Zir.zig b/lib/std/zig/Zir.zig @@ -2418,7 +2418,7 @@ pub const Inst = struct { has_bit_range: bool, _: u1 = 0, }, - size: std.builtin.Type.Pointer.Size, + size: std.lang.Type.Pointer.Size, /// Index into extra. See `PtrType`. payload_index: u32, }, @@ -2426,7 +2426,7 @@ pub const Inst = struct { /// Offset from Decl AST node index. /// `Tag` determines which kind of AST node this points to. src_node: Ast.Node.Offset, - signedness: std.builtin.Signedness, + signedness: std.lang.Signedness, bit_count: u16, }, @"unreachable": struct { @@ -3051,7 +3051,7 @@ pub const Inst = struct { callee: Ref, pub const Flags = packed struct { - /// std.builtin.CallModifier in packed form + /// std.lang.CallModifier in packed form pub const PackedModifier = u3; pub const PackedArgsLen = u27; @@ -3063,7 +3063,7 @@ pub const Inst = struct { comptime { if (@sizeOf(Flags) != 4 or @bitSizeOf(Flags) != 32) @compileError("Layout of Call.Flags needs to be updated!"); - if (@bitSizeOf(std.builtin.CallModifier) != @bitSizeOf(PackedModifier)) + if (@bitSizeOf(std.lang.CallModifier) != @bitSizeOf(PackedModifier)) @compileError("Call.Flags.PackedModifier needs to be updated!"); } }; @@ -3186,7 +3186,7 @@ pub const Inst = struct { pub const ReifySliceArgInfo = enum(u16) { /// Input element type is `type`. - /// Output element type is `std.builtin.Type.Fn.Param.Attributes`. + /// Output element type is `std.lang.Type.Fn.Param.Attributes`. type_to_fn_param_attrs, /// Input element type is `[]const u8`. /// Output element type is `type`. @@ -3194,10 +3194,10 @@ pub const Inst = struct { /// Identical to `string_to_struct_field_type` aside from emitting slightly different error messages. string_to_union_field_type, /// Input element type is `[]const u8`. - /// Output element type is `std.builtin.Type.StructField.Attributes`. + /// Output element type is `std.lang.Type.StructField.Attributes`. string_to_struct_field_attrs, /// Input element type is `[]const u8`. - /// Output element type is `std.builtin.Type.UnionField.Attributes`. + /// Output element type is `std.lang.Type.UnionField.Attributes`. string_to_union_field_attrs, }; @@ -3468,7 +3468,7 @@ pub const Inst = struct { has_decls_len: bool, has_fields_len: bool, name_strategy: NameStrategy, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, /// Always `false` if `layout != .@"packed"`. has_backing_int_type: bool, any_field_aligns: bool, @@ -3688,7 +3688,7 @@ pub const Inst = struct { }; } - pub fn layout(k: Kind) std.builtin.Type.ContainerLayout { + pub fn layout(k: Kind) std.lang.Type.ContainerLayout { return switch (k) { .auto, .tagged_explicit, .tagged_enum, .tagged_enum_explicit => .auto, .@"extern" => .@"extern", @@ -5286,7 +5286,7 @@ pub const UnwrappedStructDecl = struct { decls: []const Inst.Index, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, backing_int_type_body: ?[]const Inst.Index, field_names: []const NullTerminatedString, diff --git a/lib/std/zig/llvm/Builder.zig b/lib/std/zig/llvm/Builder.zig @@ -1830,7 +1830,7 @@ pub const Visibility = enum(u2) { hidden = 1, protected = 2, - pub fn fromSymbolVisibility(sv: std.builtin.SymbolVisibility) Visibility { + pub fn fromSymbolVisibility(sv: std.lang.SymbolVisibility) Visibility { return switch (sv) { .default => .default, .hidden => .hidden, diff --git a/src/Air.zig b/src/Air.zig @@ -1260,17 +1260,17 @@ pub const Inst = struct { }, atomic_load: struct { ptr: Ref, - order: std.builtin.AtomicOrder, + order: std.lang.AtomicOrder, }, prefetch: struct { ptr: Ref, - rw: std.builtin.PrefetchOptions.Rw, + rw: std.lang.PrefetchOptions.Rw, locality: u2, - cache: std.builtin.PrefetchOptions.Cache, + cache: std.lang.PrefetchOptions.Cache, }, reduce: struct { operand: Ref, - operation: std.builtin.ReduceOp, + operation: std.lang.ReduceOp, }, ty_nav: struct { ty: InternPool.Index, @@ -1332,8 +1332,8 @@ pub const CondBr = struct { else_body_len: u32, branch_hints: BranchHints, pub const BranchHints = packed struct(u32) { - true: std.builtin.BranchHint = .none, - false: std.builtin.BranchHint = .none, + true: std.lang.BranchHint = .none, + false: std.lang.BranchHint = .none, then_cov: CoveragePoint = .none, else_cov: CoveragePoint = .none, _: u24 = 0, @@ -1499,11 +1499,11 @@ pub const Cmpxchg = struct { /// 0b00000000000000000000000000XXX000 - failure_order flags: u32, - pub fn successOrder(self: Cmpxchg) std.builtin.AtomicOrder { + pub fn successOrder(self: Cmpxchg) std.lang.AtomicOrder { return @enumFromInt(@as(u3, @truncate(self.flags))); } - pub fn failureOrder(self: Cmpxchg) std.builtin.AtomicOrder { + pub fn failureOrder(self: Cmpxchg) std.lang.AtomicOrder { return @enumFromInt(@as(u3, @intCast(self.flags >> 3))); } }; @@ -1514,11 +1514,11 @@ pub const AtomicRmw = struct { /// 0b0000000000000000000000000XXXX000 - op flags: u32, - pub fn ordering(self: AtomicRmw) std.builtin.AtomicOrder { + pub fn ordering(self: AtomicRmw) std.lang.AtomicOrder { return @enumFromInt(@as(u3, @truncate(self.flags))); } - pub fn op(self: AtomicRmw) std.builtin.AtomicRmwOp { + pub fn op(self: AtomicRmw) std.lang.AtomicRmwOp { return @enumFromInt(@as(u4, @intCast(self.flags >> 3))); } }; @@ -2077,14 +2077,14 @@ pub const UnwrappedSwitch = struct { cases_start: u32, /// Asserts that `case_idx < us.cases_len`. - pub fn getHint(us: UnwrappedSwitch, case_idx: u32) std.builtin.BranchHint { + pub fn getHint(us: UnwrappedSwitch, case_idx: u32) std.lang.BranchHint { assert(case_idx < us.cases_len); return us.getHintInner(case_idx); } - pub fn getElseHint(us: UnwrappedSwitch) std.builtin.BranchHint { + pub fn getElseHint(us: UnwrappedSwitch) std.lang.BranchHint { return us.getHintInner(us.cases_len); } - fn getHintInner(us: UnwrappedSwitch, idx: u32) std.builtin.BranchHint { + fn getHintInner(us: UnwrappedSwitch, idx: u32) std.lang.BranchHint { const bag = us.air.extra.items[us.branch_hints_start..][idx / 10]; const bits: u3 = @truncate(bag >> @intCast(3 * (idx % 10))); return @enumFromInt(bits); @@ -2630,7 +2630,7 @@ pub const CompilerRtFunc = enum(u32) { }; } - pub fn @"callconv"(f: CompilerRtFunc, target: *const std.Target) std.builtin.CallingConvention { + pub fn @"callconv"(f: CompilerRtFunc, target: *const std.Target) std.lang.CallingConvention { const use_gnu_f16_abi = switch (target.cpu.arch) { .wasm32, .wasm64, diff --git a/src/Air/print.zig b/src/Air/print.zig @@ -625,7 +625,7 @@ const Writer = struct { w: *Writer, s: *std.Io.Writer, inst: Air.Inst.Index, - order: std.builtin.AtomicOrder, + order: std.lang.AtomicOrder, ) Error!void { const bin_op = w.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; try w.writeOperand(s, inst, 0, bin_op.lhs); diff --git a/src/Builtin.zig b/src/Builtin.zig @@ -1,13 +1,13 @@ target: std.Target, -zig_backend: std.builtin.CompilerBackend, -output_mode: std.builtin.OutputMode, -link_mode: std.builtin.LinkMode, -unwind_tables: std.builtin.UnwindTables, +zig_backend: std.lang.CompilerBackend, +output_mode: std.lang.OutputMode, +link_mode: std.lang.LinkMode, +unwind_tables: std.lang.UnwindTables, is_test: bool, single_threaded: bool, link_libc: bool, link_libcpp: bool, -optimize_mode: std.builtin.OptimizeMode, +optimize_mode: std.lang.OptimizeMode, error_tracing: bool, valgrind: bool, sanitize_thread: bool, @@ -15,9 +15,9 @@ fuzz: bool, pic: bool, pie: bool, strip: bool, -code_model: std.builtin.CodeModel, +code_model: std.lang.CodeModel, omit_frame_pointer: bool, -wasi_exec_model: std.builtin.WasiExecModel, +wasi_exec_model: std.lang.WasiExecModel, /// Compute an abstract hash representing this `Builtin`. This is *not* a hash /// of the resulting file contents. diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -177,7 +177,7 @@ verbose_link: bool, link_depfile: ?[]const u8, disable_c_depfile: bool, stack_report: bool, -debug_compiler_runtime_libs: ?std.builtin.OptimizeMode, +debug_compiler_runtime_libs: ?std.lang.OptimizeMode, debug_compile_errors: bool, /// Do not check this field directly. Instead, use the `debugIncremental` wrapper function. debug_incremental: bool, @@ -1676,7 +1676,7 @@ pub const CreateOptions = struct { verbose_llvm_bc: ?[]const u8 = null, link_depfile: ?[]const u8 = null, verbose_llvm_cpu_features: bool = false, - debug_compiler_runtime_libs: ?std.builtin.OptimizeMode = null, + debug_compiler_runtime_libs: ?std.lang.OptimizeMode = null, debug_compile_errors: bool = false, debug_incremental: bool = false, /// Normally when you create a `Compilation`, Zig will automatically build @@ -4928,8 +4928,8 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU defer arena_allocator.deinit(); const arena = arena_allocator.allocator(); - const optimize_mode = std.builtin.OptimizeMode.ReleaseSmall; - const output_mode = std.builtin.OutputMode.Exe; + const optimize_mode = std.lang.OptimizeMode.ReleaseSmall; + const output_mode = std.lang.OutputMode.Exe; const resolved_target: Package.Module.ResolvedTarget = .{ .result = std.zig.system.resolveTargetQuery(io, .{ .cpu_arch = .wasm32, @@ -5285,8 +5285,8 @@ fn buildRt( comp: *Compilation, root_source_name: []const u8, root_name: []const u8, - output_mode: std.builtin.OutputMode, - link_mode: std.builtin.LinkMode, + output_mode: std.lang.OutputMode, + link_mode: std.lang.LinkMode, misc_task: MiscTask, prog_node: std.Progress.Node, options: RtOptions, @@ -7260,7 +7260,7 @@ fn dumpArgvWriter(w: *Io.Writer, argv: []const []const u8) Io.Writer.Error!void try w.writeByte('\n'); } -pub fn getZigBackend(comp: Compilation) std.builtin.CompilerBackend { +pub fn getZigBackend(comp: Compilation) std.lang.CompilerBackend { const target = &comp.root_mod.resolved_target.result; return target_util.zigBackend(target, comp.config.use_llvm); } @@ -7302,8 +7302,8 @@ fn buildOutputFromZig( comp: *Compilation, src_basename: []const u8, root_name: []const u8, - output_mode: std.builtin.OutputMode, - link_mode: std.builtin.LinkMode, + output_mode: std.lang.OutputMode, + link_mode: std.lang.LinkMode, misc_task_tag: MiscTask, prog_node: std.Progress.Node, options: RtOptions, @@ -7433,7 +7433,7 @@ pub const CrtFileOptions = struct { function_sections: bool = true, data_sections: bool = true, omit_frame_pointer: ?bool = null, - unwind_tables: ?std.builtin.UnwindTables = null, + unwind_tables: ?std.lang.UnwindTables = null, pic: ?bool = null, no_builtin: ?bool = null, @@ -7443,7 +7443,7 @@ pub const CrtFileOptions = struct { pub fn build_crt_file( comp: *Compilation, root_name: []const u8, - output_mode: std.builtin.OutputMode, + output_mode: std.lang.OutputMode, misc_task_tag: MiscTask, prog_node: std.Progress.Node, /// These elements have to get mutated to add the owner module after it is @@ -7657,7 +7657,7 @@ pub fn addLinkLib(comp: *Compilation, lib_name: []const u8) !void { /// This decides the optimization mode for all zig-provided libraries, including /// compiler-rt, libcxx, libc, libunwind, etc. -pub fn compilerRtOptMode(comp: Compilation) std.builtin.OptimizeMode { +pub fn compilerRtOptMode(comp: Compilation) std.lang.OptimizeMode { if (comp.debug_compiler_runtime_libs) |mode| { return mode; } diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig @@ -4,8 +4,8 @@ //! order to resolve per-Module defaults. have_zcu: bool, -output_mode: std.builtin.OutputMode, -link_mode: std.builtin.LinkMode, +output_mode: std.lang.OutputMode, +link_mode: std.lang.LinkMode, link_libc: bool, link_libcpp: bool, link_libunwind: bool, @@ -53,13 +53,13 @@ lto: std.zig.LtoMode, incremental: bool, /// WASI-only. Type of WASI execution model ("command" or "reactor"). /// Always set to `command` for non-WASI targets. -wasi_exec_model: std.builtin.WasiExecModel, +wasi_exec_model: std.lang.WasiExecModel, import_memory: bool, export_memory: bool, shared_memory: bool, is_test: bool, debug_format: DebugFormat, -root_optimize_mode: std.builtin.OptimizeMode, +root_optimize_mode: std.lang.OptimizeMode, root_strip: bool, root_error_tracing: bool, dll_export_fns: bool, @@ -75,15 +75,15 @@ pub const DebugFormat = union(enum) { }; pub const Options = struct { - output_mode: std.builtin.OutputMode, + output_mode: std.lang.OutputMode, resolved_target: Module.ResolvedTarget, is_test: bool, have_zcu: bool, emit_bin: bool, - root_optimize_mode: ?std.builtin.OptimizeMode = null, + root_optimize_mode: ?std.lang.OptimizeMode = null, root_strip: ?bool = null, root_error_tracing: ?bool = null, - link_mode: ?std.builtin.LinkMode = null, + link_mode: ?std.lang.LinkMode = null, ensure_libc_on_non_freestanding: bool = false, ensure_libcpp_on_non_freestanding: bool = false, any_non_single_threaded: bool = false, @@ -109,7 +109,7 @@ pub const Options = struct { lto: ?std.zig.LtoMode = null, incremental: bool = false, /// WASI-only. Type of WASI execution model ("command" or "reactor"). - wasi_exec_model: ?std.builtin.WasiExecModel = null, + wasi_exec_model: ?std.lang.WasiExecModel = null, import_memory: ?bool = null, export_memory: ?bool = null, shared_memory: ?bool = null, diff --git a/src/InternPool.zig b/src/InternPool.zig @@ -566,7 +566,7 @@ pub const Nav = struct { type: InternPool.Index, @"align": Alignment, @"linksection": OptionalNullTerminatedString, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, @"const": bool, @"threadlocal": bool, /// This field is whether this `Nav` is a literal `extern` definition. @@ -678,7 +678,7 @@ pub const Nav = struct { const Bits = packed struct(u16) { @"align": Alignment, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, @"const": bool, @"threadlocal": bool, is_extern_decl: bool, @@ -1084,7 +1084,7 @@ const Local = struct { } } fn PtrElem(comptime opts: struct { - size: std.builtin.Type.Pointer.Size, + size: std.lang.Type.Pointer.Size, is_const: bool = false, }) type { const elem_info = @typeInfo(Elem).@"struct"; @@ -2029,7 +2029,7 @@ pub const Key = union(enum) { val: Index, }; - pub const IntType = std.builtin.Type.Int; + pub const IntType = std.lang.Type.Int; /// Extern for hashing via memory reinterpretation. pub const ErrorUnionType = extern struct { @@ -2090,8 +2090,8 @@ pub const Key = union(enum) { bit_offset: u16, }; - pub const Size = std.builtin.Type.Pointer.Size; - pub const AddressSpace = std.builtin.AddressSpace; + pub const Size = std.lang.Type.Pointer.Size; + pub const AddressSpace = std.lang.AddressSpace; }; /// Extern so that hashing can be done via memory reinterpreting. @@ -2160,7 +2160,7 @@ pub const Key = union(enum) { /// Tells whether a parameter is noalias. See `paramIsNoalias` helper /// method for accessing this. noalias_bits: u32, - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, is_var_args: bool, is_noinline: bool, @@ -2207,15 +2207,15 @@ pub const Key = union(enum) { /// For example `extern "c" fn write(...) usize` would have 'c' as library name. /// Index into the string table bytes. lib_name: OptionalNullTerminatedString, - linkage: std.builtin.GlobalLinkage, - visibility: std.builtin.SymbolVisibility, + linkage: std.lang.GlobalLinkage, + visibility: std.lang.SymbolVisibility, is_threadlocal: bool, is_dll_import: bool, - relocation: std.builtin.ExternOptions.Relocation, - decoration: ?std.builtin.ExternOptions.Decoration, + relocation: std.lang.ExternOptions.Relocation, + decoration: ?std.lang.ExternOptions.Decoration, is_const: bool, alignment: Alignment, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, /// The ZIR instruction which created this extern; used only for source locations. /// This is a `declaration`. zir_index: TrackedInst.Index, @@ -2289,7 +2289,7 @@ pub const Key = union(enum) { return @atomicLoad(FuncAnalysis, func.analysisPtr(ip), .unordered); } - pub fn setBranchHint(func: Func, ip: *InternPool, io: Io, hint: std.builtin.BranchHint) void { + pub fn setBranchHint(func: Func, ip: *InternPool, io: Io, hint: std.lang.BranchHint) void { const extra_mutex = &ip.getLocal(func.tid).mutate.extra.mutex; extra_mutex.lockUncancelable(io); defer extra_mutex.unlock(io); @@ -3186,7 +3186,7 @@ pub const LoadedStructType = struct { name_nav: Nav.Index.Optional, namespace: NamespaceIndex, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, /// May be `undefined` if `layout != .@"packed"`. packed_backing_mode: BackingTypeMode, @@ -3369,7 +3369,7 @@ pub const LoadedUnionType = struct { name_nav: Nav.Index.Optional, namespace: NamespaceIndex, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, enum_tag_mode: BackingTypeMode, /// May be `undefined` if `layout != .@"packed"`. packed_backing_mode: BackingTypeMode, @@ -5368,10 +5368,10 @@ pub const Tag = enum(u8) { descriptor_binding: u32, pub const Flags = packed struct(u32) { - linkage: std.builtin.GlobalLinkage, - visibility: std.builtin.SymbolVisibility, + linkage: std.lang.GlobalLinkage, + visibility: std.lang.SymbolVisibility, is_dll_import: bool, - relocation: std.builtin.ExternOptions.Relocation, + relocation: std.lang.ExternOptions.Relocation, source: Source, decoration_type: DecorationType, _: u23 = 0, @@ -5380,13 +5380,13 @@ pub const Tag = enum(u8) { pub const DecorationType = enum(u2) { none, location, descriptor }; }; - pub fn decoration(self: Extern) ?std.builtin.ExternOptions.Decoration { + pub fn decoration(self: Extern) ?std.lang.ExternOptions.Decoration { return switch (self.flags.decoration_type) { .none => null, - .location => std.builtin.ExternOptions.Decoration{ + .location => std.lang.ExternOptions.Decoration{ .location = self.location_or_descriptor_set, }, - .descriptor => std.builtin.ExternOptions.Decoration{ .descriptor = .{ .set = self.location_or_descriptor_set, .binding = self.descriptor_binding } }, + .descriptor => std.lang.ExternOptions.Decoration{ .descriptor = .{ .set = self.location_or_descriptor_set, .binding = self.descriptor_binding } }, }; } }; @@ -5711,7 +5711,7 @@ pub const BackingTypeMode = enum(u1) { /// to be part of the type of the function. pub const FuncAnalysis = packed struct(u32) { want_runtime_analysis: bool, - branch_hint: std.builtin.BranchHint, + branch_hint: std.lang.BranchHint, is_noinline: bool, has_error_trace: bool, /// True if this function has an inferred error set. @@ -7980,7 +7980,7 @@ pub fn getDeclaredStructType( // InternPool, so that it is possible for their backing storage to be "reallocated" as needed // during type resolution. fields_len: u32, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, any_comptime_fields: bool, any_field_defaults: bool, any_field_aligns: bool, @@ -8124,7 +8124,7 @@ pub fn getReifiedStructType(ip: *InternPool, gpa: Allocator, io: Io, tid: Zcu.Pe zir_index: TrackedInst.Index, type_hash: u64, fields_len: u32, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, any_comptime_fields: bool, any_field_defaults: bool, any_field_aligns: bool, @@ -8300,7 +8300,7 @@ pub fn getDeclaredUnionType( // InternPool, so that it is possible for their backing storage to be "reallocated" as needed // during type resolution. fields_len: u32, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, any_field_aligns: bool, tag_usage: LoadedUnionType.TagUsage, enum_tag_mode: BackingTypeMode, @@ -8421,7 +8421,7 @@ pub fn getReifiedUnionType(ip: *InternPool, gpa: Allocator, io: Io, tid: Zcu.Per zir_index: TrackedInst.Index, type_hash: u64, fields_len: u32, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, any_field_aligns: bool, tag_usage: LoadedUnionType.TagUsage, /// Explicitly specified enum tag type. `.none` if `tag_usage != .tagged`. @@ -8969,7 +8969,7 @@ pub const GetFuncTypeKey = struct { comptime_bits: u32 = 0, noalias_bits: u32 = 0, /// `null` means generic. - cc: ?std.builtin.CallingConvention = .auto, + cc: ?std.lang.CallingConvention = .auto, is_var_args: bool = false, is_noinline: bool = false, }; @@ -9117,7 +9117,7 @@ pub const GetFuncDeclKey = struct { rbrace_line: u32, lbrace_column: u32, rbrace_column: u32, - cc: ?std.builtin.CallingConvention, + cc: ?std.lang.CallingConvention, is_noinline: bool, }; @@ -9193,7 +9193,7 @@ pub const GetFuncDeclIesKey = struct { comptime_bits: u32, bare_return_type: Index, /// null means generic. - cc: ?std.builtin.CallingConvention, + cc: ?std.lang.CallingConvention, is_var_args: bool, is_noinline: bool, zir_body_inst: TrackedInst.Index, @@ -11763,7 +11763,7 @@ pub fn getBackingAddrTag(ip: *const InternPool, val: Index) ?Key.Ptr.BaseAddr.Ta /// This is a particularly hot function, so we operate directly on encodings /// rather than the more straightforward implementation of calling `indexToKey`. /// Asserts `index` is not `.generic_poison_type`. -pub fn zigTypeTag(ip: *const InternPool, index: Index) std.builtin.TypeId { +pub fn zigTypeTag(ip: *const InternPool, index: Index) std.lang.TypeId { return switch (index) { .u0_type, .u1_type, @@ -12407,13 +12407,13 @@ pub fn getErrorValueIfExists(ip: *const InternPool, name: NullTerminatedString) } const PackedCallingConvention = packed struct(u18) { - tag: std.builtin.CallingConvention.Tag, + tag: std.lang.CallingConvention.Tag, /// May be ignored depending on `tag`. incoming_stack_alignment: Alignment, /// Interpretation depends on `tag`. extra: u4, - fn pack(cc: std.builtin.CallingConvention) PackedCallingConvention { + fn pack(cc: std.lang.CallingConvention) PackedCallingConvention { return switch (cc) { inline else => |pl, tag| switch (@TypeOf(pl)) { void => .{ @@ -12421,42 +12421,42 @@ const PackedCallingConvention = packed struct(u18) { .incoming_stack_alignment = .none, // unused .extra = 0, // unused }, - std.builtin.CallingConvention.CommonOptions => .{ + std.lang.CallingConvention.CommonOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = 0, // unused }, - std.builtin.CallingConvention.X86RegparmOptions => .{ + std.lang.CallingConvention.X86RegparmOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = pl.register_params, }, - std.builtin.CallingConvention.ArcInterruptOptions => .{ + std.lang.CallingConvention.ArcInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = @intFromEnum(pl.type), }, - std.builtin.CallingConvention.ArmInterruptOptions => .{ + std.lang.CallingConvention.ArmInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = @intFromEnum(pl.type), }, - std.builtin.CallingConvention.MicroblazeInterruptOptions => .{ + std.lang.CallingConvention.MicroblazeInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = @intFromEnum(pl.type), }, - std.builtin.CallingConvention.MipsInterruptOptions => .{ + std.lang.CallingConvention.MipsInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = @intFromEnum(pl.mode), }, - std.builtin.CallingConvention.RiscvInterruptOptions => .{ + std.lang.CallingConvention.RiscvInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = @intFromEnum(pl.mode), }, - std.builtin.CallingConvention.ShInterruptOptions => .{ + std.lang.CallingConvention.ShInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), .extra = @intFromEnum(pl.save), @@ -12466,41 +12466,41 @@ const PackedCallingConvention = packed struct(u18) { }; } - fn unpack(cc: PackedCallingConvention) std.builtin.CallingConvention { + fn unpack(cc: PackedCallingConvention) std.lang.CallingConvention { return switch (cc.tag) { inline else => |tag| @unionInit( - std.builtin.CallingConvention, + std.lang.CallingConvention, @tagName(tag), - switch (@FieldType(std.builtin.CallingConvention, @tagName(tag))) { + switch (@FieldType(std.lang.CallingConvention, @tagName(tag))) { void => {}, - std.builtin.CallingConvention.CommonOptions => .{ + std.lang.CallingConvention.CommonOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), }, - std.builtin.CallingConvention.X86RegparmOptions => .{ + std.lang.CallingConvention.X86RegparmOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .register_params = @intCast(cc.extra), }, - std.builtin.CallingConvention.ArcInterruptOptions => .{ + std.lang.CallingConvention.ArcInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .type = @enumFromInt(cc.extra), }, - std.builtin.CallingConvention.ArmInterruptOptions => .{ + std.lang.CallingConvention.ArmInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .type = @enumFromInt(cc.extra), }, - std.builtin.CallingConvention.MicroblazeInterruptOptions => .{ + std.lang.CallingConvention.MicroblazeInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .type = @enumFromInt(cc.extra), }, - std.builtin.CallingConvention.MipsInterruptOptions => .{ + std.lang.CallingConvention.MipsInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .mode = @enumFromInt(cc.extra), }, - std.builtin.CallingConvention.RiscvInterruptOptions => .{ + std.lang.CallingConvention.RiscvInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .mode = @enumFromInt(cc.extra), }, - std.builtin.CallingConvention.ShInterruptOptions => .{ + std.lang.CallingConvention.ShInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), .save = @enumFromInt(cc.extra), }, diff --git a/src/Package/Module.zig b/src/Package/Module.zig @@ -15,8 +15,8 @@ fully_qualified_name: []const u8, deps: Deps = .{}, resolved_target: ResolvedTarget, -optimize_mode: std.builtin.OptimizeMode, -code_model: std.builtin.CodeModel, +optimize_mode: std.lang.OptimizeMode, +code_model: std.lang.CodeModel, single_threaded: bool, error_tracing: bool, valgrind: bool, @@ -29,7 +29,7 @@ red_zone: bool, sanitize_c: std.zig.SanitizeC, sanitize_thread: bool, fuzz: bool, -unwind_tables: std.builtin.UnwindTables, +unwind_tables: std.lang.UnwindTables, cc_argv: []const []const u8, /// (SPIR-V) whether to generate a structured control flow graph or not structured_cfg: bool, @@ -61,8 +61,8 @@ pub const CreateOptions = struct { pub const Inherited = struct { /// If this is null then `parent` must be non-null. resolved_target: ?ResolvedTarget = null, - optimize_mode: ?std.builtin.OptimizeMode = null, - code_model: ?std.builtin.CodeModel = null, + optimize_mode: ?std.lang.OptimizeMode = null, + code_model: ?std.lang.CodeModel = null, single_threaded: ?bool = null, error_tracing: ?bool = null, valgrind: ?bool = null, @@ -75,7 +75,7 @@ pub const CreateOptions = struct { /// other number means stack protection with that buffer size. stack_protector: ?u32 = null, red_zone: ?bool = null, - unwind_tables: ?std.builtin.UnwindTables = null, + unwind_tables: ?std.lang.UnwindTables = null, sanitize_c: ?std.zig.SanitizeC = null, sanitize_thread: ?bool = null, fuzz: ?bool = null, @@ -238,7 +238,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module { break :b false; }; - const code_model: std.builtin.CodeModel = b: { + const code_model: std.lang.CodeModel = b: { if (options.inherited.code_model) |x| break :b x; if (options.parent) |p| break :b p.code_model; break :b .default; diff --git a/src/Sema.zig b/src/Sema.zig @@ -135,7 +135,7 @@ allow_memoize: bool = true, /// The `BranchHint` for the current branch of runtime control flow. /// This state is on `Sema` so that `cold` hints can be propagated up through blocks with less special handling. -branch_hint: ?std.builtin.BranchHint = null, +branch_hint: ?std.lang.BranchHint = null, const RuntimeIndex = enum(u32) { zero = 0, @@ -383,7 +383,7 @@ pub const Block = struct { want_safety: ?bool = null, /// What mode to generate float operations in, set by @setFloatMode - float_mode: std.builtin.FloatMode = .strict, + float_mode: std.lang.FloatMode = .strict, /// If not `null`, this boolean is set when a `dbg_var_ptr`, `dbg_var_val`, or `dbg_arg_inline`. /// instruction is emitted. It signals that the innermost lexically @@ -759,7 +759,7 @@ pub const Block = struct { }); } - fn addReduce(block: *Block, operand: Air.Inst.Ref, operation: std.builtin.ReduceOp) !Air.Inst.Ref { + fn addReduce(block: *Block, operand: Air.Inst.Ref, operation: std.lang.ReduceOp) !Air.Inst.Ref { const sema = block.sema; const zcu = sema.pt.zcu; const allow_optimized = switch (sema.typeOf(operand).childType(zcu).zigTypeTag(zcu)) { @@ -1023,7 +1023,7 @@ pub fn deinit(sema: *Sema) void { /// control flow happens here, Sema will convert it to runtime control flow by introducing post-hoc /// blocks where necessary. /// Returns the branch hint for this branch. -fn analyzeBodyRuntimeBreak(sema: *Sema, block: *Block, body: []const Zir.Inst.Index) !std.builtin.BranchHint { +fn analyzeBodyRuntimeBreak(sema: *Sema, block: *Block, body: []const Zir.Inst.Index) !std.lang.BranchHint { const parent_hint = sema.branch_hint; defer sema.branch_hint = parent_hint; sema.branch_hint = null; @@ -2804,8 +2804,8 @@ fn analyzeValueAsCallconv( block: *Block, src: LazySrcLoc, val: Value, -) !std.builtin.CallingConvention { - return interpretStdLangType(sema, block, src, val, std.builtin.CallingConvention); +) !std.lang.CallingConvention { + return interpretStdLangType(sema, block, src, val, std.lang.CallingConvention); } fn interpretStdLangType( @@ -6147,7 +6147,7 @@ fn zirCall( const extra = sema.code.extraData(ExtraType, inst_data.payload_index); const args_len = extra.data.flags.args_len; - const modifier: std.builtin.CallModifier = @enumFromInt(extra.data.flags.packed_modifier); + const modifier: std.lang.CallModifier = @enumFromInt(extra.data.flags.packed_modifier); const ensure_result_used = extra.data.flags.ensure_result_used; const pop_error_return_trace = extra.data.flags.pop_error_return_trace; @@ -6322,7 +6322,7 @@ fn callBuiltin( block: *Block, call_src: LazySrcLoc, builtin_fn: Air.Inst.Ref, - modifier: std.builtin.CallModifier, + modifier: std.lang.CallModifier, args: []const Air.Inst.Ref, operation: CallOperation, ) !void { @@ -6543,7 +6543,7 @@ fn analyzeCall( func_ty: Type, func_src: LazySrcLoc, call_src: LazySrcLoc, - modifier: std.builtin.CallModifier, + modifier: std.lang.CallModifier, ensure_result_used: bool, args_info: CallArgsInfo, call_dbg_node: ?Zir.Inst.Index, @@ -8367,7 +8367,7 @@ fn zirFunc( // If this instruction has a body, then it's a function declaration, and we decide // the callconv based on whether it is exported. Otherwise, the callconv defaults // to `.auto`. - const cc: std.builtin.CallingConvention = if (has_body) cc: { + const cc: std.lang.CallingConvention = if (has_body) cc: { const func_decl_nav = sema.owner.unwrap().nav_val; const fn_is_exported = exported: { const decl_inst = ip.getNav(func_decl_nav).analysis.?.zir_index.resolve(ip) orelse return error.AnalysisFail; @@ -8509,7 +8509,7 @@ pub fn handleExternLibName( /// These are calling conventions that are confirmed to work with variadic functions. /// Any calling conventions not included here are either not yet verified to work with variadic /// functions or there are no more other calling conventions that support variadic functions. -const calling_conventions_supporting_var_args = [_]std.builtin.CallingConvention.Tag{ +const calling_conventions_supporting_var_args = [_]std.lang.CallingConvention.Tag{ .x86_16_cdecl, .x86_64_sysv, .x86_64_x32, @@ -8570,12 +8570,12 @@ const calling_conventions_supporting_var_args = [_]std.builtin.CallingConvention .xtensa_call0, .xtensa_windowed, }; -fn callConvSupportsVarArgs(cc: std.builtin.CallingConvention.Tag) bool { +fn callConvSupportsVarArgs(cc: std.lang.CallingConvention.Tag) bool { return for (calling_conventions_supporting_var_args) |supported_cc| { if (cc == supported_cc) return true; } else false; } -fn checkCallConvSupportsVarArgs(sema: *Sema, block: *Block, src: LazySrcLoc, cc: std.builtin.CallingConvention.Tag) CompileError!void { +fn checkCallConvSupportsVarArgs(sema: *Sema, block: *Block, src: LazySrcLoc, cc: std.lang.CallingConvention.Tag) CompileError!void { const CallingConventionsSupportingVarArgsList = struct { arch: std.Target.Cpu.Arch, pub fn format(ctx: @This(), w: *std.Io.Writer) std.Io.Writer.Error!void { @@ -8612,7 +8612,7 @@ fn checkParamType( param_is_comptime: bool, param_is_noalias: bool, param_src: LazySrcLoc, - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, ) CompileError!void { const pt = sema.pt; const zcu = pt.zcu; @@ -8668,7 +8668,7 @@ fn checkReturnTypeAndCallConv( block: *Block, bare_ret_ty: Type, ret_ty_src: LazySrcLoc, - @"callconv": std.builtin.CallingConvention, + @"callconv": std.lang.CallingConvention, callconv_src: LazySrcLoc, /// non-`null` only if the function is varargs. opt_varargs_src: ?LazySrcLoc, @@ -8772,7 +8772,7 @@ fn checkReturnTypeAndCallConv( fn validateResolvedFuncType( sema: *Sema, block: *Block, - @"callconv": std.builtin.CallingConvention, + @"callconv": std.lang.CallingConvention, param_types: []const InternPool.Index, ret_ty: Type, src: LazySrcLoc, @@ -8823,7 +8823,7 @@ fn validateResolvedFuncType( } } -fn callConvIsCallable(cc: std.builtin.CallingConvention.Tag) bool { +fn callConvIsCallable(cc: std.lang.CallingConvention.Tag) bool { return switch (cc) { .naked, @@ -8898,7 +8898,7 @@ fn funcCommon( block: *Block, src_node_offset: std.zig.Ast.Node.Offset, func_inst: Zir.Inst.Index, - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, /// this might be Type.generic_poison bare_return_type: Type, var_args: bool, @@ -9896,7 +9896,7 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp else try sema.analyzeIsNonErr(block, operand_src, eu_maybe_ptr); - const non_err_hint: std.builtin.BranchHint = hint: { + const non_err_hint: std.lang.BranchHint = hint: { // don't analyze the non-error body if it's unreachable if (non_err_cond == .bool_false) { break :hint undefined; @@ -10488,14 +10488,14 @@ fn finishSwitchBr( const bags_required = std.math.divCeil(u32, hints.count + additional_count, hints_per_bag) catch unreachable; return hints.bags.ensureUnusedCapacity(gpa_inner, bags_required); } - fn appendAssumeCapacity(hints: *@This(), hint: std.builtin.BranchHint) void { + fn appendAssumeCapacity(hints: *@This(), hint: std.lang.BranchHint) void { const idx_in_bag = hints.count % hints_per_bag; var bag: u32 = if (idx_in_bag > 0) hints.bags.pop().? else 0; - bag |= @as(u32, @intFromEnum(hint)) << @intCast(@bitSizeOf(std.builtin.BranchHint) * idx_in_bag); + bag |= @as(u32, @intFromEnum(hint)) << @intCast(@bitSizeOf(std.lang.BranchHint) * idx_in_bag); hints.count += 1; return hints.bags.appendAssumeCapacity(bag); } - fn append(hints: *@This(), gpa_inner: Allocator, hint: std.builtin.BranchHint) Allocator.Error!void { + fn append(hints: *@This(), gpa_inner: Allocator, hint: std.lang.BranchHint) Allocator.Error!void { try hints.ensureUnusedCapacity(gpa_inner, 1); return hints.appendAssumeCapacity(hint); } @@ -10574,7 +10574,7 @@ fn finishSwitchBr( } emit_bb = true; - const prong_hint: std.builtin.BranchHint = hint: { + const prong_hint: std.lang.BranchHint = hint: { if (analyze_body) break :hint try sema.analyzeSwitchProng( &case_block, operand, @@ -10717,7 +10717,7 @@ fn finishSwitchBr( case_block.instructions.clearRetainingCapacity(); case_block.error_return_trace_index = child_block.error_return_trace_index; - const prong_hint: std.builtin.BranchHint = hint: { + const prong_hint: std.lang.BranchHint = hint: { if (any_analyze_body) break :hint try sema.analyzeSwitchProng( &case_block, operand, @@ -10804,7 +10804,7 @@ fn finishSwitchBr( if (emit_bb) try sema.emitBackwardBranch(block, else_prong_src); emit_bb = true; - const prong_hint: std.builtin.BranchHint = hint: { + const prong_hint: std.lang.BranchHint = hint: { if (analyze_body) break :hint try sema.analyzeSwitchProng( &case_block, operand, @@ -10864,7 +10864,7 @@ fn finishSwitchBr( cases_len += 1; - const prong_hint: std.builtin.BranchHint = hint: { + const prong_hint: std.lang.BranchHint = hint: { if (!else_case.is_inline) break :hint try sema.analyzeSwitchProng( &case_block, operand, @@ -11937,7 +11937,7 @@ fn analyzeSwitchProng( else_err_ty: ?Type, switch_inst: Zir.Inst.Index, zir_switch: *const Zir.UnwrappedSwitchBlock, -) CompileError!std.builtin.BranchHint { +) CompileError!std.lang.BranchHint { const pt = sema.pt; const zcu = pt.zcu; @@ -12328,7 +12328,7 @@ fn analyzeSwitchPayloadCapture( { // All branch hints are `.none`, so just add zero elems. - comptime assert(@intFromEnum(std.builtin.BranchHint.none) == 0); + comptime assert(@intFromEnum(std.lang.BranchHint.none) == 0); const need_elems = std.math.divCeil(usize, prong_count + 1, 10) catch unreachable; try cases_extra.appendNTimes(0, need_elems); } @@ -16088,7 +16088,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.@"fn"))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.@"fn"))).toIntern(), .val = (try pt.aggregateValue(fn_info_ty, &field_values)).toIntern(), }))); }, @@ -16104,7 +16104,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.int))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.int))).toIntern(), .val = (try pt.aggregateValue(int_info_ty, &field_values)).toIntern(), }))); }, @@ -16117,7 +16117,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.float))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.float))).toIntern(), .val = (try pt.aggregateValue(float_info_ty, &field_vals)).toIntern(), }))); }, @@ -16162,7 +16162,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.pointer))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.pointer))).toIntern(), .val = (try pt.aggregateValue(pointer_ty, &field_values)).toIntern(), }))); }, @@ -16180,7 +16180,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.array))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.array))).toIntern(), .val = (try pt.aggregateValue(array_field_ty, &field_values)).toIntern(), }))); }, @@ -16196,7 +16196,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.vector))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.vector))).toIntern(), .val = (try pt.aggregateValue(vector_field_ty, &field_values)).toIntern(), }))); }, @@ -16209,7 +16209,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.optional))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.optional))).toIntern(), .val = (try pt.aggregateValue(optional_field_ty, &field_values)).toIntern(), }))); }, @@ -16300,7 +16300,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai // Construct Type{ .error_set = errors_val } return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.error_set))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.error_set))).toIntern(), .val = errors_val, }))); }, @@ -16315,7 +16315,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.error_union))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.error_union))).toIntern(), .val = (try pt.aggregateValue(error_union_field_ty, &field_values)).toIntern(), }))); }, @@ -16418,7 +16418,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.@"enum"))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.@"enum"))).toIntern(), .val = (try pt.aggregateValue(type_enum_ty, &field_values)).toIntern(), }))); }, @@ -16539,7 +16539,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.@"union"))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.@"union"))).toIntern(), .val = (try pt.aggregateValue(type_union_ty, &field_values)).toIntern(), }))); }, @@ -16731,7 +16731,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.@"struct"))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.@"struct"))).toIntern(), .val = (try pt.aggregateValue(type_struct_ty, &field_values)).toIntern(), }))); }, @@ -16746,7 +16746,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai }; return Air.internedToRef((try pt.internUnion(.{ .ty = type_info_ty.toIntern(), - .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.builtin.TypeId.@"opaque"))).toIntern(), + .tag = (try pt.enumValueFieldIndex(type_info_tag_ty, @intFromEnum(std.lang.TypeId.@"opaque"))).toIntern(), .val = (try pt.aggregateValue(type_opaque_ty, &field_values)).toIntern(), }))); }, @@ -17323,7 +17323,7 @@ fn zirCondbr( // Reset, this may have been updated by the then block analysis sub_block.error_return_trace_index = parent_block.error_return_trace_index; - const false_hint: std.builtin.BranchHint = if (err_cond != null and + const false_hint: std.lang.BranchHint = if (err_cond != null and try sema.maybeErrorUnwrap(&sub_block, else_body, err_cond.?, cond_src, false)) h: { // nothing to do here. weight against error branch @@ -18040,7 +18040,7 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air break :blk try sema.validateAlign(block, align_src, align_bytes); } else .none; - const address_space: std.builtin.AddressSpace = if (inst_data.flags.has_addrspace) blk: { + const address_space: std.lang.AddressSpace = if (inst_data.flags.has_addrspace) blk: { const ref: Zir.Inst.Ref = @enumFromInt(sema.code.extra[extra_i]); extra_i += 1; break :blk try sema.resolveAddressSpace(block, addrspace_src, ref, .pointer); @@ -19605,12 +19605,12 @@ fn zirReifyPointer( const size_uncoerced = sema.resolveInst(extra.size); const size_coerced = try sema.coerce(block, size_ty, size_uncoerced, size_src); const size_val = try sema.resolveConstDefinedValue(block, size_src, size_coerced, .{ .simple = .pointer_size }); - const size = try sema.interpretStdLangType(block, size_src, size_val, std.builtin.Type.Pointer.Size); + const size = try sema.interpretStdLangType(block, size_src, size_val, std.lang.Type.Pointer.Size); const attrs_uncoerced = sema.resolveInst(extra.attrs); const attrs_coerced = try sema.coerce(block, attrs_ty, attrs_uncoerced, attrs_src); const attrs_val = try sema.resolveConstDefinedValue(block, attrs_src, attrs_coerced, .{ .simple = .pointer_attrs }); - const attrs = try sema.interpretStdLangType(block, attrs_src, attrs_val, std.builtin.Type.Pointer.Attributes); + const attrs = try sema.interpretStdLangType(block, attrs_src, attrs_val, std.lang.Type.Pointer.Attributes); const @"align": Alignment = if (attrs.@"align") |bytes| a: { break :a try sema.validateAlign(block, attrs_src, bytes); @@ -19711,7 +19711,7 @@ fn zirReifyFn( const fn_attrs_uncoerced = sema.resolveInst(extra.fn_attrs); const fn_attrs_coerced = try sema.coerce(block, fn_attrs_ty, fn_attrs_uncoerced, fn_attrs_src); const fn_attrs_val = try sema.resolveConstDefinedValue(block, fn_attrs_src, fn_attrs_coerced, .{ .simple = .fn_attrs }); - const fn_attrs = try sema.interpretStdLangType(block, fn_attrs_src, fn_attrs_val, std.builtin.Type.Fn.Attributes); + const fn_attrs = try sema.interpretStdLangType(block, fn_attrs_src, fn_attrs_val, std.lang.Type.Fn.Attributes); var noalias_bits: u32 = 0; const param_types_ip = try sema.arena.alloc(InternPool.Index, @intCast(params_len)); @@ -19721,7 +19721,7 @@ fn zirReifyFn( block, param_attrs_src, try param_attrs_arr.elemValue(pt, param_idx), - std.builtin.Type.Fn.Param.Attributes, + std.lang.Type.Fn.Param.Attributes, ); try sema.checkParamType( block, @@ -19831,7 +19831,7 @@ fn zirReifyStruct( const layout_uncoerced = sema.resolveInst(extra.layout); const layout_coerced = try sema.coerce(block, container_layout_ty, layout_uncoerced, layout_src); const layout_val = try sema.resolveConstDefinedValue(block, layout_src, layout_coerced, .{ .simple = .struct_layout }); - const layout = try sema.interpretStdLangType(block, layout_src, layout_val, std.builtin.Type.ContainerLayout); + const layout = try sema.interpretStdLangType(block, layout_src, layout_val, std.lang.Type.ContainerLayout); const backing_int_ty_uncoerced = sema.resolveInst(extra.backing_ty); const backing_int_ty_coerced = try sema.coerce(block, .optional_type, backing_int_ty_uncoerced, backing_ty_src); @@ -19912,15 +19912,15 @@ fn zirReifyStruct( const field_name = try sema.sliceToIpString(block, field_names_src, field_name_val, .{ .simple = .struct_field_names }); const field_attr_comptime = try field_attrs_val.fieldValue(pt, std.meta.fieldIndex( - std.builtin.Type.StructField.Attributes, + std.lang.Type.StructField.Attributes, "comptime", ).?); const field_attr_align = try field_attrs_val.fieldValue(pt, std.meta.fieldIndex( - std.builtin.Type.StructField.Attributes, + std.lang.Type.StructField.Attributes, "align", ).?); const field_attr_default_value_ptr = try field_attrs_val.fieldValue(pt, std.meta.fieldIndex( - std.builtin.Type.StructField.Attributes, + std.lang.Type.StructField.Attributes, "default_value_ptr", ).?); @@ -19997,15 +19997,15 @@ fn zirReifyStruct( wip.field_types.get(ip)[field_idx] = field_ty.toIntern(); const field_attr_comptime = try field_attrs_val.fieldValue(pt, std.meta.fieldIndex( - std.builtin.Type.StructField.Attributes, + std.lang.Type.StructField.Attributes, "comptime", ).?); const field_attr_align = try field_attrs_val.fieldValue(pt, std.meta.fieldIndex( - std.builtin.Type.StructField.Attributes, + std.lang.Type.StructField.Attributes, "align", ).?); const field_attr_default_value_ptr = try field_attrs_val.fieldValue(pt, std.meta.fieldIndex( - std.builtin.Type.StructField.Attributes, + std.lang.Type.StructField.Attributes, "default_value_ptr", ).?); @@ -20111,7 +20111,7 @@ fn zirReifyUnion( const layout_uncoerced = sema.resolveInst(extra.layout); const layout_coerced = try sema.coerce(block, container_layout_ty, layout_uncoerced, layout_src); const layout_val = try sema.resolveConstDefinedValue(block, layout_src, layout_coerced, .{ .simple = .union_layout }); - const layout = try sema.interpretStdLangType(block, layout_src, layout_val, std.builtin.Type.ContainerLayout); + const layout = try sema.interpretStdLangType(block, layout_src, layout_val, std.lang.Type.ContainerLayout); const arg_ty_uncoerced = sema.resolveInst(extra.arg_ty); const arg_ty_coerced = try sema.coerce(block, .optional_type, arg_ty_uncoerced, arg_ty_src); @@ -20195,7 +20195,7 @@ fn zirReifyUnion( block, field_attrs_src, try field_attrs_arr.elemValue(pt, field_idx), - std.builtin.Type.UnionField.Attributes, + std.lang.Type.UnionField.Attributes, ); if (field_attrs.@"align") |bytes| { if (layout == .@"packed") { @@ -20244,7 +20244,7 @@ fn zirReifyUnion( block, .unneeded, try field_attrs_arr.elemValue(pt, field_idx), - std.builtin.Type.UnionField.Attributes, + std.lang.Type.UnionField.Attributes, ); if (field_attrs.@"align") |bytes| { // No source location; first loop checked this is valid. @@ -20329,7 +20329,7 @@ fn zirReifyEnum( const mode_uncoerced = sema.resolveInst(extra.mode); const mode_coerced = try sema.coerce(block, enum_mode_ty, mode_uncoerced, mode_src); const mode_val = try sema.resolveConstDefinedValue(block, mode_src, mode_coerced, .{ .simple = .type }); - const nonexhaustive = switch (try sema.interpretStdLangType(block, mode_src, mode_val, std.builtin.Type.Enum.Mode)) { + const nonexhaustive = switch (try sema.interpretStdLangType(block, mode_src, mode_val, std.lang.Type.Enum.Mode)) { .exhaustive => false, .nonexhaustive => true, }; @@ -21962,9 +21962,9 @@ fn checkArithmeticOp( sema: *Sema, block: *Block, src: LazySrcLoc, - scalar_tag: std.builtin.TypeId, - lhs_zig_ty_tag: std.builtin.TypeId, - rhs_zig_ty_tag: std.builtin.TypeId, + scalar_tag: std.lang.TypeId, + lhs_zig_ty_tag: std.lang.TypeId, + rhs_zig_ty_tag: std.lang.TypeId, zir_tag: Zir.Inst.Tag, ) CompileError!void { const is_int = scalar_tag == .int or scalar_tag == .comptime_int; @@ -22387,7 +22387,7 @@ fn resolveExportOptions( const linkage_operand = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "linkage", .no_embedded_nulls), linkage_src); const linkage_val = try sema.resolveConstDefinedValue(block, linkage_src, linkage_operand, .{ .simple = .export_options }); - const linkage = try sema.interpretStdLangType(block, linkage_src, linkage_val, std.builtin.GlobalLinkage); + const linkage = try sema.interpretStdLangType(block, linkage_src, linkage_val, std.lang.GlobalLinkage); const section_operand = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "section", .no_embedded_nulls), section_src); const section_opt_val = try sema.resolveConstDefinedValue(block, section_src, section_operand, .{ .simple = .export_options }); @@ -22398,7 +22398,7 @@ fn resolveExportOptions( const visibility_operand = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "visibility", .no_embedded_nulls), visibility_src); const visibility_val = try sema.resolveConstDefinedValue(block, visibility_src, visibility_operand, .{ .simple = .export_options }); - const visibility = try sema.interpretStdLangType(block, visibility_src, visibility_val, std.builtin.SymbolVisibility); + const visibility = try sema.interpretStdLangType(block, visibility_src, visibility_val, std.lang.SymbolVisibility); if (name.len < 1) { return sema.fail(block, name_src, "exported symbol name cannot be empty", .{}); @@ -22425,12 +22425,12 @@ fn resolveStdLangEnum( zir_ref: Zir.Inst.Ref, comptime name: Zcu.StdLangDecl, reason: ComptimeReason, -) CompileError!@field(std.builtin, @tagName(name)) { +) CompileError!@field(std.lang, @tagName(name)) { const ty = try sema.getStdLangType(src, name); const air_ref = sema.resolveInst(zir_ref); const coerced = try sema.coerce(block, ty, air_ref, src); const val = try sema.resolveConstDefinedValue(block, src, coerced, reason); - return sema.interpretStdLangType(block, src, val, @field(std.builtin, @tagName(name))); + return sema.interpretStdLangType(block, src, val, @field(std.lang, @tagName(name))); } fn resolveAtomicOrder( @@ -22439,7 +22439,7 @@ fn resolveAtomicOrder( src: LazySrcLoc, zir_ref: Zir.Inst.Ref, reason: ComptimeReason, -) CompileError!std.builtin.AtomicOrder { +) CompileError!std.lang.AtomicOrder { return sema.resolveStdLangEnum(block, src, zir_ref, .AtomicOrder, reason); } @@ -22448,7 +22448,7 @@ fn resolveAtomicRmwOp( block: *Block, src: LazySrcLoc, zir_ref: Zir.Inst.Ref, -) CompileError!std.builtin.AtomicRmwOp { +) CompileError!std.lang.AtomicRmwOp { return sema.resolveStdLangEnum(block, src, zir_ref, .AtomicRmwOp, .{ .simple = .operand_atomicRmw_operation }); } @@ -22490,10 +22490,10 @@ fn zirCmpxchg( const success_order = try sema.resolveAtomicOrder(block, success_order_src, extra.success_order, .{ .simple = .atomic_order }); const failure_order = try sema.resolveAtomicOrder(block, failure_order_src, extra.failure_order, .{ .simple = .atomic_order }); - if (@intFromEnum(success_order) < @intFromEnum(std.builtin.AtomicOrder.monotonic)) { + if (@intFromEnum(success_order) < @intFromEnum(std.lang.AtomicOrder.monotonic)) { return sema.fail(block, success_order_src, "success atomic ordering must be monotonic or stricter", .{}); } - if (@intFromEnum(failure_order) < @intFromEnum(std.builtin.AtomicOrder.monotonic)) { + if (@intFromEnum(failure_order) < @intFromEnum(std.lang.AtomicOrder.monotonic)) { return sema.fail(block, failure_order_src, "failure atomic ordering must be monotonic or stricter", .{}); } if (@intFromEnum(failure_order) > @intFromEnum(success_order)) { @@ -23200,7 +23200,7 @@ fn zirBuiltinCall(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError const air_ref = sema.resolveInst(extra.modifier); const modifier_ref = try sema.coerce(block, modifier_ty, air_ref, modifier_src); const modifier_val = try sema.resolveConstDefinedValue(block, modifier_src, modifier_ref, .{ .simple = .call_modifier }); - var modifier = try sema.interpretStdLangType(block, modifier_src, modifier_val, std.builtin.CallModifier); + var modifier = try sema.interpretStdLangType(block, modifier_src, modifier_val, std.lang.CallModifier); switch (modifier) { // These can be upgraded to comptime or nosuspend calls. .auto, .never_tail, .no_suspend => { @@ -24250,7 +24250,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A var extra_index: usize = extra.end; - const cc: std.builtin.CallingConvention = if (extra.data.bits.has_cc_body) blk: { + const cc: std.lang.CallingConvention = if (extra.data.bits.has_cc_body) blk: { const body_len = sema.code.extra[extra_index]; extra_index += 1; const body = sema.code.bodySlice(extra_index, body_len); @@ -24398,7 +24398,7 @@ fn resolvePrefetchOptions( block: *Block, src: LazySrcLoc, zir_ref: Zir.Inst.Ref, -) CompileError!std.builtin.PrefetchOptions { +) CompileError!std.lang.PrefetchOptions { const pt = sema.pt; const zcu = pt.zcu; const comp = zcu.comp; @@ -24422,10 +24422,10 @@ fn resolvePrefetchOptions( const cache = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "cache", .no_embedded_nulls), cache_src); const cache_val = try sema.resolveConstDefinedValue(block, cache_src, cache, .{ .simple = .prefetch_options }); - return std.builtin.PrefetchOptions{ - .rw = try sema.interpretStdLangType(block, rw_src, rw_val, std.builtin.PrefetchOptions.Rw), + return std.lang.PrefetchOptions{ + .rw = try sema.interpretStdLangType(block, rw_src, rw_val, std.lang.PrefetchOptions.Rw), .locality = @intCast(locality_val.toUnsignedInt(zcu)), - .cache = try sema.interpretStdLangType(block, cache_src, cache_val, std.builtin.PrefetchOptions.Cache), + .cache = try sema.interpretStdLangType(block, cache_src, cache_val, std.lang.PrefetchOptions.Cache), }; } @@ -24465,12 +24465,12 @@ fn resolveExternOptions( ) CompileError!struct { name: InternPool.NullTerminatedString, library_name: InternPool.OptionalNullTerminatedString, - linkage: std.builtin.GlobalLinkage, - visibility: std.builtin.SymbolVisibility, + linkage: std.lang.GlobalLinkage, + visibility: std.lang.SymbolVisibility, is_thread_local: bool, is_dll_import: bool, - relocation: std.builtin.ExternOptions.Relocation, - decoration: ?std.builtin.ExternOptions.Decoration, + relocation: std.lang.ExternOptions.Relocation, + decoration: ?std.lang.ExternOptions.Decoration, } { const pt = sema.pt; const zcu = pt.zcu; @@ -24500,11 +24500,11 @@ fn resolveExternOptions( const linkage_ref = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "linkage", .no_embedded_nulls), linkage_src); const linkage_val = try sema.resolveConstDefinedValue(block, linkage_src, linkage_ref, .{ .simple = .extern_options }); - const linkage = try sema.interpretStdLangType(block, linkage_src, linkage_val, std.builtin.GlobalLinkage); + const linkage = try sema.interpretStdLangType(block, linkage_src, linkage_val, std.lang.GlobalLinkage); const visibility_ref = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "visibility", .no_embedded_nulls), visibility_src); const visibility_val = try sema.resolveConstDefinedValue(block, visibility_src, visibility_ref, .{ .simple = .extern_options }); - const visibility = try sema.interpretStdLangType(block, visibility_src, visibility_val, std.builtin.SymbolVisibility); + const visibility = try sema.interpretStdLangType(block, visibility_src, visibility_val, std.lang.SymbolVisibility); const is_thread_local = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "is_thread_local", .no_embedded_nulls), thread_local_src); const is_thread_local_val = try sema.resolveConstDefinedValue(block, thread_local_src, is_thread_local, .{ .simple = .extern_options }); @@ -24523,11 +24523,11 @@ fn resolveExternOptions( const relocation_ref = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "relocation", .no_embedded_nulls), relocation_src); const relocation_val = try sema.resolveConstDefinedValue(block, relocation_src, relocation_ref, .{ .simple = .extern_options }); - const relocation = try sema.interpretStdLangType(block, relocation_src, relocation_val, std.builtin.ExternOptions.Relocation); + const relocation = try sema.interpretStdLangType(block, relocation_src, relocation_val, std.lang.ExternOptions.Relocation); const decoration_ref = try sema.fieldVal(block, src, options, try ip.getOrPutString(gpa, io, pt.tid, "decoration", .no_embedded_nulls), decoration_src); const decoration_val = try sema.resolveConstDefinedValue(block, decoration_src, decoration_ref, .{ .simple = .extern_options }); - const decoration = try sema.interpretStdLangType(block, decoration_src, decoration_val, ?std.builtin.ExternOptions.Decoration); + const decoration = try sema.interpretStdLangType(block, decoration_src, decoration_val, ?std.lang.ExternOptions.Decoration); if (name.len == 0) { return sema.fail(block, name_src, "extern symbol name cannot be empty", .{}); @@ -24744,7 +24744,7 @@ fn zirStdLangValue(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstD .calling_convention_inline => { const callconv_ty = try sema.getStdLangType(src, .CallingConvention); return .fromValue(Value.uninterpret( - @as(std.builtin.CallingConvention, .@"inline"), + @as(std.lang.CallingConvention, .@"inline"), callconv_ty, pt, ) catch |err| switch (err) { @@ -24795,7 +24795,7 @@ fn zirBranchHint(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstDat // We only apply the first hint in a branch. // This allows user-provided hints to override implicit cold hints. if (sema.branch_hint == null) { - sema.branch_hint = try sema.interpretStdLangType(block, operand_src, hint_val, std.builtin.BranchHint); + sema.branch_hint = try sema.interpretStdLangType(block, operand_src, hint_val, std.lang.BranchHint); } } @@ -27911,8 +27911,8 @@ const InMemoryCoercionResult = union(enum) { }; const Int = struct { - actual_signedness: std.builtin.Signedness, - wanted_signedness: std.builtin.Signedness, + actual_signedness: std.lang.Signedness, + wanted_signedness: std.lang.Signedness, actual_bits: u16, wanted_bits: u16, }; @@ -27928,18 +27928,18 @@ const InMemoryCoercionResult = union(enum) { }; const Size = struct { - actual: std.builtin.Type.Pointer.Size, - wanted: std.builtin.Type.Pointer.Size, + actual: std.lang.Type.Pointer.Size, + wanted: std.lang.Type.Pointer.Size, }; const AddressSpace = struct { - actual: std.builtin.AddressSpace, - wanted: std.builtin.AddressSpace, + actual: std.lang.AddressSpace, + wanted: std.lang.AddressSpace, }; const CC = struct { - actual: std.builtin.CallingConvention, - wanted: std.builtin.CallingConvention, + actual: std.lang.CallingConvention, + wanted: std.lang.CallingConvention, }; const BitRange = struct { @@ -28209,7 +28209,7 @@ const InMemoryCoercionResult = union(enum) { } }; -fn pointerSizeString(size: std.builtin.Type.Pointer.Size) []const u8 { +fn pointerSizeString(size: std.lang.Type.Pointer.Size) []const u8 { return switch (size) { .one => "single pointer", .many => "many pointer", @@ -28635,10 +28635,10 @@ fn coerceInMemoryAllowedFns( fn callconvCoerceAllowed( target: *const std.Target, - src_cc: std.builtin.CallingConvention, - dest_cc: std.builtin.CallingConvention, + src_cc: std.lang.CallingConvention, + dest_cc: std.lang.CallingConvention, ) bool { - const Tag = std.builtin.CallingConvention.Tag; + const Tag = std.lang.CallingConvention.Tag; if (@as(Tag, src_cc) != @as(Tag, dest_cc)) return false; switch (src_cc) { @@ -28651,26 +28651,26 @@ fn callconvCoerceAllowed( if (dest_stack_align < src_stack_align) return false; } switch (@TypeOf(src_data)) { - void, std.builtin.CallingConvention.CommonOptions => {}, - std.builtin.CallingConvention.X86RegparmOptions => { + void, std.lang.CallingConvention.CommonOptions => {}, + std.lang.CallingConvention.X86RegparmOptions => { if (src_data.register_params != dest_data.register_params) return false; }, - std.builtin.CallingConvention.ArcInterruptOptions => { + std.lang.CallingConvention.ArcInterruptOptions => { if (src_data.type != dest_data.type) return false; }, - std.builtin.CallingConvention.ArmInterruptOptions => { + std.lang.CallingConvention.ArmInterruptOptions => { if (src_data.type != dest_data.type) return false; }, - std.builtin.CallingConvention.MicroblazeInterruptOptions => { + std.lang.CallingConvention.MicroblazeInterruptOptions => { if (src_data.type != dest_data.type) return false; }, - std.builtin.CallingConvention.MipsInterruptOptions => { + std.lang.CallingConvention.MipsInterruptOptions => { if (src_data.mode != dest_data.mode) return false; }, - std.builtin.CallingConvention.RiscvInterruptOptions => { + std.lang.CallingConvention.RiscvInterruptOptions => { if (src_data.mode != dest_data.mode) return false; }, - std.builtin.CallingConvention.ShInterruptOptions => { + std.lang.CallingConvention.ShInterruptOptions => { if (src_data.save != dest_data.save) return false; }, else => comptime unreachable, @@ -31115,7 +31115,7 @@ fn cmpNumeric( const dest_ty = if (dest_float_type) |ft| ft else blk: { const max_bits = @max(lhs_bits, rhs_bits); const casted_bits = std.math.cast(u16, max_bits) orelse return sema.fail(block, src, "{d} exceeds maximum integer bit count", .{max_bits}); - const signedness: std.builtin.Signedness = if (dest_int_is_signed) .signed else .unsigned; + const signedness: std.lang.Signedness = if (dest_int_is_signed) .signed else .unsigned; break :blk try pt.intType(signedness, casted_bits); }; const casted_lhs = try sema.coerce(block, dest_ty, lhs, lhs_src); @@ -33101,7 +33101,7 @@ fn resolveAddressSpace( src: LazySrcLoc, zir_ref: Zir.Inst.Ref, ctx: std.Target.AddressSpaceContext, -) !std.builtin.AddressSpace { +) !std.lang.AddressSpace { const air_ref = sema.resolveInst(zir_ref); return sema.analyzeAsAddressSpace(block, src, air_ref, ctx); } @@ -33112,12 +33112,12 @@ pub fn analyzeAsAddressSpace( src: LazySrcLoc, air_ref: Air.Inst.Ref, ctx: std.Target.AddressSpaceContext, -) !std.builtin.AddressSpace { +) !std.lang.AddressSpace { const pt = sema.pt; const addrspace_ty = try sema.getStdLangType(src, .AddressSpace); const coerced = try sema.coerce(block, addrspace_ty, air_ref, src); const addrspace_val = try sema.resolveConstDefinedValue(block, src, coerced, .{ .simple = .@"addrspace" }); - const address_space = try sema.interpretStdLangType(block, src, addrspace_val, std.builtin.AddressSpace); + const address_space = try sema.interpretStdLangType(block, src, addrspace_val, std.lang.AddressSpace); const target = pt.zcu.getTarget(); if (!target.supportsAddressSpace(address_space, ctx)) { @@ -33833,7 +33833,7 @@ pub fn getStdLangValue(sema: *Sema, src: LazySrcLoc, decl: Zcu.StdLangDecl) Sema pub const NavPtrModifiers = struct { @"align": Alignment, @"linksection": InternPool.OptionalNullTerminatedString, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, }; pub fn resolveNavPtrModifiers( @@ -33872,7 +33872,7 @@ pub fn resolveNavPtrModifiers( break :ls try ip.getOrPutStringOpt(gpa, io, pt.tid, bytes, .no_embedded_nulls); }; - const @"addrspace": std.builtin.AddressSpace = as: { + const @"addrspace": std.lang.AddressSpace = as: { const addrspace_ctx: std.Target.AddressSpaceContext = switch (zir_decl.kind) { .@"var" => .variable, else => switch (nav_ty.zigTypeTag(zcu)) { diff --git a/src/Sema/arith.zig b/src/Sema/arith.zig @@ -1191,7 +1191,7 @@ pub fn truncate( val: Value, ty: Type, dest_ty: Type, - dest_signedness: std.builtin.Signedness, + dest_signedness: std.lang.Signedness, dest_bits: u16, ) CompileError!Value { const pt = sema.pt; @@ -1808,7 +1808,7 @@ fn intTruncate( sema: *Sema, val: Value, dest_ty: Type, - dest_signedness: std.builtin.Signedness, + dest_signedness: std.lang.Signedness, dest_bits: u16, ) !Value { const pt = sema.pt; diff --git a/src/Type.zig b/src/Type.zig @@ -19,7 +19,7 @@ const Type = @This(); ip_index: InternPool.Index, -pub fn zigTypeTag(ty: Type, zcu: *const Zcu) std.builtin.TypeId { +pub fn zigTypeTag(ty: Type, zcu: *const Zcu) std.lang.TypeId { return zcu.intern_pool.zigTypeTag(ty.toIntern()); } @@ -903,7 +903,7 @@ pub fn ptrAlignment(ptr_ty: Type, zcu: *Zcu) Alignment { return Type.fromInterned(ptr_key.child).abiAlignment(zcu); } -pub fn ptrAddressSpace(ty: Type, zcu: *const Zcu) std.builtin.AddressSpace { +pub fn ptrAddressSpace(ty: Type, zcu: *const Zcu) std.lang.AddressSpace { return switch (zcu.intern_pool.indexToKey(ty.toIntern())) { .ptr_type => |ptr_type| ptr_type.flags.address_space, .opt_type => |child| zcu.intern_pool.indexToKey(child).ptr_type.flags.address_space, @@ -1337,12 +1337,12 @@ pub fn isSinglePointer(ty: Type, zcu: *const Zcu) bool { } /// Asserts `ty` is a pointer. -pub fn ptrSize(ty: Type, zcu: *const Zcu) std.builtin.Type.Pointer.Size { +pub fn ptrSize(ty: Type, zcu: *const Zcu) std.lang.Type.Pointer.Size { return ty.ptrSizeOrNull(zcu).?; } /// Returns `null` if `ty` is not a pointer. -pub fn ptrSizeOrNull(ty: Type, zcu: *const Zcu) ?std.builtin.Type.Pointer.Size { +pub fn ptrSizeOrNull(ty: Type, zcu: *const Zcu) ?std.lang.Type.Pointer.Size { return switch (zcu.intern_pool.indexToKey(ty.toIntern())) { .ptr_type => |ptr_info| ptr_info.flags.size, else => null, @@ -1627,7 +1627,7 @@ pub fn unionGetLayout(ty: Type, zcu: *const Zcu) Zcu.UnionLayout { return Type.getUnionLayout(union_obj, zcu); } -pub fn containerLayout(ty: Type, zcu: *const Zcu) std.builtin.Type.ContainerLayout { +pub fn containerLayout(ty: Type, zcu: *const Zcu) std.lang.Type.ContainerLayout { const ip = &zcu.intern_pool; return switch (ip.indexToKey(ty.toIntern())) { .tuple_type => .auto, @@ -1949,7 +1949,7 @@ pub fn fnReturnType(ty: Type, zcu: *const Zcu) Type { } /// Asserts the type is a function. -pub fn fnCallingConvention(ty: Type, zcu: *const Zcu) std.builtin.CallingConvention { +pub fn fnCallingConvention(ty: Type, zcu: *const Zcu) std.lang.CallingConvention { return zcu.intern_pool.indexToKey(ty.toIntern()).func_type.cc; } @@ -2477,7 +2477,7 @@ pub fn explicitFieldAlignment(ty: Type, index: usize, zcu: *const Zcu) Alignment /// Asserts that the layout of `field_ty` is resolved. Asserts that `layout` is not `.@"packed"`. pub fn defaultStructFieldAlignment( field_ty: Type, - layout: std.builtin.Type.ContainerLayout, + layout: std.lang.Type.ContainerLayout, zcu: *const Zcu, ) Alignment { const overalign_big_int = switch (layout) { @@ -3227,7 +3227,7 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool .optional => ty.isPtrLikeOptional(zcu), }; } -fn validateExternCallconv(cc: std.builtin.CallingConvention) bool { +fn validateExternCallconv(cc: std.lang.CallingConvention) bool { return switch (cc) { // For now we want to authorize PTX kernel to use zig objects, even if we end up exposing the ABI. // The goal is to experiment with more integrated CPU/GPU code. diff --git a/src/Value.zig b/src/Value.zig @@ -1845,7 +1845,7 @@ pub fn ptrElem(orig_parent_ptr: Value, field_idx: u64, pt: Zcu.PerThread) !Value } })); } -fn canonicalizeBasePtr(base_ptr: Value, want_size: std.builtin.Type.Pointer.Size, want_child: Type, pt: Zcu.PerThread) !Value { +fn canonicalizeBasePtr(base_ptr: Value, want_size: std.lang.Type.Pointer.Size, want_child: Type, pt: Zcu.PerThread) !Value { const ptr_ty = base_ptr.typeOf(pt.zcu); const ptr_info = ptr_ty.ptrInfo(pt.zcu); diff --git a/src/Zcu.zig b/src/Zcu.zig @@ -744,9 +744,9 @@ pub const Export = struct { pub const Options = struct { name: InternPool.NullTerminatedString, - linkage: std.builtin.GlobalLinkage = .strong, + linkage: std.lang.GlobalLinkage = .strong, section: InternPool.OptionalNullTerminatedString = .none, - visibility: std.builtin.SymbolVisibility = .default, + visibility: std.lang.SymbolVisibility = .default, }; /// Index into `all_exports`. @@ -4524,10 +4524,10 @@ fn formatDependee(data: FormatDependee, writer: *Io.Writer) Io.Writer.Error!void } } -pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enum) { +pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum) { ok, bad_arch: []const std.Target.Cpu.Arch, // value is allowed archs for cc - bad_backend: std.builtin.CompilerBackend, // value is current backend + bad_backend: std.lang.CompilerBackend, // value is current backend } { const target = zcu.getTarget(); const backend = target_util.zigBackend(target, zcu.comp.config.use_llvm); diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig @@ -3965,7 +3965,7 @@ pub fn getCoerced(pt: Zcu.PerThread, val: Value, new_ty: Type) Allocator.Error!V return .fromInterned(try ip.getCoerced(gpa, io, pt.tid, val.toIntern(), new_ty.toIntern())); } -pub fn intType(pt: Zcu.PerThread, signedness: std.builtin.Signedness, bits: u16) Allocator.Error!Type { +pub fn intType(pt: Zcu.PerThread, signedness: std.lang.Signedness, bits: u16) Allocator.Error!Type { return Type.fromInterned(try pt.intern(.{ .int_type = .{ .signedness = signedness, .bits = bits, diff --git a/src/codegen.zig b/src/codegen.zig @@ -29,7 +29,7 @@ pub const CodeGenError = GenerateSymbolError || error{ CodegenFail, }; -fn devFeatureForBackend(backend: std.builtin.CompilerBackend) dev.Feature { +fn devFeatureForBackend(backend: std.lang.CompilerBackend) dev.Feature { return switch (backend) { .other, .stage1 => unreachable, .stage2_aarch64 => .aarch64_backend, @@ -47,7 +47,7 @@ fn devFeatureForBackend(backend: std.builtin.CompilerBackend) dev.Feature { }; } -fn importBackend(comptime backend: std.builtin.CompilerBackend) type { +fn importBackend(comptime backend: std.lang.CompilerBackend) type { return switch (backend) { .other, .stage1 => unreachable, .stage2_aarch64 => aarch64, @@ -105,7 +105,7 @@ pub const AnyMir = union { wasm: if (dev.env.supports(.wasm_backend)) @import("codegen/wasm/Mir.zig") else noreturn, c: if (dev.env.supports(.c_backend)) @import("codegen/c.zig").Mir else noreturn, - pub inline fn tag(comptime backend: std.builtin.CompilerBackend) []const u8 { + pub inline fn tag(comptime backend: std.lang.CompilerBackend) []const u8 { return switch (backend) { .stage2_aarch64 => "aarch64", .stage2_riscv64 => "riscv64", diff --git a/src/codegen/aarch64/Assemble.zig b/src/codegen/aarch64/Assemble.zig @@ -307,7 +307,7 @@ const SymbolSpec = union(enum) { }, systemreg, imm: struct { - type: std.builtin.Type.Int, + type: std.lang.Type.Int, multiple_of: ?comptime_int = null, min_valid: ?comptime_int = null, max_valid: ?comptime_int = null, diff --git a/src/codegen/aarch64/Select.zig b/src/codegen/aarch64/Select.zig @@ -2887,7 +2887,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, const bin_op = air.data(air.inst_index).bin_op; const ty = isel.air.typeOf(bin_op.lhs, ip); - const int_info: std.builtin.Type.Int = if (ty.toIntern() == .bool_type) + const int_info: std.lang.Type.Int = if (ty.toIntern() == .bool_type) .{ .signedness = .unsigned, .bits = 1 } else if (ty.isAbiInt(zcu)) ty.intInfo(zcu) @@ -3144,7 +3144,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, const ty_op = air.data(air.inst_index).ty_op; const ty = ty_op.ty.toType(); - const int_info: std.builtin.Type.Int = int_info: { + const int_info: std.lang.Type.Int = int_info: { if (ty_op.ty == .bool_type) break :int_info .{ .signedness = .unsigned, .bits = 1 }; if (!ty.isAbiInt(zcu)) return isel.fail("bad {t} {f}", .{ air_tag, isel.fmtType(ty) }); break :int_info ty.intInfo(zcu); @@ -3199,7 +3199,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, const src_tag = src_ty.zigTypeTag(zcu); if (dst_ty.isAbiInt(zcu) and (src_tag == .bool or src_ty.isAbiInt(zcu))) { const dst_int_info = dst_ty.intInfo(zcu); - const src_int_info: std.builtin.Type.Int = if (src_tag == .bool) .{ .signedness = undefined, .bits = 1 } else src_ty.intInfo(zcu); + const src_int_info: std.lang.Type.Int = if (src_tag == .bool) .{ .signedness = undefined, .bits = 1 } else src_ty.intInfo(zcu); assert(dst_int_info.bits == src_int_info.bits); if (dst_tag != .@"struct" and src_tag != .@"struct" and src_tag != .bool and dst_int_info.signedness == src_int_info.signedness) { try dst_vi.value.move(isel, ty_op.operand); @@ -4517,7 +4517,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, .switch_br => { const switch_br = isel.air.unwrapSwitch(air.inst_index); const cond_ty = isel.air.typeOf(switch_br.operand, ip); - const cond_int_info: std.builtin.Type.Int = if (cond_ty.toIntern() == .bool_type) + const cond_int_info: std.lang.Type.Int = if (cond_ty.toIntern() == .bool_type) .{ .signedness = .unsigned, .bits = 1 } else if (cond_ty.isAbiInt(zcu)) cond_ty.intInfo(zcu) @@ -8229,7 +8229,7 @@ fn elemPtr( fn clzLimb( isel: *Select, res_ra: Register.Alias, - src_int_info: std.builtin.Type.Int, + src_int_info: std.lang.Type.Int, src_ra: Register.Alias, ) !void { switch (src_int_info.bits) { @@ -8274,7 +8274,7 @@ fn clzLimb( fn ctzLimb( isel: *Select, res_ra: Register.Alias, - src_int_info: std.builtin.Type.Int, + src_int_info: std.lang.Type.Int, src_ra: Register.Alias, ) !void { switch (src_int_info.bits) { @@ -8319,7 +8319,7 @@ fn cmp( var lhs_vi = orig_lhs_vi; var rhs_vi = orig_rhs_vi; if (!ty.isRuntimeFloat()) { - const int_info: std.builtin.Type.Int = if (ty.toIntern() == .bool_type) + const int_info: std.lang.Type.Int = if (ty.toIntern() == .bool_type) .{ .signedness = .unsigned, .bits = 1 } else if (ty.isAbiInt(isel.pt.zcu)) ty.intInfo(isel.pt.zcu) @@ -8523,7 +8523,7 @@ fn loadReg( isel: *Select, ra: Register.Alias, size: u64, - signedness: std.builtin.Signedness, + signedness: std.lang.Signedness, base_ra: Register.Alias, offset: i65, ) !void { @@ -8908,7 +8908,7 @@ pub const Value = struct { }, small: struct { size: u5, - signedness: std.builtin.Signedness, + signedness: std.lang.Signedness, is_vector: bool, hint: Register.Alias, register: Register.Alias, @@ -9037,13 +9037,13 @@ pub const Value = struct { }; } - fn setSignedness(vi: Value.Index, isel: *Select, new_signedness: std.builtin.Signedness) void { + fn setSignedness(vi: Value.Index, isel: *Select, new_signedness: std.lang.Signedness) void { const value = vi.get(isel); assert(value.location_payload.small.size <= 2); value.location_payload.small.signedness = new_signedness; } - pub fn signedness(vi: Value.Index, isel: *Select) std.builtin.Signedness { + pub fn signedness(vi: Value.Index, isel: *Select) std.lang.Signedness { const value = vi.get(isel); return switch (value.flags.location_tag) { .large => .unsigned, @@ -9505,7 +9505,7 @@ pub const Value = struct { offset: u64 = 0, @"volatile": bool = false, split: bool = true, - wrap: ?std.builtin.Type.Int = null, + wrap: ?std.lang.Type.Int = null, expected_live_registers: *const LiveRegisters = &.initFill(.free), }; @@ -9717,7 +9717,7 @@ pub const Value = struct { root_ty: ZigType, opts: struct { root_vi: Value.Index = .free, - wrap: ?std.builtin.Type.Int = null, + wrap: ?std.lang.Type.Int = null, expected_live_registers: *const LiveRegisters = &.initFill(.free), }, ) !?void { @@ -10289,7 +10289,7 @@ pub const Value = struct { const payload_ty: ZigType = .fromInterned(error_union_type.payload_type); const error_set_offset = codegen.errUnionErrorOffset(payload_ty, zcu); const payload_offset = codegen.errUnionPayloadOffset(payload_ty, zcu); - const Part = struct { offset: u64, size: u64, signedness: ?std.builtin.Signedness, is_vector: bool }; + const Part = struct { offset: u64, size: u64, signedness: ?std.lang.Signedness, is_vector: bool }; var parts: [2]Part = undefined; var parts_len: Value.PartsLen = 0; var field_end: u64 = 0; @@ -10393,7 +10393,7 @@ pub const Value = struct { (std.math.divCeil(u64, size, @as(u64, 1) << min_part_log2_stride) catch unreachable) > Value.max_parts) return isel.fail("Value.FieldPartIterator.next({f})", .{isel.fmtType(ty)}); const alignment = vi.alignment(isel); - const Part = struct { offset: u64, size: u64, signedness: ?std.builtin.Signedness, is_vector: bool }; + const Part = struct { offset: u64, size: u64, signedness: ?std.lang.Signedness, is_vector: bool }; var parts: [Value.max_parts]Part = undefined; var parts_len: Value.PartsLen = 0; var field_end: u64 = 0; @@ -10512,7 +10512,7 @@ pub const Value = struct { const alignment = vi.alignment(isel); const tag_offset = union_layout.tagOffset(); const payload_offset = union_layout.payloadOffset(); - const Part = struct { offset: u64, size: u64, signedness: ?std.builtin.Signedness }; + const Part = struct { offset: u64, size: u64, signedness: ?std.lang.Signedness }; var parts: [2]Part = undefined; var parts_len: Value.PartsLen = 0; var field_end: u64 = 0; diff --git a/src/codegen/aarch64/encoding.zig b/src/codegen/aarch64/encoding.zig @@ -6755,7 +6755,7 @@ pub const Instruction = packed union { o0: AddSubtractOp = .add, Rm: Register.Encoded, op21: u2 = 0b01, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded24: u5 = 0b11011, op54: u2 = 0b00, sf: Register.GeneralSize = .doubleword, @@ -6769,7 +6769,7 @@ pub const Instruction = packed union { o0: AddSubtractOp = .sub, Rm: Register.Encoded, op21: u2 = 0b01, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded24: u5 = 0b11011, op54: u2 = 0b00, sf: Register.GeneralSize = .doubleword, @@ -6783,7 +6783,7 @@ pub const Instruction = packed union { o0: AddSubtractOp = .add, Rm: Register.Encoded, op21: u2 = 0b10, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded24: u5 = 0b11011, op54: u2 = 0b00, sf: Register.GeneralSize = .doubleword, @@ -6797,7 +6797,7 @@ pub const Instruction = packed union { o0: AddSubtractOp = .add, Rm: Register.Encoded, op21: u2 = 0b01, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded24: u5 = 0b11011, op54: u2 = 0b00, sf: Register.GeneralSize = .doubleword, @@ -6811,7 +6811,7 @@ pub const Instruction = packed union { o0: AddSubtractOp = .sub, Rm: Register.Encoded, op21: u2 = 0b01, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded24: u5 = 0b11011, op54: u2 = 0b00, sf: Register.GeneralSize = .doubleword, @@ -6825,7 +6825,7 @@ pub const Instruction = packed union { o0: AddSubtractOp = .add, Rm: Register.Encoded, op21: u2 = 0b10, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded24: u5 = 0b11011, op54: u2 = 0b00, sf: Register.GeneralSize = .doubleword, @@ -7052,7 +7052,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, a: u1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness, + U: std.lang.Signedness, decoded30: u2 = 0b01, }; @@ -7065,7 +7065,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7078,7 +7078,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7091,7 +7091,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7104,7 +7104,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7117,7 +7117,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7130,7 +7130,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7143,7 +7143,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7156,7 +7156,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7169,7 +7169,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7182,7 +7182,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7195,7 +7195,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7208,7 +7208,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7221,7 +7221,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7234,7 +7234,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7247,7 +7247,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7260,7 +7260,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7273,7 +7273,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7286,7 +7286,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7299,7 +7299,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7312,7 +7312,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7428,7 +7428,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness, + U: std.lang.Signedness, decoded30: u2 = 0b01, }; @@ -7441,7 +7441,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7454,7 +7454,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7467,7 +7467,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7480,7 +7480,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7493,7 +7493,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7506,7 +7506,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7519,7 +7519,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7533,7 +7533,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7547,7 +7547,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7561,7 +7561,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7575,7 +7575,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7589,7 +7589,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7603,7 +7603,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7617,7 +7617,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7631,7 +7631,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7645,7 +7645,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7659,7 +7659,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7673,7 +7673,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -7686,7 +7686,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7699,7 +7699,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7712,7 +7712,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7725,7 +7725,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7738,7 +7738,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7751,7 +7751,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7764,7 +7764,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7778,7 +7778,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7792,7 +7792,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7806,7 +7806,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7820,7 +7820,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7834,7 +7834,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7848,7 +7848,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7862,7 +7862,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7876,7 +7876,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7890,7 +7890,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -7904,7 +7904,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, decoded30: u2 = 0b01, }; @@ -8045,7 +8045,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b11000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness, + U: std.lang.Signedness, decoded30: u2 = 0b01, }; @@ -8058,7 +8058,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b11000, size: Size, decoded24: u5 = 0b11110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, decoded30: u2 = 0b01, }; @@ -8262,7 +8262,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, a: u1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness, + U: std.lang.Signedness, Q: Q, decoded31: u1 = 0b0, }; @@ -8276,7 +8276,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8290,7 +8290,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8304,7 +8304,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8318,7 +8318,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8332,7 +8332,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8346,7 +8346,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8360,7 +8360,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8374,7 +8374,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8388,7 +8388,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8402,7 +8402,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8416,7 +8416,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8430,7 +8430,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8444,7 +8444,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8458,7 +8458,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8472,7 +8472,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8486,7 +8486,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8500,7 +8500,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8514,7 +8514,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8528,7 +8528,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8542,7 +8542,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8556,7 +8556,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8570,7 +8570,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8584,7 +8584,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8598,7 +8598,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8612,7 +8612,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8626,7 +8626,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8640,7 +8640,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8654,7 +8654,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8668,7 +8668,7 @@ pub const Instruction = packed union { decoded17: u6 = 0b111100, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -8814,7 +8814,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness, + U: std.lang.Signedness, Q: Q, decoded31: u1 = 0b0, }; @@ -8828,7 +8828,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8842,7 +8842,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8856,7 +8856,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8870,7 +8870,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8884,7 +8884,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8898,7 +8898,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8912,7 +8912,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8926,7 +8926,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8941,7 +8941,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8956,7 +8956,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8971,7 +8971,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -8986,7 +8986,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9001,7 +9001,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9016,7 +9016,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9031,7 +9031,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9046,7 +9046,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9061,7 +9061,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9076,7 +9076,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9091,7 +9091,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9106,7 +9106,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9121,7 +9121,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9136,7 +9136,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9151,7 +9151,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9165,7 +9165,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9179,7 +9179,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9193,7 +9193,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9207,7 +9207,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9221,7 +9221,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9235,7 +9235,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9249,7 +9249,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9264,7 +9264,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9279,7 +9279,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9294,7 +9294,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9309,7 +9309,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9324,7 +9324,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9339,7 +9339,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9354,7 +9354,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b0, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9368,7 +9368,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b10000, size: Size = .byte, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9383,7 +9383,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9398,7 +9398,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9413,7 +9413,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9428,7 +9428,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9443,7 +9443,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9458,7 +9458,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9473,7 +9473,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9488,7 +9488,7 @@ pub const Instruction = packed union { sz: Sz, o2: u1 = 0b1, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9670,7 +9670,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b11000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness, + U: std.lang.Signedness, Q: Q, decoded31: u1 = 0b0, }; @@ -9684,7 +9684,7 @@ pub const Instruction = packed union { decoded17: u5 = 0b11000, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9726,7 +9726,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness, + U: std.lang.Signedness, Q: Q, decoded31: u1 = 0b0, }; @@ -9741,7 +9741,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9756,7 +9756,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .byte, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9771,7 +9771,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .half, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9786,7 +9786,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .single, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9801,7 +9801,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .double, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .signed, + U: std.lang.Signedness = .signed, Q: Q, decoded31: u1 = 0b0, }; @@ -9816,7 +9816,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .byte, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9831,7 +9831,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .half, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9846,7 +9846,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .single, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; @@ -9861,7 +9861,7 @@ pub const Instruction = packed union { decoded21: u1 = 0b1, size: Size = .double, decoded24: u5 = 0b01110, - U: std.builtin.Signedness = .unsigned, + U: std.lang.Signedness = .unsigned, Q: Q, decoded31: u1 = 0b0, }; diff --git a/src/codegen/c.zig b/src/codegen/c.zig @@ -1997,7 +1997,7 @@ pub const DeclGen = struct { .bits => {}, } - const int_info: std.builtin.Type.Int = if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else .{ + const int_info: std.lang.Type.Int = if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else .{ .signedness = .unsigned, .bits = @intCast(ty.bitSize(zcu)), }; @@ -3878,7 +3878,7 @@ fn airSlice(f: *Function, inst: Air.Inst.Index) !CValue { fn airCall( f: *Function, inst: Air.Inst.Index, - modifier: std.builtin.CallModifier, + modifier: std.lang.CallModifier, ) !CValue { const pt = f.dg.pt; const zcu = pt.zcu; @@ -6911,7 +6911,7 @@ fn airCVaCopy(f: *Function, inst: Air.Inst.Index) !CValue { return local; } -fn toMemoryOrder(order: std.builtin.AtomicOrder) [:0]const u8 { +fn toMemoryOrder(order: std.lang.AtomicOrder) [:0]const u8 { return switch (order) { // Note: unordered is actually even less atomic than relaxed .unordered, .monotonic => "zig_memory_order_relaxed", @@ -6922,11 +6922,11 @@ fn toMemoryOrder(order: std.builtin.AtomicOrder) [:0]const u8 { }; } -fn writeMemoryOrder(w: *Writer, order: std.builtin.AtomicOrder) !void { +fn writeMemoryOrder(w: *Writer, order: std.lang.AtomicOrder) !void { return w.writeAll(toMemoryOrder(order)); } -fn toCallingConvention(cc: std.builtin.CallingConvention, zcu: *Zcu) ?[]const u8 { +fn toCallingConvention(cc: std.lang.CallingConvention, zcu: *Zcu) ?[]const u8 { if (zcu.getTarget().cCallingConvention()) |ccc| { if (cc.eql(ccc)) { return null; @@ -7021,7 +7021,7 @@ fn toCallingConvention(cc: std.builtin.CallingConvention, zcu: *Zcu) ?[]const u8 }; } -fn toAtomicRmwSuffix(order: std.builtin.AtomicRmwOp) []const u8 { +fn toAtomicRmwSuffix(order: std.lang.AtomicRmwOp) []const u8 { return switch (order) { .Xchg => "xchg", .Add => "add", @@ -7044,7 +7044,7 @@ fn toCIntBits(zig_bits: u32) ?u32 { return null; } -fn signAbbrev(signedness: std.builtin.Signedness) u8 { +fn signAbbrev(signedness: std.lang.Signedness) u8 { return switch (signedness) { .signed => 'i', .unsigned => 'u', diff --git a/src/codegen/c/type.zig b/src/codegen/c/type.zig @@ -512,7 +512,7 @@ pub const CType = union(enum) { }, } } - fn classifyBitInt(signedness: std.builtin.Signedness, bits: u16, zcu: *const Zcu) IntClass { + fn classifyBitInt(signedness: std.lang.Signedness, bits: u16, zcu: *const Zcu) IntClass { const is_ez80 = zcu.getTarget().cpu.arch == .ez80; return switch (bits) { 0 => .void, diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig @@ -500,7 +500,7 @@ const CodeModel = enum { large, }; -fn codeModel(model: std.builtin.CodeModel, target: *const std.Target) CodeModel { +fn codeModel(model: std.lang.CodeModel, target: *const std.Target) CodeModel { // Roughly match Clang's mapping of GCC code models to LLVM code models. return switch (model) { .default => .default, @@ -556,7 +556,7 @@ pub const Object = struct { /// Same as `nav_map` but for UAVs (which are always global constants). uav_map: std.AutoHashMapUnmanaged(struct { val: InternPool.Index, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, }, Builder.Variable.Index), /// Maps enum types to their corresponding LLVM functions for implementing the `tag_name` instruction. enum_tag_name_map: std.AutoHashMapUnmanaged(InternPool.Index, Builder.Function.Index), @@ -3986,7 +3986,7 @@ pub const Object = struct { o: *Object, /// Must not be `.none`. @"align": InternPool.Alignment, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, ) Allocator.Error!Builder.Constant { const addr: u64 = @"align".toByteUnits().?; const llvm_usize = try o.lowerType(.usize); @@ -4000,7 +4000,7 @@ pub const Object = struct { uav_val: InternPool.Index, /// Must not be `.none`. @"align": InternPool.Alignment, - @"addrspace": std.builtin.AddressSpace, + @"addrspace": std.lang.AddressSpace, ) Allocator.Error!Builder.Constant { assert(@"align" != .none); @@ -4383,20 +4383,20 @@ const CallingConventionInfo = struct { inreg_param_count: u2 = 0, }; -pub fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: *const std.Target) ?CallingConventionInfo { +pub fn toLlvmCallConv(cc: std.lang.CallingConvention, target: *const std.Target) ?CallingConventionInfo { const llvm_cc = toLlvmCallConvTag(cc, target) orelse return null; const incoming_stack_alignment: ?u64, const register_params: u2 = switch (cc) { inline else => |pl| switch (@TypeOf(pl)) { void => .{ null, 0 }, - std.builtin.CallingConvention.ArcInterruptOptions, - std.builtin.CallingConvention.ArmInterruptOptions, - std.builtin.CallingConvention.RiscvInterruptOptions, - std.builtin.CallingConvention.ShInterruptOptions, - std.builtin.CallingConvention.MicroblazeInterruptOptions, - std.builtin.CallingConvention.MipsInterruptOptions, - std.builtin.CallingConvention.CommonOptions, + std.lang.CallingConvention.ArcInterruptOptions, + std.lang.CallingConvention.ArmInterruptOptions, + std.lang.CallingConvention.RiscvInterruptOptions, + std.lang.CallingConvention.ShInterruptOptions, + std.lang.CallingConvention.MicroblazeInterruptOptions, + std.lang.CallingConvention.MipsInterruptOptions, + std.lang.CallingConvention.CommonOptions, => .{ pl.incoming_stack_alignment, 0 }, - std.builtin.CallingConvention.X86RegparmOptions => .{ pl.incoming_stack_alignment, pl.register_params }, + std.lang.CallingConvention.X86RegparmOptions => .{ pl.incoming_stack_alignment, pl.register_params }, else => @compileError("TODO: toLlvmCallConv" ++ @tagName(pl)), }, }; @@ -4410,7 +4410,7 @@ pub fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: *const std.Targ .inreg_param_count = register_params, }; } -pub fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *const std.Target) ?Builder.CallConv { +pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const std.Target) ?Builder.CallConv { if (target.cCallingConvention()) |default_c| { if (cc_tag == default_c) { return .ccc; @@ -4543,13 +4543,13 @@ pub fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *con } /// Convert a zig-address space to an llvm address space. -pub fn toLlvmAddressSpace(address_space: std.builtin.AddressSpace, target: *const std.Target) Builder.AddrSpace { +pub fn toLlvmAddressSpace(address_space: std.lang.AddressSpace, target: *const std.Target) Builder.AddrSpace { for (llvmAddrSpaceInfo(target)) |info| if (info.zig == address_space) return info.llvm; unreachable; } const AddrSpaceInfo = struct { - zig: ?std.builtin.AddressSpace, + zig: ?std.lang.AddressSpace, llvm: Builder.AddrSpace, non_integral: bool = false, size: ?u16 = null, @@ -4643,7 +4643,7 @@ fn llvmDefaultGlobalAddressSpace(target: *const std.Target) Builder.AddrSpace { /// Return the actual address space that a value should be stored in if its a global address space. /// When a value is placed in the resulting address space, it needs to be cast back into wanted_address_space. -fn toLlvmGlobalAddressSpace(wanted_address_space: std.builtin.AddressSpace, target: *const std.Target) Builder.AddrSpace { +fn toLlvmGlobalAddressSpace(wanted_address_space: std.lang.AddressSpace, target: *const std.Target) Builder.AddrSpace { return switch (wanted_address_space) { .generic => llvmDefaultGlobalAddressSpace(target), else => |as| toLlvmAddressSpace(as, target), diff --git a/src/codegen/llvm/FuncGen.zig b/src/codegen/llvm/FuncGen.zig @@ -567,7 +567,7 @@ const CallAttr = enum { AlwaysInline, }; -fn airCall(self: *FuncGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) Allocator.Error!Builder.Value { +fn airCall(self: *FuncGen, inst: Air.Inst.Index, modifier: std.lang.CallModifier) Allocator.Error!Builder.Value { const air_call = self.air.unwrapCall(inst); const args = air_call.args; const o = self.object; @@ -6017,14 +6017,14 @@ fn airPrefetch(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val const o = self.object; const prefetch = self.air.instructions.items(.data)[@intFromEnum(inst)].prefetch; - comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Rw.read) == 0); - comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Rw.write) == 1); + comptime assert(@intFromEnum(std.lang.PrefetchOptions.Rw.read) == 0); + comptime assert(@intFromEnum(std.lang.PrefetchOptions.Rw.write) == 1); comptime assert(prefetch.locality >= 0); comptime assert(prefetch.locality <= 3); - comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Cache.instruction) == 0); - comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Cache.data) == 1); + comptime assert(@intFromEnum(std.lang.PrefetchOptions.Cache.instruction) == 0); + comptime assert(@intFromEnum(std.lang.PrefetchOptions.Cache.data) == 1); // LLVM fails during codegen of instruction cache prefetchs for these architectures. // This is an LLVM bug as the prefetch intrinsic should be a noop if not supported @@ -7106,7 +7106,7 @@ fn lowerSystemVFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.E /// has different ABI than regular integer types, and there is no currently no /// way to determine whether a Zig integer type is meant to represent e.g. `int` /// or `_BitInt(32)`. -pub fn ccAbiPromoteInt(cc: std.builtin.CallingConvention, zcu: *Zcu, ty: Type) ?std.builtin.Signedness { +pub fn ccAbiPromoteInt(cc: std.lang.CallingConvention, zcu: *Zcu, ty: Type) ?std.lang.Signedness { switch (cc) { .auto, .@"inline", .async => return null, else => {}, @@ -7379,7 +7379,7 @@ fn intrinsicsAllowed(scalar_ty: Type, target: *const std.Target) bool { }; } -fn toLlvmAtomicOrdering(atomic_order: std.builtin.AtomicOrder) Builder.AtomicOrdering { +fn toLlvmAtomicOrdering(atomic_order: std.lang.AtomicOrder) Builder.AtomicOrdering { return switch (atomic_order) { .unordered => .unordered, .monotonic => .monotonic, @@ -7391,7 +7391,7 @@ fn toLlvmAtomicOrdering(atomic_order: std.builtin.AtomicOrder) Builder.AtomicOrd } fn toLlvmAtomicRmwBinOp( - op: std.builtin.AtomicRmwOp, + op: std.lang.AtomicRmwOp, is_signed: bool, is_float: bool, ) Builder.Function.Instruction.AtomicRmw.Operation { diff --git a/src/codegen/riscv64/CodeGen.zig b/src/codegen/riscv64/CodeGen.zig @@ -1901,7 +1901,7 @@ fn splitType(func: *Func, ty: Type) ![2]Type { fn truncateRegister(func: *Func, ty: Type, reg: Register) !void { const pt = func.pt; const zcu = pt.zcu; - const int_info = if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else std.builtin.Type.Int{ + const int_info = if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else std.lang.Type.Int{ .signedness = .unsigned, .bits = @intCast(ty.bitSize(zcu)), }; @@ -4788,7 +4788,7 @@ fn airFrameAddress(func: *Func, inst: Air.Inst.Index) !void { return func.finishAir(inst, dst_mcv, .{ .none, .none, .none }); } -fn airCall(func: *Func, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !void { +fn airCall(func: *Func, inst: Air.Inst.Index, modifier: std.lang.CallModifier) !void { if (modifier == .always_tail) return func.fail("TODO implement tail calls for riscv64", .{}); const call = func.air.unwrapCall(inst); const arg_refs = call.args; @@ -7691,7 +7691,7 @@ fn airAtomicLoad(func: *Func, inst: Air.Inst.Index) !void { const pt = func.pt; const zcu = pt.zcu; const atomic_load = func.air.instructions.items(.data)[@intFromEnum(inst)].atomic_load; - const order: std.builtin.AtomicOrder = atomic_load.order; + const order: std.lang.AtomicOrder = atomic_load.order; const ptr_ty = func.typeOf(atomic_load.ptr); const elem_ty = ptr_ty.childType(zcu); @@ -7737,7 +7737,7 @@ fn airAtomicLoad(func: *Func, inst: Air.Inst.Index) !void { return func.finishAir(inst, result_mcv, .{ atomic_load.ptr, .none, .none }); } -fn airAtomicStore(func: *Func, inst: Air.Inst.Index, order: std.builtin.AtomicOrder) !void { +fn airAtomicStore(func: *Func, inst: Air.Inst.Index, order: std.lang.AtomicOrder) !void { const bin_op = func.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; const ptr_ty = func.typeOf(bin_op.lhs); diff --git a/src/codegen/riscv64/Lower.zig b/src/codegen/riscv64/Lower.zig @@ -1,12 +1,12 @@ //! This file contains the functionality for lowering RISC-V MIR to Instructions pt: Zcu.PerThread, -output_mode: std.builtin.OutputMode, -link_mode: std.builtin.LinkMode, +output_mode: std.lang.OutputMode, +link_mode: std.lang.LinkMode, pic: bool, allocator: Allocator, mir: Mir, -cc: std.builtin.CallingConvention, +cc: std.lang.CallingConvention, err_msg: ?*ErrorMsg = null, src_loc: Zcu.LazySrcLoc, result_insts_len: u8 = undefined, diff --git a/src/codegen/sparc64/CodeGen.zig b/src/codegen/sparc64/CodeGen.zig @@ -20,7 +20,7 @@ const Mir = @import("Mir.zig"); const Emit = @import("Emit.zig"); const Type = @import("../../Type.zig"); const CodeGenError = codegen.CodeGenError; -const Endian = std.builtin.Endian; +const Endian = std.lang.Endian; const Alignment = InternPool.Alignment; const build_options = @import("build_options"); @@ -1255,7 +1255,7 @@ fn airByteSwap(self: *Self, inst: Air.Inst.Index) !void { return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); } -fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !void { +fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.lang.CallModifier) !void { if (modifier == .always_tail) return self.fail("TODO implement tail calls for {}", .{self.target.cpu.arch}); const call = self.air.unwrapCall(inst); @@ -4702,7 +4702,7 @@ fn truncRegister( self: *Self, operand_reg: Register, dest_reg: Register, - int_signedness: std.builtin.Signedness, + int_signedness: std.lang.Signedness, int_bits: u16, ) !void { switch (int_bits) { diff --git a/src/codegen/sparc64/Emit.zig b/src/codegen/sparc64/Emit.zig @@ -2,7 +2,7 @@ //! machine code const std = @import("std"); -const Endian = std.builtin.Endian; +const Endian = std.lang.Endian; const assert = std.debug.assert; const link = @import("../../link.zig"); const Zcu = @import("../../Zcu.zig"); diff --git a/src/codegen/spirv/Assembler.zig b/src/codegen/spirv/Assembler.zig @@ -212,7 +212,7 @@ fn processTypeInstruction(ass: *Assembler) !AsmValue { .OpTypeVoid => try module.voidType(), .OpTypeBool => try module.boolType(), .OpTypeInt => blk: { - const signedness: std.builtin.Signedness = switch (operands[2].literal32) { + const signedness: std.lang.Signedness = switch (operands[2].literal32) { 0 => .unsigned, 1 => .signed, else => { @@ -766,7 +766,7 @@ fn parseContextDependentNumber(ass: *Assembler) !void { return ass.fail(tok.start, "cannot parse literal constant", .{}); } -fn parseContextDependentInt(ass: *Assembler, signedness: std.builtin.Signedness, width: u32) !void { +fn parseContextDependentInt(ass: *Assembler, signedness: std.lang.Signedness, width: u32) !void { const gpa = ass.cg.module.gpa; const tok = ass.currentToken(); diff --git a/src/codegen/spirv/CodeGen.zig b/src/codegen/spirv/CodeGen.zig @@ -1,7 +1,7 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const Target = std.Target; -const Signedness = std.builtin.Signedness; +const Signedness = std.lang.Signedness; const assert = std.debug.assert; const log = std.log.scoped(.codegen); @@ -569,7 +569,7 @@ const ArithmeticTypeInfo = struct { /// Null if this type is a scalar, or the length of the vector otherwise. vector_len: ?u32, /// Whether the inner type is signed. Only relevant for integers. - signedness: std.builtin.Signedness, + signedness: std.lang.Signedness, }; fn arithmeticTypeInfo(cg: *CodeGen, ty: Type) ArithmeticTypeInfo { @@ -2251,7 +2251,7 @@ fn buildBinary(cg: *CodeGen, opcode: Opcode, lhs: Temporary, rhs: Temporary) !Te /// or OpIMul and s_mul_hi or u_mul_hi on OpenCL. fn buildWideMul( cg: *CodeGen, - signedness: std.builtin.Signedness, + signedness: std.lang.Signedness, lhs: Temporary, rhs: Temporary, ) !struct { Temporary, Temporary } { @@ -5976,7 +5976,7 @@ fn airAssembly(cg: *CodeGen, inst: Air.Inst.Index) !?Id { return null; } -fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !?Id { +fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.lang.CallModifier) !?Id { _ = modifier; const gpa = cg.module.gpa; diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig @@ -54,8 +54,8 @@ cache: struct { bool_type: ?Id = null, void_type: ?Id = null, opaque_types: std.StringHashMapUnmanaged(Id) = .empty, - int_types: std.AutoHashMapUnmanaged(std.builtin.Type.Int, Id) = .empty, - float_types: std.AutoHashMapUnmanaged(std.builtin.Type.Float, Id) = .empty, + int_types: std.AutoHashMapUnmanaged(std.lang.Type.Int, Id) = .empty, + float_types: std.AutoHashMapUnmanaged(std.lang.Type.Float, Id) = .empty, vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty, array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty, struct_types: std.ArrayHashMapUnmanaged(StructType, Id, StructType.HashContext, true) = .empty, @@ -582,7 +582,7 @@ pub fn backingIntBits(module: *Module, bits: u16) struct { u16, bool } { return .{ std.mem.alignForward(u16, bits, big_int_bits), true }; } -pub fn intType(module: *Module, signedness: std.builtin.Signedness, bits: u16) !Id { +pub fn intType(module: *Module, signedness: std.lang.Signedness, bits: u16) !Id { assert(bits > 0); const target = module.zcu.getTarget(); @@ -918,7 +918,7 @@ pub fn debugString(module: *Module, string: []const u8) !Id { return entry.value_ptr.*; } -pub fn storageClass(module: *Module, as: std.builtin.AddressSpace) spec.StorageClass { +pub fn storageClass(module: *Module, as: std.lang.AddressSpace) spec.StorageClass { const target = module.zcu.getTarget(); return switch (as) { .generic => .function, diff --git a/src/codegen/wasm/CodeGen.zig b/src/codegen/wasm/CodeGen.zig @@ -951,7 +951,7 @@ fn resolveCallingConventionValues( } pub fn firstParamSRet( - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, return_type: Type, zcu: *const Zcu, target: *const std.Target, @@ -970,7 +970,7 @@ pub fn firstParamSRet( /// Lowers a Zig type and its value based on a given calling convention to ensure /// it matches the ABI. -fn lowerArg(cg: *CodeGen, cc: std.builtin.CallingConvention, ty: Type, value: WValue) !void { +fn lowerArg(cg: *CodeGen, cc: std.lang.CallingConvention, ty: Type, value: WValue) !void { if (cc != .wasm_mvp) { return cg.lowerToStack(value); } @@ -1989,7 +1989,7 @@ fn airRetLoad(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { return cg.finishAir(inst, .none, &.{un_op}); } -fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) InnerError!void { +fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.lang.CallModifier) InnerError!void { if (modifier == .always_tail) return cg.fail("TODO implement tail calls for wasm", .{}); const call = cg.air.unwrapCall(inst); const args = call.args; @@ -7268,7 +7268,7 @@ fn airAtomicRmw(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { const ptr = try cg.resolveInst(pl_op.operand); const operand = try cg.resolveInst(extra.operand); const ty = cg.typeOfIndex(inst); - const op: std.builtin.AtomicRmwOp = extra.op(); + const op: std.lang.AtomicRmwOp = extra.op(); if (cg.useAtomicFeature()) { const int_ty: IntType = .fromType(cg, ty); diff --git a/src/codegen/x86_64/CodeGen.zig b/src/codegen/x86_64/CodeGen.zig @@ -173952,7 +173952,7 @@ fn setFrameLoc( offset.* += self.frame_allocs.items(.abi_size)[frame_i]; } -fn computeFrameLayout(self: *CodeGen, cc: std.builtin.CallingConvention.Tag) !FrameLayout { +fn computeFrameLayout(self: *CodeGen, cc: std.lang.CallingConvention.Tag) !FrameLayout { const frame_allocs_len = self.frame_allocs.len; try self.frame_locs.resize(self.gpa, frame_allocs_len); const stack_frame_order = try self.gpa.alloc(FrameIndex, frame_allocs_len - FrameIndex.named_count); @@ -174294,7 +174294,7 @@ pub fn spillEflagsIfOccupied(self: *CodeGen) !void { } } -pub fn spillCallerPreservedRegs(self: *CodeGen, cc: std.builtin.CallingConvention.Tag, ignore_reg: Register) !void { +pub fn spillCallerPreservedRegs(self: *CodeGen, cc: std.lang.CallingConvention.Tag, ignore_reg: Register) !void { switch (cc) { inline .auto, .x86_64_sysv, .x86_64_win => |tag| inline for (comptime abi.getCallerPreservedRegs(tag)) |reg| if (reg != ignore_reg) try self.register_manager.getKnownReg(reg, null), @@ -175917,7 +175917,7 @@ fn genLocalDebugInfo(cg: *CodeGen, air_tag: Air.Inst.Tag, ty: Type, mcv: MCValue }; } -fn airCall(self: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier, opts: CopyOptions) !void { +fn airCall(self: *CodeGen, inst: Air.Inst.Index, modifier: std.lang.CallModifier, opts: CopyOptions) !void { if (modifier == .always_tail) return self.fail("TODO implement tail calls for x86_64", .{}); const call = self.air.unwrapCall(inst); @@ -179498,7 +179498,7 @@ fn airBitCast(self: *CodeGen, inst: Air.Inst.Index) !void { ); var offset = dst_limbs_len * 8; if (offset < abi_size) { - const dst_signedness: std.builtin.Signedness = if (dst_ty.isAbiInt(zcu)) + const dst_signedness: std.lang.Signedness = if (dst_ty.isAbiInt(zcu)) dst_ty.intInfo(zcu).signedness else .unsigned; @@ -179640,8 +179640,8 @@ fn atomicOp( ptr_ty: Type, val_ty: Type, unused: bool, - rmw_op: ?std.builtin.AtomicRmwOp, - order: std.builtin.AtomicOrder, + rmw_op: ?std.lang.AtomicRmwOp, + order: std.lang.AtomicOrder, ) InnerError!MCValue { const pt = self.pt; const zcu = pt.zcu; @@ -179714,7 +179714,7 @@ fn atomicOp( defer self.register_manager.unlockReg(dst_lock); try self.genSetReg(dst_reg, val_ty, val_mcv, .{}); - if (rmw_op == std.builtin.AtomicRmwOp.Sub and mir_tag[1] == .xadd) { + if (rmw_op == std.lang.AtomicRmwOp.Sub and mir_tag[1] == .xadd) { try self.genUnOpMir(.{ ._, .neg }, val_ty, dst_mcv); } try self.asmMemoryRegister(mir_tag, ptr_mem, registerAlias(dst_reg, val_abi_size)); @@ -179898,7 +179898,7 @@ fn atomicOp( }; const val_lo_mem = try val_mem_mcv.mem(self, .{ .size = .qword }); const val_hi_mem = try val_mem_mcv.address().offset(8).deref().mem(self, .{ .size = .qword }); - if (rmw_op != std.builtin.AtomicRmwOp.Xchg) { + if (rmw_op != std.lang.AtomicRmwOp.Xchg) { try self.asmRegisterRegister(.{ ._, .mov }, .rbx, .rax); try self.asmRegisterRegister(.{ ._, .mov }, .rcx, .rdx); } @@ -180033,7 +180033,7 @@ fn airAtomicLoad(self: *CodeGen, inst: Air.Inst.Index) !void { return self.finishAir(inst, result, .{ atomic_load.ptr, .none, .none }); } -fn airAtomicStore(self: *CodeGen, inst: Air.Inst.Index, order: std.builtin.AtomicOrder) !void { +fn airAtomicStore(self: *CodeGen, inst: Air.Inst.Index, order: std.lang.AtomicOrder) !void { const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; const ptr_ty = self.typeOf(bin_op.lhs); @@ -181813,7 +181813,7 @@ fn nonBoolScalarBitSize(cg: *CodeGen, ty: Type) u32 { }; } -fn intInfo(cg: *CodeGen, ty: Type) ?std.builtin.Type.Int { +fn intInfo(cg: *CodeGen, ty: Type) ?std.lang.Type.Int { const zcu = cg.pt.zcu; const ip = &zcu.intern_pool; var ty_index = ty.ip_index; @@ -188528,7 +188528,7 @@ const Select = struct { const ConstSpec = struct { ref: Select.Operand.Ref = .none, - to_signedness: ?std.builtin.Signedness = null, + to_signedness: ?std.lang.Signedness = null, vectorize_to: ?Memory.Size = null, }; @@ -188537,7 +188537,7 @@ const Select = struct { after: u2, at: u2, - fn tag(spec: CallConvRegSpec, cg: *const CodeGen) std.builtin.CallingConvention.Tag { + fn tag(spec: CallConvRegSpec, cg: *const CodeGen) std.lang.CallingConvention.Tag { return switch (spec.cc) { .none => unreachable, .ccc => cg.target.cCallingConvention().?, @@ -188667,11 +188667,11 @@ const Select = struct { .smax_mem, .umin_mem => .bool_false, }) }, else => { - const scalar_info: std.builtin.Type.Int = cg.intInfo(scalar_ty) orelse .{ + const scalar_info: std.lang.Type.Int = cg.intInfo(scalar_ty) orelse .{ .signedness = .signed, .bits = cg.floatBits(scalar_ty).?, }; - const res_scalar_info: std.builtin.Type.Int = .{ + const res_scalar_info: std.lang.Type.Int = .{ .signedness = const_spec.to_signedness orelse scalar_info.signedness, .bits = switch (spec.kind) { else => scalar_info.bits, @@ -188739,7 +188739,7 @@ const Select = struct { .positive = undefined, }; defer allocator.free(big_int.limbs); - const signedness: std.builtin.Signedness = switch (spec.kind) { + const signedness: std.lang.Signedness = switch (spec.kind) { else => unreachable, .slimit_delta_mem => .signed, .umax_delta_mem => .unsigned, diff --git a/src/codegen/x86_64/Lower.zig b/src/codegen/x86_64/Lower.zig @@ -3,7 +3,7 @@ target: *const std.Target, allocator: std.mem.Allocator, mir: Mir, -cc: std.builtin.CallingConvention, +cc: std.lang.CallingConvention, err_msg: ?*Zcu.ErrorMsg = null, src_loc: Zcu.LazySrcLoc, result_insts_len: ResultInstIndex = undefined, diff --git a/src/codegen/x86_64/Mir.zig b/src/codegen/x86_64/Mir.zig @@ -1737,7 +1737,7 @@ pub const Inst = struct { @typeInfo(Tag).@"enum".fields.len != 251) { const cond_src = (struct { - fn src() std.builtin.SourceLocation { + fn src() std.lang.SourceLocation { return @src(); } }).src(); diff --git a/src/codegen/x86_64/abi.zig b/src/codegen/x86_64/abi.zig @@ -478,7 +478,7 @@ pub const Win64 = struct { pub const c_abi_sse_return_regs = sse_avx_regs[0..1]; }; -pub fn getCalleePreservedRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCalleePreservedRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.callee_preserved_regs, .x86_64_sysv => &SysV.callee_preserved_regs, @@ -487,7 +487,7 @@ pub fn getCalleePreservedRegs(cc: std.builtin.CallingConvention.Tag) []const Reg }; } -pub fn getCallerPreservedRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCallerPreservedRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.caller_preserved_regs, .x86_64_sysv => &SysV.caller_preserved_regs, @@ -496,7 +496,7 @@ pub fn getCallerPreservedRegs(cc: std.builtin.CallingConvention.Tag) []const Reg }; } -pub fn getCAbiIntParamRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCAbiIntParamRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.int_param_regs, .x86_64_sysv => &SysV.c_abi_int_param_regs, @@ -505,7 +505,7 @@ pub fn getCAbiIntParamRegs(cc: std.builtin.CallingConvention.Tag) []const Regist }; } -pub fn getCAbiX87ParamRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCAbiX87ParamRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.x87_param_regs, .x86_64_sysv => SysV.c_abi_x87_param_regs, @@ -514,7 +514,7 @@ pub fn getCAbiX87ParamRegs(cc: std.builtin.CallingConvention.Tag) []const Regist }; } -pub fn getCAbiSseParamRegs(cc: std.builtin.CallingConvention.Tag, target: *const std.Target) []const Register { +pub fn getCAbiSseParamRegs(cc: std.lang.CallingConvention.Tag, target: *const std.Target) []const Register { return switch (cc) { .auto => switch (target.cpu.arch) { else => unreachable, @@ -527,7 +527,7 @@ pub fn getCAbiSseParamRegs(cc: std.builtin.CallingConvention.Tag, target: *const }; } -pub fn getCAbiIntReturnRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCAbiIntReturnRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.int_return_regs, .x86_64_sysv => &SysV.c_abi_int_return_regs, @@ -536,7 +536,7 @@ pub fn getCAbiIntReturnRegs(cc: std.builtin.CallingConvention.Tag) []const Regis }; } -pub fn getCAbiX87ReturnRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCAbiX87ReturnRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.x87_return_regs, .x86_64_sysv => SysV.c_abi_x87_return_regs, @@ -545,7 +545,7 @@ pub fn getCAbiX87ReturnRegs(cc: std.builtin.CallingConvention.Tag) []const Regis }; } -pub fn getCAbiSseReturnRegs(cc: std.builtin.CallingConvention.Tag) []const Register { +pub fn getCAbiSseReturnRegs(cc: std.lang.CallingConvention.Tag) []const Register { return switch (cc) { .auto => zigcc.sse_return_regs, .x86_64_sysv => SysV.c_abi_sse_return_regs, @@ -554,7 +554,7 @@ pub fn getCAbiSseReturnRegs(cc: std.builtin.CallingConvention.Tag) []const Regis }; } -pub fn getCAbiLinkerScratchReg(cc: std.builtin.CallingConvention.Tag) Register { +pub fn getCAbiLinkerScratchReg(cc: std.lang.CallingConvention.Tag) Register { return switch (cc) { .auto => zigcc.int_return_regs[zigcc.int_return_regs.len - 1], .x86_64_sysv => SysV.c_abi_int_return_regs[0], diff --git a/src/codegen/x86_64/bits.zig b/src/codegen/x86_64/bits.zig @@ -106,7 +106,7 @@ pub const Condition = enum(u5) { } pub fn fromCompareOperator( - signedness: std.builtin.Signedness, + signedness: std.lang.Signedness, op: std.math.CompareOperator, ) Condition { return switch (signedness) { diff --git a/src/libs/freebsd.zig b/src/libs/freebsd.zig @@ -19,7 +19,7 @@ pub const CrtFile = enum { scrt1_o, }; -pub fn needsCrt0(output_mode: std.builtin.OutputMode) ?CrtFile { +pub fn needsCrt0(output_mode: std.lang.OutputMode) ?CrtFile { // For shared libraries and PIC executables, we should actually link in a variant of crt1 that // is built with `-DSHARED` so that it calls `__cxa_finalize` in an ELF destructor. However, we // currently make no effort to respect `__cxa_finalize` on any other targets, so for now, we're diff --git a/src/libs/glibc.zig b/src/libs/glibc.zig @@ -1277,7 +1277,7 @@ fn buildSharedLib( try comp.updateSubCompilation(sub_compilation, misc_task, prog_node); } -pub fn needsCrt0(output_mode: std.builtin.OutputMode) ?CrtFile { +pub fn needsCrt0(output_mode: std.lang.OutputMode) ?CrtFile { return switch (output_mode) { .Obj, .Lib => null, .Exe => .scrt1_o, diff --git a/src/libs/libcxx.zig b/src/libs/libcxx.zig @@ -324,7 +324,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr const strip = comp.compilerRtStrip(); // See the `-fno-exceptions` logic for WASI. // The old 32-bit x86 variant of SEH doesn't use tables. - const unwind_tables: std.builtin.UnwindTables = + const unwind_tables: std.lang.UnwindTables = if (target.os.tag == .wasi or (target.cpu.arch == .x86 and target.os.tag == .windows)) .none else .async; const config = Compilation.Config.resolve(.{ diff --git a/src/libs/libtsan.zig b/src/libs/libtsan.zig @@ -37,7 +37,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo .watchos => if (target.abi == .simulator) "clang_rt.tsan_watchossim_dynamic" else "clang_rt.tsan_watchos_dynamic", else => "tsan", }; - const link_mode: std.builtin.LinkMode = if (target.os.tag.isDarwin()) .dynamic else .static; + const link_mode: std.lang.LinkMode = if (target.os.tag.isDarwin()) .dynamic else .static; const output_mode = .Lib; const basename = try std.zig.binNameAlloc(arena, .{ .root_name = root_name, @@ -48,7 +48,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo const optimize_mode = comp.compilerRtOptMode(); const strip = comp.compilerRtStrip(); - const unwind_tables: std.builtin.UnwindTables = + const unwind_tables: std.lang.UnwindTables = if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .async; const link_libcpp = target.os.tag.isDarwin(); diff --git a/src/libs/libunwind.zig b/src/libs/libunwind.zig @@ -29,7 +29,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr const io = comp.io; const output_mode = .Lib; const target = &comp.root_mod.resolved_target.result; - const unwind_tables: std.builtin.UnwindTables = + const unwind_tables: std.lang.UnwindTables = if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .async; const config = Compilation.Config.resolve(.{ .output_mode = output_mode, diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig @@ -37,7 +37,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre const target = comp.getTarget(); // The old 32-bit x86 variant of SEH doesn't use tables. - const unwind_tables: std.builtin.UnwindTables = if (target.cpu.arch != .x86) .async else .none; + const unwind_tables: std.lang.UnwindTables = if (target.cpu.arch != .x86) .async else .none; switch (crt_file) { .crt2_o => { diff --git a/src/libs/musl.zig b/src/libs/musl.zig @@ -173,7 +173,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro .libc_so => { const optimize_mode = comp.compilerRtOptMode(); const strip = comp.compilerRtStrip(); - const output_mode: std.builtin.OutputMode = .Lib; + const output_mode: std.lang.OutputMode = .Lib; const config = try Compilation.Config.resolve(.{ .output_mode = output_mode, .link_mode = .dynamic, @@ -290,7 +290,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro } } -pub fn needsCrt0(output_mode: std.builtin.OutputMode, link_mode: std.builtin.LinkMode, pie: bool) ?CrtFile { +pub fn needsCrt0(output_mode: std.lang.OutputMode, link_mode: std.lang.LinkMode, pie: bool) ?CrtFile { return switch (output_mode) { .Obj, .Lib => null, .Exe => switch (link_mode) { diff --git a/src/libs/netbsd.zig b/src/libs/netbsd.zig @@ -19,7 +19,7 @@ pub const CrtFile = enum { scrt0_o, }; -pub fn needsCrt0(output_mode: std.builtin.OutputMode) ?CrtFile { +pub fn needsCrt0(output_mode: std.lang.OutputMode) ?CrtFile { // For shared libraries and PIC executables, we should actually link in a variant of crt1 that // is built with `-DSHARED` so that it calls `__cxa_finalize` in an ELF destructor. However, we // currently make no effort to respect `__cxa_finalize` on any other targets, so for now, we're diff --git a/src/libs/openbsd.zig b/src/libs/openbsd.zig @@ -20,7 +20,7 @@ pub const CrtFile = enum { scrt0_o, }; -pub fn needsCrt0(output_mode: std.builtin.OutputMode) ?CrtFile { +pub fn needsCrt0(output_mode: std.lang.OutputMode) ?CrtFile { // https://github.com/ziglang/zig/issues/23574#issuecomment-2869089897 return switch (output_mode) { .Obj, .Lib => null, diff --git a/src/libs/wasi_libc.zig b/src/libs/wasi_libc.zig @@ -12,14 +12,14 @@ pub const CrtFile = enum { libc_a, }; -pub fn execModelCrtFile(wasi_exec_model: std.builtin.WasiExecModel) CrtFile { +pub fn execModelCrtFile(wasi_exec_model: std.lang.WasiExecModel) CrtFile { return switch (wasi_exec_model) { .reactor => CrtFile.crt1_reactor_o, .command => CrtFile.crt1_command_o, }; } -pub fn execModelCrtFileFullName(wasi_exec_model: std.builtin.WasiExecModel) []const u8 { +pub fn execModelCrtFileFullName(wasi_exec_model: std.lang.WasiExecModel) []const u8 { return switch (execModelCrtFile(wasi_exec_model)) { .crt1_reactor_o => "crt1-reactor.o", .crt1_command_o => "crt1-command.o", diff --git a/src/link.zig b/src/link.zig @@ -1300,8 +1300,8 @@ pub const File = struct { }; pub fn determinePermissions( - output_mode: std.builtin.OutputMode, - link_mode: std.builtin.LinkMode, + output_mode: std.lang.OutputMode, + link_mode: std.lang.LinkMode, ) Io.File.Permissions { // On common systems with a 0o022 umask, 0o777 will still result in a file created // with 0o755 permissions, but it works appropriately if the system is configured @@ -1714,10 +1714,10 @@ pub const UnresolvedInput = union(enum) { must_link: bool = false, hidden: bool = false, allow_so_scripts: bool = false, - preferred_mode: std.builtin.LinkMode, + preferred_mode: std.lang.LinkMode, search_strategy: SearchStrategy, - fn fallbackMode(q: Query) std.builtin.LinkMode { + fn fallbackMode(q: Query) std.lang.LinkMode { assert(q.search_strategy != .no_fallback); return switch (q.preferred_mode) { .dynamic => .static, @@ -1843,7 +1843,7 @@ pub fn resolveInputs( name: []const u8, strategy: UnresolvedInput.SearchStrategy, checked_paths: []const u8, - preferred_mode: std.builtin.LinkMode, + preferred_mode: std.lang.LinkMode, }) = .empty; // Convert external system libs into a stack so that items can be @@ -2077,7 +2077,7 @@ fn resolveLibInput( lib_directory: Directory, name_query: UnresolvedInput.NameQuery, target: *const std.Target, - link_mode: std.builtin.LinkMode, + link_mode: std.lang.LinkMode, color: std.zig.Color, ) Allocator.Error!ResolveLibInputResult { try resolved_inputs.ensureUnusedCapacity(gpa, 1); @@ -2161,7 +2161,7 @@ fn finishResolveLibInput( resolved_inputs: *std.ArrayList(Input), path: Path, file: Io.File, - link_mode: std.builtin.LinkMode, + link_mode: std.lang.LinkMode, query: UnresolvedInput.Query, ) ResolveLibInputResult { switch (link_mode) { @@ -2237,7 +2237,7 @@ fn resolvePathInputLib( ld_script_bytes: *std.ArrayList(u8), target: *const std.Target, pq: UnresolvedInput.PathQuery, - link_mode: std.builtin.LinkMode, + link_mode: std.lang.LinkMode, color: std.zig.Color, ) Allocator.Error!ResolveLibInputResult { try resolved_inputs.ensureUnusedCapacity(gpa, 1); diff --git a/src/link/Coff.zig b/src/link/Coff.zig @@ -1091,7 +1091,7 @@ fn computeNodeSectionOffset(coff: *Coff, ni: MappedFile.Node.Index) u32 { } } -pub inline fn targetEndian(_: *const Coff) std.builtin.Endian { +pub inline fn targetEndian(_: *const Coff) std.lang.Endian { return .little; } fn targetLoad(coff: *const Coff, ptr: anytype) @typeInfo(@TypeOf(ptr)).pointer.child { diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig @@ -22,7 +22,7 @@ const target_info = @import("../target.zig"); gpa: Allocator, bin_file: *link.File, format: DW.Format, -endian: std.builtin.Endian, +endian: std.lang.Endian, address_size: AddressSize, const_pool: link.ConstPool, @@ -1963,7 +1963,7 @@ pub const WipNav = struct { fn writer(counter: *ExprLocCounter) *Writer { return &counter.dw.writer; } - fn endian(_: ExprLocCounter) std.builtin.Endian { + fn endian(_: ExprLocCounter) std.lang.Endian { return @import("builtin").cpu.arch.endian(); } fn addrSym(counter: *ExprLocCounter, _: u32) Writer.Error!void { @@ -1984,7 +1984,7 @@ pub const WipNav = struct { fn writer(ctx: @This()) *Writer { return &ctx.wip_nav.debug_info.writer; } - fn endian(ctx: @This()) std.builtin.Endian { + fn endian(ctx: @This()) std.lang.Endian { return ctx.wip_nav.dwarf.endian; } fn addrSym(ctx: @This(), sym_index: u32) (UpdateError || Writer.Error)!void { @@ -2026,7 +2026,7 @@ pub const WipNav = struct { fn writer(ctx: @This()) *Writer { return &ctx.wip_nav.debug_frame.writer; } - fn endian(ctx: @This()) std.builtin.Endian { + fn endian(ctx: @This()) std.lang.Endian { return ctx.wip_nav.dwarf.endian; } fn addrSym(ctx: @This(), sym_index: u32) (UpdateError || Writer.Error)!void { @@ -4164,7 +4164,7 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co try wip_nav.strpFmt("{f}", .{val.toType().fmt(pt)}); const cc: DW.CC = cc: { if (zcu.getTarget().cCallingConvention()) |cc| { - if (@as(std.builtin.CallingConvention.Tag, cc) == func_type.cc) { + if (@as(std.lang.CallingConvention.Tag, cc) == func_type.cc) { break :cc .normal; } } diff --git a/src/link/Elf2.zig b/src/link/Elf2.zig @@ -1697,7 +1697,7 @@ pub fn identData(elf: *const Elf) std.elf.DATA { return @enumFromInt(elf.mf.memory_map.memory[std.elf.EI.DATA]); } -pub fn targetEndian(elf: *const Elf) std.builtin.Endian { +pub fn targetEndian(elf: *const Elf) std.lang.Endian { return switch (elf.identData()) { .NONE, _ => unreachable, .@"2LSB" => .little, diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig @@ -3882,7 +3882,7 @@ pub fn flush( fn defaultEntrySymbolName( preloaded_strings: *const PreloadedStrings, - wasi_exec_model: std.builtin.WasiExecModel, + wasi_exec_model: std.lang.WasiExecModel, ) String { return switch (wasi_exec_model) { .reactor => preloaded_strings._initialize, @@ -3962,7 +3962,7 @@ pub fn getExistingFuncType2(wasm: *const Wasm, params: []const std.wasm.Valtype, pub fn internFunctionType( wasm: *Wasm, - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, params: []const InternPool.Index, return_type: Zcu.Type, target: *const std.Target, @@ -3976,7 +3976,7 @@ pub fn internFunctionType( pub fn getExistingFunctionType( wasm: *Wasm, - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, params: []const InternPool.Index, return_type: Zcu.Type, target: *const std.Target, @@ -4210,7 +4210,7 @@ pub fn errorNameTableAddr(wasm: *Wasm) u32 { fn convertZcuFnType( comp: *Compilation, - cc: std.builtin.CallingConvention, + cc: std.lang.CallingConvention, params: []const InternPool.Index, return_type: Zcu.Type, target: *const std.Target, diff --git a/src/main.zig b/src/main.zig @@ -766,7 +766,7 @@ const Emit = union(enum) { }; const ArgMode = union(enum) { - build: std.builtin.OutputMode, + build: std.lang.OutputMode, cc, cpp, translate_c, @@ -935,13 +935,13 @@ fn buildOutputType( var minor_subsystem_version: ?u16 = null; var mingw_unicode_entry_point: bool = false; var enable_link_snapshots: bool = false; - var debug_compiler_runtime_libs: ?std.builtin.OptimizeMode = null; + var debug_compiler_runtime_libs: ?std.lang.OptimizeMode = null; var install_name: ?[]const u8 = null; var hash_style: link.File.Lld.Elf.HashStyle = .both; var entitlements: ?[]const u8 = null; var pagezero_size: ?u64 = null; var lib_search_strategy: link.UnresolvedInput.SearchStrategy = .paths_first; - var lib_preferred_mode: std.builtin.LinkMode = .dynamic; + var lib_preferred_mode: std.lang.LinkMode = .dynamic; var headerpad_size: ?u32 = null; var headerpad_max_install_names: bool = false; var dead_strip_dylibs: bool = false; @@ -5754,7 +5754,7 @@ fn jitCmdInner( const self_exe_path = process.executablePathAlloc(io, arena) catch |err| fatal("unable to find self exe path: {t}", .{err}); - const optimize_mode: std.builtin.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map)) + const optimize_mode: std.lang.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map)) .Debug else .ReleaseFast; @@ -6265,8 +6265,8 @@ pub const ClangArgIterator = struct { } }; -fn parseCodeModel(arg: []const u8) std.builtin.CodeModel { - return std.meta.stringToEnum(std.builtin.CodeModel, arg) orelse +fn parseCodeModel(arg: []const u8) std.lang.CodeModel { + return std.meta.stringToEnum(std.lang.CodeModel, arg) orelse fatal("unsupported machine code model: '{s}'", .{arg}); } @@ -7669,13 +7669,13 @@ fn findTemplates(gpa: Allocator, arena: Allocator, io: Io) Templates { }; } -fn parseOptimizeMode(s: []const u8) std.builtin.OptimizeMode { - return std.meta.stringToEnum(std.builtin.OptimizeMode, s) orelse +fn parseOptimizeMode(s: []const u8) std.lang.OptimizeMode { + return std.meta.stringToEnum(std.lang.OptimizeMode, s) orelse fatal("unrecognized optimization mode: '{s}'", .{s}); } -fn parseWasiExecModel(s: []const u8) std.builtin.WasiExecModel { - return std.meta.stringToEnum(std.builtin.WasiExecModel, s) orelse +fn parseWasiExecModel(s: []const u8) std.lang.WasiExecModel { + return std.meta.stringToEnum(std.lang.WasiExecModel, s) orelse fatal("expected [command|reactor] for -mexec-mode=[value], found '{s}'", .{s}); } diff --git a/src/print_zir.zig b/src/print_zir.zig @@ -1340,7 +1340,7 @@ const Writer = struct { if (extra.data.flags.ensure_result_used) { try stream.writeAll("nodiscard "); } - try stream.print(".{s}, ", .{@tagName(@as(std.builtin.CallModifier, @enumFromInt(extra.data.flags.packed_modifier)))}); + try stream.print(".{s}, ", .{@tagName(@as(std.lang.CallModifier, @enumFromInt(extra.data.flags.packed_modifier)))}); switch (kind) { .direct => try self.writeInstRef(stream, extra.data.callee), .field => { diff --git a/src/target.zig b/src/target.zig @@ -3,7 +3,7 @@ const std = @import("std"); const assert = std.debug.assert; const Type = @import("Type.zig"); -const AddressSpace = std.builtin.AddressSpace; +const AddressSpace = std.lang.AddressSpace; const Alignment = @import("InternPool.zig").Alignment; const Compilation = @import("Compilation.zig"); const Feature = @import("Zcu.zig").Feature; @@ -31,7 +31,7 @@ pub fn canDynamicLink(target: *const std.Target) bool { }; } -pub fn libCNeedsLibUnwind(target: *const std.Target, link_mode: std.builtin.LinkMode) bool { +pub fn libCNeedsLibUnwind(target: *const std.Target, link_mode: std.lang.LinkMode) bool { return target.isGnuLibC() and link_mode == .static; } @@ -119,7 +119,7 @@ pub fn useEmulatedTls(target: *const std.Target) bool { }; } -pub fn hasValgrindSupport(target: *const std.Target, backend: std.builtin.CompilerBackend) bool { +pub fn hasValgrindSupport(target: *const std.Target, backend: std.lang.CompilerBackend) bool { // We can't currently output the necessary Valgrind client request assembly when using the C // backend and compiling with an MSVC-like compiler. const ofmt_c_msvc = (target.abi == .msvc or target.abi == .itanium) and target.ofmt == .c; @@ -265,7 +265,7 @@ pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool { }; } -pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.CompilerBackend) bool { +pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.lang.CompilerBackend) bool { return switch (ofmt) { .elf, .coff => switch (backend) { .stage2_x86_64 => true, @@ -299,7 +299,7 @@ pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { return false; } -pub fn supportsStackProbing(target: *const std.Target, backend: std.builtin.CompilerBackend) bool { +pub fn supportsStackProbing(target: *const std.Target, backend: std.lang.CompilerBackend) bool { return switch (backend) { .stage2_aarch64, .stage2_x86_64 => true, .stage2_llvm => target.os.tag != .windows and target.os.tag != .uefi and @@ -308,7 +308,7 @@ pub fn supportsStackProbing(target: *const std.Target, backend: std.builtin.Comp }; } -pub fn supportsStackProtector(target: *const std.Target, backend: std.builtin.CompilerBackend) bool { +pub fn supportsStackProtector(target: *const std.Target, backend: std.lang.CompilerBackend) bool { switch (target.os.tag) { .plan9 => return false, else => {}, @@ -336,7 +336,7 @@ pub fn libcProvidesStackProtector(target: *const std.Target) bool { /// Returns true if `@returnAddress()` is supported by the target and has a /// reasonably performant implementation for the requested optimization mode. -pub fn supportsReturnAddress(target: *const std.Target, optimize: std.builtin.OptimizeMode) bool { +pub fn supportsReturnAddress(target: *const std.Target, optimize: std.lang.OptimizeMode) bool { return switch (target.cpu.arch) { // Emscripten currently implements `emscripten_return_address()` by calling // out into JavaScript and parsing a stack trace, which introduces significant @@ -396,7 +396,7 @@ pub fn hasDebugInfo(target: *const std.Target) bool { }; } -pub fn defaultCompilerRtOptimizeMode(target: *const std.Target) std.builtin.OptimizeMode { +pub fn defaultCompilerRtOptimizeMode(target: *const std.Target) std.lang.OptimizeMode { if (target.cpu.arch.isWasm() and target.os.tag == .freestanding) { return .ReleaseSmall; } else { @@ -437,7 +437,7 @@ pub fn canBuildLibUbsanRt(target: *const std.Target) enum { no, yes, llvm_only, /// Whether libzigc can fill-in the gaps of an existing libc /// or *is* the libc of the target. -pub fn wantsZigC(target: *const std.Target, link_mode: std.builtin.LinkMode) bool { +pub fn wantsZigC(target: *const std.Target, link_mode: std.lang.LinkMode) bool { return (target.isMuslLibC() and link_mode == .static) or target.isWasiLibC() or target.isMinGW(); } @@ -547,7 +547,7 @@ pub fn clangSupportsNoImplicitFloatArg(target: *const std.Target) bool { }; } -pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: bool) std.builtin.UnwindTables { +pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: bool) std.lang.UnwindTables { if (target.os.tag == .windows) { // The old 32-bit x86 variant of SEH doesn't use tables. return if (target.cpu.arch != .x86) .async else .none; @@ -824,7 +824,7 @@ pub fn functionPointerMask(target: *const std.Target) ?u64 { null; } -pub fn supportsTailCall(target: *const std.Target, backend: std.builtin.CompilerBackend) bool { +pub fn supportsTailCall(target: *const std.Target, backend: std.lang.CompilerBackend) bool { switch (backend) { .stage2_llvm => return @import("codegen/llvm.zig").supportsTailCall(target), .stage2_c => return true, @@ -832,7 +832,7 @@ pub fn supportsTailCall(target: *const std.Target, backend: std.builtin.Compiler } } -pub fn supportsThreads(target: *const std.Target, backend: std.builtin.CompilerBackend) bool { +pub fn supportsThreads(target: *const std.Target, backend: std.lang.CompilerBackend) bool { _ = target; return switch (backend) { .stage2_aarch64 => false, @@ -880,7 +880,7 @@ pub fn compilerRtIntAbbrev(bits: u16) []const u8 { }; } -pub fn fnCallConvAllowsZigTypes(cc: std.builtin.CallingConvention) bool { +pub fn fnCallConvAllowsZigTypes(cc: std.lang.CallingConvention) bool { return switch (cc) { .auto, .async, .@"inline" => true, // For now we want to authorize PTX kernel to use zig objects, even if @@ -891,7 +891,7 @@ pub fn fnCallConvAllowsZigTypes(cc: std.builtin.CallingConvention) bool { }; } -pub fn zigBackend(target: *const std.Target, use_llvm: bool) std.builtin.CompilerBackend { +pub fn zigBackend(target: *const std.Target, use_llvm: bool) std.lang.CompilerBackend { if (use_llvm) return .stage2_llvm; if (target.ofmt == .c) return .stage2_c; return switch (target.cpu.arch) { @@ -908,7 +908,7 @@ pub fn zigBackend(target: *const std.Target, use_llvm: bool) std.builtin.Compile }; } -pub inline fn backendSupportsFeature(backend: std.builtin.CompilerBackend, comptime feature: Feature) bool { +pub inline fn backendSupportsFeature(backend: std.lang.CompilerBackend, comptime feature: Feature) bool { return switch (feature) { .panic_fn => switch (backend) { .stage2_aarch64, diff --git a/src/tracy.zig b/src/tracy.zig @@ -58,7 +58,7 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct { } }; -pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx { +pub inline fn trace(comptime src: std.lang.SourceLocation) Ctx { if (!enable) return .{}; const global = struct { @@ -78,7 +78,7 @@ pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx { } } -pub inline fn traceNamed(comptime src: std.builtin.SourceLocation, comptime name: [:0]const u8) Ctx { +pub inline fn traceNamed(comptime src: std.lang.SourceLocation, comptime name: [:0]const u8) Ctx { if (!enable) return .{}; const global = struct {