diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-02-27 11:03:08 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-27 11:03:08 -0800 |
| commit | 6f7354a04151bc0da7f661b46c5b5b3afed96112 (patch) | |
| tree | 78bc876eb5d68f9bde247add51e4e19ecc3a3b2b /src/InternPool.zig | |
| parent | 27f589dea1dae6ec0033e1ad2902fb5dadfa562b (diff) | |
| parent | 97f2a8b5cb4c882e05add16a69c7a55f7fe46794 (diff) | |
| download | zig-6f7354a04151bc0da7f661b46c5b5b3afed96112.tar.gz zig-6f7354a04151bc0da7f661b46c5b5b3afed96112.zip | |
Merge pull request #19102 from ziglang/decouple-zir
JIT `zig fmt` and `zig reduce`
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 46676097bf..5ff179cb74 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -338,7 +338,7 @@ const Hash = std.hash.Wyhash; const InternPool = @This(); const Module = @import("Module.zig"); const Zcu = Module; -const Zir = @import("Zir.zig"); +const Zir = std.zig.Zir; const KeyAdapter = struct { intern_pool: *const InternPool, @@ -383,27 +383,8 @@ pub const RuntimeIndex = enum(u32) { } }; -pub const DeclIndex = enum(u32) { - _, - - pub fn toOptional(i: DeclIndex) OptionalDeclIndex { - return @enumFromInt(@intFromEnum(i)); - } -}; - -pub const OptionalDeclIndex = enum(u32) { - none = std.math.maxInt(u32), - _, - - pub fn init(oi: ?DeclIndex) OptionalDeclIndex { - return @enumFromInt(@intFromEnum(oi orelse return .none)); - } - - pub fn unwrap(oi: OptionalDeclIndex) ?DeclIndex { - if (oi == .none) return null; - return @enumFromInt(@intFromEnum(oi)); - } -}; +pub const DeclIndex = std.zig.DeclIndex; +pub const OptionalDeclIndex = std.zig.OptionalDeclIndex; pub const NamespaceIndex = enum(u32) { _, @@ -2877,7 +2858,7 @@ pub const static_keys = [_]Key{ /// This is specified with an integer literal and a corresponding comptime /// assert below to break an unfortunate and arguably incorrect dependency loop /// when compiling. -pub const static_len = 84; +pub const static_len = Zir.Inst.Index.static_len; comptime { //@compileLog(static_keys.len); assert(static_len == static_keys.len); |
