aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-05-22 07:58:02 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:54 -0700
commit6e0de1d11694a58745da76d601ebab7562feed09 (patch)
treecd6cf352788d8f47bad97a95e4390dd3f6a309c5 /src/link.zig
parent5555bdca047f8dbf8d7adfa8f248f5ce9b692b9e (diff)
downloadzig-6e0de1d11694a58745da76d601ebab7562feed09.tar.gz
zig-6e0de1d11694a58745da76d601ebab7562feed09.zip
InternPool: port most of value tags
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/link.zig b/src/link.zig
index 1f34b0f760..a44a7387e9 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -564,7 +564,8 @@ pub const File = struct {
}
/// May be called before or after updateDeclExports for any given Decl.
- pub fn updateFunc(base: *File, module: *Module, func: *Module.Fn, air: Air, liveness: Liveness) UpdateDeclError!void {
+ pub fn updateFunc(base: *File, module: *Module, func_index: Module.Fn.Index, air: Air, liveness: Liveness) UpdateDeclError!void {
+ const func = module.funcPtr(func_index);
const owner_decl = module.declPtr(func.owner_decl);
log.debug("updateFunc {*} ({s}), type={}", .{
owner_decl, owner_decl.name, owner_decl.ty.fmt(module),
@@ -575,14 +576,14 @@ pub const File = struct {
}
switch (base.tag) {
// zig fmt: off
- .coff => return @fieldParentPtr(Coff, "base", base).updateFunc(module, func, air, liveness),
- .elf => return @fieldParentPtr(Elf, "base", base).updateFunc(module, func, air, liveness),
- .macho => return @fieldParentPtr(MachO, "base", base).updateFunc(module, func, air, liveness),
- .c => return @fieldParentPtr(C, "base", base).updateFunc(module, func, air, liveness),
- .wasm => return @fieldParentPtr(Wasm, "base", base).updateFunc(module, func, air, liveness),
- .spirv => return @fieldParentPtr(SpirV, "base", base).updateFunc(module, func, air, liveness),
- .plan9 => return @fieldParentPtr(Plan9, "base", base).updateFunc(module, func, air, liveness),
- .nvptx => return @fieldParentPtr(NvPtx, "base", base).updateFunc(module, func, air, liveness),
+ .coff => return @fieldParentPtr(Coff, "base", base).updateFunc(module, func_index, air, liveness),
+ .elf => return @fieldParentPtr(Elf, "base", base).updateFunc(module, func_index, air, liveness),
+ .macho => return @fieldParentPtr(MachO, "base", base).updateFunc(module, func_index, air, liveness),
+ .c => return @fieldParentPtr(C, "base", base).updateFunc(module, func_index, air, liveness),
+ .wasm => return @fieldParentPtr(Wasm, "base", base).updateFunc(module, func_index, air, liveness),
+ .spirv => return @fieldParentPtr(SpirV, "base", base).updateFunc(module, func_index, air, liveness),
+ .plan9 => return @fieldParentPtr(Plan9, "base", base).updateFunc(module, func_index, air, liveness),
+ .nvptx => return @fieldParentPtr(NvPtx, "base", base).updateFunc(module, func_index, air, liveness),
// zig fmt: on
}
}