aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-05-08 16:52:59 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:42:30 -0700
commit275652f620541919087bc92da0d2f9e97c66d3c0 (patch)
tree0b19398252ef29e6b0a6c6758ac90f564a235f13 /src/codegen/spirv.zig
parente94a81c951905a6b5bcf2a6028589ac1e33d1edd (diff)
downloadzig-275652f620541919087bc92da0d2f9e97c66d3c0.tar.gz
zig-275652f620541919087bc92da0d2f9e97c66d3c0.zip
stage2: move opaque types to InternPool
Diffstat (limited to 'src/codegen/spirv.zig')
-rw-r--r--src/codegen/spirv.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index 843b67e426..52f94cc6d5 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -218,8 +218,9 @@ pub 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));
+ const src_loc = src.toSrcLoc(self.module.declPtr(self.decl_index), mod);
assert(self.error_msg == null);
self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, format, args);
return error.CodegenFail;
@@ -2775,7 +2776,10 @@ pub const DeclGen = struct {
fn airDbgStmt(self: *DeclGen, inst: Air.Inst.Index) !void {
const dbg_stmt = self.air.instructions.items(.data)[inst].dbg_stmt;
- const src_fname_id = try self.spv.resolveSourceFileName(self.module.declPtr(self.decl_index));
+ const src_fname_id = try self.spv.resolveSourceFileName(
+ self.module,
+ self.module.declPtr(self.decl_index),
+ );
try self.func.body.emit(self.spv.gpa, .OpLine, .{
.file = src_fname_id,
.line = dbg_stmt.line,
@@ -3192,6 +3196,7 @@ pub const DeclGen = struct {
}
fn airAssembly(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
+ const mod = self.module;
const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
const extra = self.air.extraData(Air.Asm, ty_pl.payload);
@@ -3274,7 +3279,7 @@ pub const DeclGen = struct {
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));
+ const src_loc = loc.toSrcLoc(self.module.declPtr(self.decl_index), 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);