aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-10-24 14:57:55 -0400
committerGitHub <noreply@github.com>2023-10-24 14:57:55 -0400
commit22a6a5d93f000afd7e00450bb5a359f39bb598bf (patch)
tree65cae809bfc2edc9eb1642f2ace25313ec3a7193 /src/value.zig
parentd1230842ac882bbd6456081c474658b293aaf20a (diff)
parentf2814caaf04fc041a028d5ede4fb4db5ee2f19ae (diff)
downloadzig-22a6a5d93f000afd7e00450bb5a359f39bb598bf.tar.gz
zig-22a6a5d93f000afd7e00450bb5a359f39bb598bf.zip
Merge pull request #17691 from mlugg/no-interned-runtime-value
Remove `InternPool.Key.runtime_value`, clean up Sema value resolution functions
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/value.zig b/src/value.zig
index 053cf7a768..d9dfd3a257 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -364,7 +364,6 @@ pub const Value = struct {
.inferred_error_set_type,
.undef,
- .runtime_value,
.simple_value,
.variable,
.extern_func,
@@ -464,7 +463,6 @@ pub const Value = struct {
.bool_true => BigIntMutable.init(&space.limbs, 1).toConst(),
.null_value => BigIntMutable.init(&space.limbs, 0).toConst(),
else => switch (mod.intern_pool.indexToKey(val.toIntern())) {
- .runtime_value => |runtime_value| runtime_value.val.toValue().toBigIntAdvanced(space, mod, opt_sema),
.int => |int| switch (int.storage) {
.u64, .i64, .big_int => int.storage.toBigInt(space),
.lazy_align, .lazy_size => |ty| {
@@ -1657,34 +1655,6 @@ pub const Value = struct {
};
}
- pub fn isRuntimeValue(val: Value, mod: *Module) bool {
- return mod.intern_pool.isRuntimeValue(val.toIntern());
- }
-
- /// Returns true if a Value is backed by a variable
- pub fn isVariable(val: Value, mod: *Module) bool {
- return val.ip_index != .none and switch (mod.intern_pool.indexToKey(val.toIntern())) {
- .variable => true,
- .ptr => |ptr| switch (ptr.addr) {
- .decl => |decl_index| {
- const decl = mod.declPtr(decl_index);
- assert(decl.has_tv);
- return decl.val.isVariable(mod);
- },
- .mut_decl => |mut_decl| {
- const decl = mod.declPtr(mut_decl.decl);
- assert(decl.has_tv);
- return decl.val.isVariable(mod);
- },
- .int => false,
- .eu_payload, .opt_payload => |base_ptr| base_ptr.toValue().isVariable(mod),
- .comptime_field => |comptime_field| comptime_field.toValue().isVariable(mod),
- .elem, .field => |base_index| base_index.base.toValue().isVariable(mod),
- },
- else => false,
- };
- }
-
pub fn isPtrToThreadLocal(val: Value, mod: *Module) bool {
const backing_decl = mod.intern_pool.getBackingDecl(val.toIntern()).unwrap() orelse return false;
const variable = mod.declPtr(backing_decl).getOwnedVariable(mod) orelse return false;