stage2/wasm: implement basic container generation
Thus far, we only generate the type, function, export, and code sections. These are sufficient to generate and export simple functions. Codegen is currently hardcoded to `i32.const 42`, the main goal of this commit is to create infrastructure for the container format which will work with incremental compilation.
This commit is contained in:
@@ -1571,7 +1571,7 @@ fn analyzeRootSrcFile(self: *Module, root_scope: *Scope.File) !void {
|
||||
.macho => {
|
||||
// TODO Implement for MachO
|
||||
},
|
||||
.c => {},
|
||||
.c, .wasm => {},
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1781,11 +1781,13 @@ fn allocateNewDecl(
|
||||
.elf => .{ .elf = link.File.Elf.TextBlock.empty },
|
||||
.macho => .{ .macho = link.File.MachO.TextBlock.empty },
|
||||
.c => .{ .c = {} },
|
||||
.wasm => .{ .wasm = {} },
|
||||
},
|
||||
.fn_link = switch (self.bin_file.tag) {
|
||||
.elf => .{ .elf = link.File.Elf.SrcFn.empty },
|
||||
.macho => .{ .macho = link.File.MachO.SrcFn.empty },
|
||||
.c => .{ .c = {} },
|
||||
.wasm => .{ .wasm = null },
|
||||
},
|
||||
.generation = 0,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user