authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-10-24 04:43:09+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-10-24 14:28:33+01:00
log7882bdcb7e1b012ff388c4abe0b57aa048bb2ce3
tree08d26fac16f7285e98bf403f178a54fd7047865e
parent20bb81166f36668413703e0d74b3e283c55ab8ca
signaturelock-open Commit is signed but in an unrecognized format.

Value: remove unused function


1 files changed, 0 insertions(+), 24 deletions(-)

src/value.zig-24
...@@ -1655,30 +1655,6 @@ pub const Value = struct {...@@ -1655,30 +1655,6 @@ pub const Value = struct {
1655 };1655 };
1656 }1656 }
16571657
1658 /// Returns true if a Value is backed by a variable
1659 pub fn isVariable(val: Value, mod: *Module) bool {
1660 return val.ip_index != .none and switch (mod.intern_pool.indexToKey(val.toIntern())) {
1661 .variable => true,
1662 .ptr => |ptr| switch (ptr.addr) {
1663 .decl => |decl_index| {
1664 const decl = mod.declPtr(decl_index);
1665 assert(decl.has_tv);
1666 return decl.val.isVariable(mod);
1667 },
1668 .mut_decl => |mut_decl| {
1669 const decl = mod.declPtr(mut_decl.decl);
1670 assert(decl.has_tv);
1671 return decl.val.isVariable(mod);
1672 },
1673 .int => false,
1674 .eu_payload, .opt_payload => |base_ptr| base_ptr.toValue().isVariable(mod),
1675 .comptime_field => |comptime_field| comptime_field.toValue().isVariable(mod),
1676 .elem, .field => |base_index| base_index.base.toValue().isVariable(mod),
1677 },
1678 else => false,
1679 };
1680 }
1681
1682 pub fn isPtrToThreadLocal(val: Value, mod: *Module) bool {1658 pub fn isPtrToThreadLocal(val: Value, mod: *Module) bool {
1683 const backing_decl = mod.intern_pool.getBackingDecl(val.toIntern()).unwrap() orelse return false;1659 const backing_decl = mod.intern_pool.getBackingDecl(val.toIntern()).unwrap() orelse return false;
1684 const variable = mod.declPtr(backing_decl).getOwnedVariable(mod) orelse return false;1660 const variable = mod.declPtr(backing_decl).getOwnedVariable(mod) orelse return false;