wasm linker: implement name subsection

unlike the previous implementation, we can simply iterate an array.
This commit is contained in:
Andrew Kelley
2024-12-15 19:55:40 -08:00
parent e80a203768
commit d6b42e585b
4 changed files with 131 additions and 108 deletions

View File

@@ -11801,6 +11801,10 @@ pub fn toEnum(ip: *const InternPool, comptime E: type, i: Index) E {
return @enumFromInt(ip.indexToKey(int).int.storage.u64);
}
pub fn toFunc(ip: *const InternPool, i: Index) Key.Func {
return ip.indexToKey(i).func;
}
pub fn aggregateTypeLen(ip: *const InternPool, ty: Index) u64 {
return switch (ip.indexToKey(ty)) {
.struct_type => ip.loadStructType(ty).field_types.len,