From 8abdebecdca3a905099fa17f2497e8bf5f918e8a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 13 Jan 2025 15:19:24 -0800 Subject: wasm linker: implement `@tagName` for sparse enums --- src/Value.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Value.zig') diff --git a/src/Value.zig b/src/Value.zig index 3048691a55..3081a28b9b 100644 --- a/src/Value.zig +++ b/src/Value.zig @@ -241,12 +241,12 @@ pub fn getVariable(val: Value, mod: *Zcu) ?InternPool.Key.Variable { /// If the value fits in a u64, return it, otherwise null. /// Asserts not undefined. -pub fn getUnsignedInt(val: Value, zcu: *Zcu) ?u64 { +pub fn getUnsignedInt(val: Value, zcu: *const Zcu) ?u64 { return getUnsignedIntInner(val, .normal, zcu, {}) catch unreachable; } /// Asserts the value is an integer and it fits in a u64 -pub fn toUnsignedInt(val: Value, zcu: *Zcu) u64 { +pub fn toUnsignedInt(val: Value, zcu: *const Zcu) u64 { return getUnsignedInt(val, zcu).?; } @@ -259,7 +259,7 @@ pub fn getUnsignedIntSema(val: Value, pt: Zcu.PerThread) !?u64 { pub fn getUnsignedIntInner( val: Value, comptime strat: ResolveStrat, - zcu: *Zcu, + zcu: strat.ZcuPtr(), tid: strat.Tid(), ) !?u64 { return switch (val.toIntern()) { @@ -304,7 +304,7 @@ pub fn toUnsignedIntSema(val: Value, pt: Zcu.PerThread) !u64 { } /// Asserts the value is an integer and it fits in a i64 -pub fn toSignedInt(val: Value, zcu: *Zcu) i64 { +pub fn toSignedInt(val: Value, zcu: *const Zcu) i64 { return switch (val.toIntern()) { .bool_false => 0, .bool_true => 1, -- cgit v1.2.3