aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-10-24 04:43:09 +0100
committermlugg <mlugg@mlugg.co.uk>2023-10-24 14:28:33 +0100
commit7882bdcb7e1b012ff388c4abe0b57aa048bb2ce3 (patch)
tree08d26fac16f7285e98bf403f178a54fd7047865e /src/value.zig
parent20bb81166f36668413703e0d74b3e283c55ab8ca (diff)
downloadzig-7882bdcb7e1b012ff388c4abe0b57aa048bb2ce3.tar.gz
zig-7882bdcb7e1b012ff388c4abe0b57aa048bb2ce3.zip
Value: remove unused function
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/value.zig b/src/value.zig
index 08d692beab..d9dfd3a257 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -1655,30 +1655,6 @@ pub const Value = struct {
};
}
- /// 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;