aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-02-26 20:35:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-02-26 21:35:30 -0700
commitf7143e18e368eb89763e9d813b8b7c9c96dd1bd3 (patch)
treecf1ee7be89d5f632ef865f2ff3900c48150d08e2 /src/codegen/spirv.zig
parent4e2570baafb587c679ee0fc5e113ddeb36522a5d (diff)
downloadzig-f7143e18e368eb89763e9d813b8b7c9c96dd1bd3.tar.gz
zig-f7143e18e368eb89763e9d813b8b7c9c96dd1bd3.zip
move Zcu.LazySrcLoc to std.zig.LazySrcLoc
Part of an effort to ship more of the compiler in source form.
Diffstat (limited to 'src/codegen/spirv.zig')
-rw-r--r--src/codegen/spirv.zig8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index ca724c3879..7641da4a94 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -8,7 +8,7 @@ const Module = @import("../Module.zig");
const Decl = Module.Decl;
const Type = @import("../type.zig").Type;
const Value = @import("../Value.zig");
-const LazySrcLoc = Module.LazySrcLoc;
+const LazySrcLoc = std.zig.LazySrcLoc;
const Air = @import("../Air.zig");
const Zir = @import("../Zir.zig");
const Liveness = @import("../Liveness.zig");
@@ -413,8 +413,7 @@ const DeclGen = struct {
pub fn fail(self: *DeclGen, comptime format: []const u8, args: anytype) Error {
@setCold(true);
const mod = self.module;
- const src = LazySrcLoc.nodeOffset(0);
- const src_loc = src.toSrcLoc(self.module.declPtr(self.decl_index), mod);
+ const src_loc = self.module.declPtr(self.decl_index).srcLoc(mod);
assert(self.error_msg == null);
self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, format, args);
return error.CodegenFail;
@@ -5270,8 +5269,7 @@ const DeclGen = struct {
// TODO: Translate proper error locations.
assert(as.errors.items.len != 0);
assert(self.error_msg == null);
- const loc = LazySrcLoc.nodeOffset(0);
- const src_loc = loc.toSrcLoc(self.module.declPtr(self.decl_index), mod);
+ const src_loc = self.module.declPtr(self.decl_index).srcLoc(mod);
self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, "failed to assemble SPIR-V inline assembly", .{});
const notes = try self.module.gpa.alloc(Module.ErrorMsg, as.errors.items.len);