aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-02-27 11:03:08 -0800
committerGitHub <noreply@github.com>2024-02-27 11:03:08 -0800
commit6f7354a04151bc0da7f661b46c5b5b3afed96112 (patch)
tree78bc876eb5d68f9bde247add51e4e19ecc3a3b2b /src/codegen/spirv.zig
parent27f589dea1dae6ec0033e1ad2902fb5dadfa562b (diff)
parent97f2a8b5cb4c882e05add16a69c7a55f7fe46794 (diff)
downloadzig-6f7354a04151bc0da7f661b46c5b5b3afed96112.tar.gz
zig-6f7354a04151bc0da7f661b46c5b5b3afed96112.zip
Merge pull request #19102 from ziglang/decouple-zir
JIT `zig fmt` and `zig reduce`
Diffstat (limited to 'src/codegen/spirv.zig')
-rw-r--r--src/codegen/spirv.zig9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index ca724c3879..fb8d1e1e8e 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -8,9 +8,8 @@ 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");
const InternPool = @import("../InternPool.zig");
@@ -413,8 +412,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 +5268,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);