aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-12-02 13:17:52 +0100
committerJakub Konka <kubkon@jakubkonka.com>2022-12-02 13:17:52 +0100
commitbfd36cbf97bfa012e5c399c16578b8756782e1d8 (patch)
treed6655a05c089ab0c316d3e36049b67768f774be8 /src/arch/wasm/CodeGen.zig
parent05962a4aa28eca701bb22c4b17d2f9ea236583f5 (diff)
downloadzig-bfd36cbf97bfa012e5c399c16578b8756782e1d8.tar.gz
zig-bfd36cbf97bfa012e5c399c16578b8756782e1d8.zip
dwarf: pass linker Tag and owner Decl.Index instead of *Atom
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index 6584ad2041..c424c7b59d 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -2341,8 +2341,7 @@ fn airArg(func: *CodeGen, inst: Air.Inst.Index) InnerError!void {
.dwarf => |dwarf| {
// TODO: Get the original arg index rather than wasm arg index
const name = func.mod_fn.getParamName(func.bin_file.base.options.module.?, arg_index);
- const atom = func.getDbgInfoAtom();
- try dwarf.genArgDbgInfo(name, arg_ty, atom, .{
+ try dwarf.genArgDbgInfo(name, arg_ty, .wasm, func.mod_fn.owner_decl, .{
.wasm_local = arg.local.value,
});
},
@@ -2352,12 +2351,6 @@ fn airArg(func: *CodeGen, inst: Air.Inst.Index) InnerError!void {
func.finishAir(inst, arg, &.{});
}
-fn getDbgInfoAtom(func: CodeGen) *link.File.Dwarf.Atom {
- const mod = func.bin_file.base.options.module.?;
- const fn_owner_decl = mod.declPtr(func.mod_fn.owner_decl);
- return &fn_owner_decl.link.wasm.dbg_info_atom;
-}
-
fn airBinOp(func: *CodeGen, inst: Air.Inst.Index, op: Op) InnerError!void {
const bin_op = func.air.instructions.items(.data)[inst].bin_op;
if (func.liveness.isUnused(inst)) return func.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs });
@@ -5326,7 +5319,6 @@ fn airDbgVar(func: *CodeGen, inst: Air.Inst.Index, is_ptr: bool) !void {
const name = func.air.nullTerminatedString(pl_op.payload);
log.debug(" var name = ({s})", .{name});
- const atom = func.getDbgInfoAtom();
const loc: link.File.Dwarf.DeclState.DbgInfoLoc = switch (operand) {
.local => |local| .{ .wasm_local = local.value },
else => blk: {
@@ -5334,7 +5326,7 @@ fn airDbgVar(func: *CodeGen, inst: Air.Inst.Index, is_ptr: bool) !void {
break :blk .nop;
},
};
- try func.debug_output.dwarf.genVarDbgInfo(name, ty, atom, is_ptr, loc);
+ try func.debug_output.dwarf.genVarDbgInfo(name, ty, .wasm, func.mod_fn.owner_decl, is_ptr, loc);
func.finishAir(inst, .none, &.{});
}