aboutsummaryrefslogtreecommitdiff
path: root/src/Value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-01-13 15:19:24 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-01-15 15:11:36 -0800
commit8abdebecdca3a905099fa17f2497e8bf5f918e8a (patch)
treee1a49978c7483cd298bdcac5d747f88dbb728412 /src/Value.zig
parentb5261599d70dfdb5709a19fabc0e5fe9a3d0e3aa (diff)
downloadzig-8abdebecdca3a905099fa17f2497e8bf5f918e8a.tar.gz
zig-8abdebecdca3a905099fa17f2497e8bf5f918e8a.zip
wasm linker: implement `@tagName` for sparse enums
Diffstat (limited to 'src/Value.zig')
-rw-r--r--src/Value.zig8
1 files changed, 4 insertions, 4 deletions
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,