aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2024-06-20 11:07:17 +0100
committerGitHub <noreply@github.com>2024-06-20 11:07:17 +0100
commitf73be120f4254c080c48081dfc5834a7ebc9d9cf (patch)
treee70598bed09659eb61c230620c1ddf88c14db905 /src/arch/wasm/CodeGen.zig
parentccd3cc3266762c1fea93cdc0190eaf71718d9e6a (diff)
parent2b677d1660018434757f9c9efec3c712675e6c47 (diff)
downloadzig-f73be120f4254c080c48081dfc5834a7ebc9d9cf.tar.gz
zig-f73be120f4254c080c48081dfc5834a7ebc9d9cf.zip
Merge pull request #20299 from mlugg/the-great-decl-split
The Great Decl Split (preliminary work): refactor source locations and eliminate `Sema.Block.src_decl`.
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index 2b6acbd9bc..d4cba71bf6 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -16,7 +16,6 @@ const Decl = Module.Decl;
const Type = @import("../../type.zig").Type;
const Value = @import("../../Value.zig");
const Compilation = @import("../../Compilation.zig");
-const LazySrcLoc = std.zig.LazySrcLoc;
const link = @import("../../link.zig");
const Air = @import("../../Air.zig");
const Liveness = @import("../../Liveness.zig");
@@ -766,7 +765,7 @@ pub fn deinit(func: *CodeGen) void {
/// Sets `err_msg` on `CodeGen` and returns `error.CodegenFail` which is caught in link/Wasm.zig
fn fail(func: *CodeGen, comptime fmt: []const u8, args: anytype) InnerError {
const mod = func.bin_file.base.comp.module.?;
- const src_loc = func.decl.srcLoc(mod);
+ const src_loc = func.decl.navSrcLoc(mod).upgrade(mod);
func.err_msg = try Module.ErrorMsg.create(func.gpa, src_loc, fmt, args);
return error.CodegenFail;
}
@@ -3123,7 +3122,7 @@ fn lowerAnonDeclRef(
}
const decl_align = mod.intern_pool.indexToKey(anon_decl.orig_ty).ptr_type.flags.alignment;
- const res = try func.bin_file.lowerAnonDecl(decl_val, decl_align, func.decl.srcLoc(mod));
+ const res = try func.bin_file.lowerAnonDecl(decl_val, decl_align, func.decl.navSrcLoc(mod).upgrade(mod));
switch (res) {
.ok => {},
.fail => |em| {