| author | |
| committer | |
| log | d69e324eae6d245a4b0c75c0a8ce91275dfcc938 |
| tree | 2a02dad7932cb4b9ba431680edbf7c83b4694305 |
| parent | ad3e0e4eb4afc3f633f5f8f04affc3e9ff886cb6 |
2 files changed, 5 insertions(+), 1 deletions(-)
src/InternPool.zig+4| ... | ... | @@ -5702,6 +5702,10 @@ pub fn isNoReturn(ip: *const InternPool, ty: Index) bool { |
| 5702 | 5702 | }; |
| 5703 | 5703 | } |
| 5704 | 5704 | |
| 5705 | pub fn isRuntimeValue(ip: *const InternPool, val: Index) bool { | |
| 5706 | return ip.items.items(.tag)[@intFromEnum(val)] == .runtime_value; | |
| 5707 | } | |
| 5708 | ||
| 5705 | 5709 | /// This is a particularly hot function, so we operate directly on encodings |
| 5706 | 5710 | /// rather than the more straightforward implementation of calling `indexToKey`. |
| 5707 | 5711 | pub fn zigTypeTagOrPoison(ip: *const InternPool, index: Index) error{GenericPoison}!std.builtin.TypeId { |
src/value.zig+1-1| ... | ... | @@ -1823,7 +1823,7 @@ pub const Value = struct { |
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | 1825 | pub fn isRuntimeValue(val: Value, mod: *Module) bool { |
| 1826 | return mod.intern_pool.indexToKey(val.toIntern()) == .runtime_value; | |
| 1826 | return mod.intern_pool.isRuntimeValue(val.toIntern()); | |
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | 1829 | /// Returns true if a Value is backed by a variable |