From f7143e18e368eb89763e9d813b8b7c9c96dd1bd3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 26 Feb 2024 20:35:26 -0700 Subject: move Zcu.LazySrcLoc to std.zig.LazySrcLoc Part of an effort to ship more of the compiler in source form. --- src/codegen/c.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/codegen/c.zig') diff --git a/src/codegen/c.zig b/src/codegen/c.zig index d4747256bb..92dc904c1a 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -13,7 +13,7 @@ const TypedValue = @import("../TypedValue.zig"); const C = link.File.C; const Decl = Module.Decl; const trace = @import("../tracy.zig").trace; -const LazySrcLoc = Module.LazySrcLoc; +const LazySrcLoc = std.zig.LazySrcLoc; const Air = @import("../Air.zig"); const Liveness = @import("../Liveness.zig"); const InternPool = @import("../InternPool.zig"); @@ -570,8 +570,7 @@ pub const DeclGen = struct { const mod = dg.module; const decl_index = dg.pass.decl; const decl = mod.declPtr(decl_index); - const src = LazySrcLoc.nodeOffset(0); - const src_loc = src.toSrcLoc(decl, mod); + const src_loc = decl.srcLoc(mod); dg.error_msg = try Module.ErrorMsg.create(dg.gpa, src_loc, format, args); return error.AnalysisFail; } -- cgit v1.2.3