diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-06-07 17:48:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-06-09 15:37:16 -0700 |
| commit | bac132bc8fb320620ca5ad554ce515ccb7e4dad1 (patch) | |
| tree | f939fe43fd6d8d1fced831c6a4e96478eef0edec /src/codegen/spirv.zig | |
| parent | f1cff4fa4a28d42ac9055f94ee9a8f7fd2831cd7 (diff) | |
| download | zig-bac132bc8fb320620ca5ad554ce515ccb7e4dad1.tar.gz zig-bac132bc8fb320620ca5ad554ce515ccb7e4dad1.zip | |
introduce std.debug.Trace
And use it to debug a LazySrcLoc in stage2 that is set to a bogus value.
The actual fix in this commit is:
```diff
- try sema.emitBackwardBranch(&child_block, call_src);
+ try sema.emitBackwardBranch(block, call_src);
```
Diffstat (limited to 'src/codegen/spirv.zig')
| -rw-r--r-- | src/codegen/spirv.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index 0dc39db134..9879bc7f35 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -184,7 +184,7 @@ pub const DeclGen = struct { fn fail(self: *DeclGen, comptime format: []const u8, args: anytype) Error { @setCold(true); - const src: LazySrcLoc = .{ .node_offset = 0 }; + const src = LazySrcLoc.nodeOffset(0); const src_loc = src.toSrcLoc(self.decl); assert(self.error_msg == null); self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, format, args); @@ -193,7 +193,7 @@ pub const DeclGen = struct { fn todo(self: *DeclGen, comptime format: []const u8, args: anytype) Error { @setCold(true); - const src: LazySrcLoc = .{ .node_offset = 0 }; + const src = LazySrcLoc.nodeOffset(0); const src_loc = src.toSrcLoc(self.decl); assert(self.error_msg == null); self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, "TODO (SPIR-V): " ++ format, args); |
