diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-05 13:26:58 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:42:28 -0700 |
| commit | ac07ddadeb36019c262b4f28a4fa3884f6f50b32 (patch) | |
| tree | 3dc3f2ea03f2faa5b110001b6dd0d9dff567de0e /src/Sema.zig | |
| parent | 75cf06c187d9d0288c2ea31f34b18c3a7da4bd1d (diff) | |
| download | zig-ac07ddadeb36019c262b4f28a4fa3884f6f50b32.tar.gz zig-ac07ddadeb36019c262b4f28a4fa3884f6f50b32.zip | |
InternPool: enhance integer values
The Key struct now has a Storage tagged union which can store a u64,
i64, or big int.
This is needed so that indexToKey can be implemented for integers stored
compactly in the data structure.
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 3406d0d80f..37d6f3e902 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -1981,7 +1981,7 @@ fn resolveMaybeUndefValAllowVariablesMaybeRuntime( if (air_tags[i] == .constant) { const ty_pl = sema.air_instructions.items(.data)[i].ty_pl; const val = sema.air_values.items[ty_pl.payload]; - if (val.tag() == .variable) return val; + if (val.tagIsVariable()) return val; } return opv; } @@ -5033,7 +5033,7 @@ fn storeToInferredAllocComptime( // There will be only one store_to_inferred_ptr because we are running at comptime. // The alloc will turn into a Decl. if (try sema.resolveMaybeUndefValAllowVariables(operand)) |operand_val| store: { - if (operand_val.tag() == .variable) break :store; + if (operand_val.tagIsVariable()) break :store; var anon_decl = try block.startAnonDecl(); defer anon_decl.deinit(); iac.data.decl_index = try anon_decl.finish( @@ -28125,7 +28125,7 @@ fn beginComptimePtrLoad( const is_mutable = ptr_val.tag() == .decl_ref_mut; const decl = sema.mod.declPtr(decl_index); const decl_tv = try decl.typedValue(); - if (decl_tv.val.tag() == .variable) return error.RuntimeLoad; + if (decl_tv.val.tagIsVariable()) return error.RuntimeLoad; const layout_defined = decl.ty.hasWellDefinedLayout(mod); break :blk ComptimePtrLoadKit{ |
