diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-01-18 14:12:05 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-18 14:12:05 -0700 |
| commit | 1a05b545205863c6bf9cbdee9157ad0c440300ca (patch) | |
| tree | 3c6a3b4bf4fc7c08dc24ab6e9339850243d24adf /src/codegen | |
| parent | 46dd058d59a108e84e822fb43cf011301bfc68bc (diff) | |
| download | zig-1a05b545205863c6bf9cbdee9157ad0c440300ca.tar.gz zig-1a05b545205863c6bf9cbdee9157ad0c440300ca.zip | |
update wasm backend to match new Module API
Fixes a logical merge conflict that I didn't notice before.
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/wasm.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/codegen/wasm.zig b/src/codegen/wasm.zig index 70e9de7baf..cbb2a42189 100644 --- a/src/codegen/wasm.zig +++ b/src/codegen/wasm.zig @@ -57,16 +57,19 @@ pub const Context = struct { /// will have the index that comes after the last argument's index local_index: u32 = 0, /// If codegen fails, an error messages will be allocated and saved in `err_msg` - err_msg: *Compilation.ErrorMsg, + err_msg: *Module.ErrorMsg, const InnerError = error{ OutOfMemory, CodegenFail, }; - /// Sets `err_msg` on `Context` and returns `error.CodegemFail` which is caught in link/Wasm.zig + /// Sets `err_msg` on `Context` and returns `error.CodegenFail` which is caught in link/Wasm.zig fn fail(self: *Context, src: usize, comptime fmt: []const u8, args: anytype) InnerError { - self.err_msg = try Compilation.ErrorMsg.create(self.gpa, src, fmt, args); + self.err_msg = try Module.ErrorMsg.create(self.gpa, .{ + .file_scope = self.decl.getFileScope(), + .byte_offset = src, + }, fmt, args); return error.CodegenFail; } |
