link: make Wasm atoms fully owned by the linker

This commit is contained in:
Luuk de Gram
2023-02-01 18:55:35 +01:00
parent 1aa0f8aa2f
commit 46f54b23ae
10 changed files with 353 additions and 326 deletions

View File

@@ -5266,7 +5266,7 @@ pub fn clearDecl(
.macho => .{ .macho = {} },
.plan9 => .{ .plan9 = {} },
.c => .{ .c = {} },
.wasm => .{ .wasm = link.File.Wasm.DeclBlock.empty },
.wasm => .{ .wasm = {} },
.spirv => .{ .spirv = {} },
.nvptx => .{ .nvptx = {} },
};
@@ -5374,7 +5374,7 @@ fn deleteDeclExports(mod: *Module, decl_index: Decl.Index) Allocator.Error!void
try macho.deleteDeclExport(decl_index, exp.options.name);
}
if (mod.comp.bin_file.cast(link.File.Wasm)) |wasm| {
wasm.deleteExport(exp.link.wasm);
wasm.deleteDeclExport(decl_index);
}
if (mod.comp.bin_file.cast(link.File.Coff)) |coff| {
coff.deleteDeclExport(decl_index, exp.options.name);
@@ -5686,7 +5686,7 @@ pub fn allocateNewDecl(
.macho => .{ .macho = {} },
.plan9 => .{ .plan9 = {} },
.c => .{ .c = {} },
.wasm => .{ .wasm = link.File.Wasm.DeclBlock.empty },
.wasm => .{ .wasm = {} },
.spirv => .{ .spirv = {} },
.nvptx => .{ .nvptx = {} },
},