authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-18 14:12:05-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-18 14:12:05-07:00
log1a05b545205863c6bf9cbdee9157ad0c440300ca
tree3c6a3b4bf4fc7c08dc24ab6e9339850243d24adf
parent46dd058d59a108e84e822fb43cf011301bfc68bc

update wasm backend to match new Module API

Fixes a logical merge conflict that I didn't notice before.

1 files changed, 6 insertions(+), 3 deletions(-)

src/codegen/wasm.zig+6-3
......@@ -57,16 +57,19 @@ pub const Context = struct {
5757 /// will have the index that comes after the last argument's index
5858 local_index: u32 = 0,
5959 /// If codegen fails, an error messages will be allocated and saved in `err_msg`
60 err_msg: *Compilation.ErrorMsg,
60 err_msg: *Module.ErrorMsg,
6161
6262 const InnerError = error{
6363 OutOfMemory,
6464 CodegenFail,
6565 };
6666
67 /// Sets `err_msg` on `Context` and returns `error.CodegemFail` which is caught in link/Wasm.zig
67 /// Sets `err_msg` on `Context` and returns `error.CodegenFail` which is caught in link/Wasm.zig
6868 fn fail(self: *Context, src: usize, comptime fmt: []const u8, args: anytype) InnerError {
69 self.err_msg = try Compilation.ErrorMsg.create(self.gpa, src, fmt, args);
69 self.err_msg = try Module.ErrorMsg.create(self.gpa, .{
70 .file_scope = self.decl.getFileScope(),
71 .byte_offset = src,
72 }, fmt, args);
7073 return error.CodegenFail;
7174 }
7275