From 7882bdcb7e1b012ff388c4abe0b57aa048bb2ce3 Mon Sep 17 00:00:00 2001 From: mlugg Date: Tue, 24 Oct 2023 04:43:09 +0100 Subject: Value: remove unused function --- src/value.zig | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/value.zig') 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; -- cgit v1.2.3