diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-01-17 00:16:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-17 00:16:10 -0700 |
| commit | 44135ea84e562ae67a5eeced99566be58bffc6fc (patch) | |
| tree | fdf5e11589187137b7189e5fda128c725259e659 /src/codegen/c.zig | |
| parent | 1f65828ec6caa7697b26d9e919112aa1715b57bc (diff) | |
| parent | 8deb21c58a4e5f9f8805f6b1a2c9a1774c4a4df5 (diff) | |
| download | zig-44135ea84e562ae67a5eeced99566be58bffc6fc.tar.gz zig-44135ea84e562ae67a5eeced99566be58bffc6fc.zip | |
Merge branch 'stage2 error notes'
Closes #7555
There was still some extra work @Vexu did in that PR having to do with
adding more compile errors and notes for switch expressions, but that
can be added in a follow-up commit.
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 8c85f482fd..b26f753757 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -114,10 +114,13 @@ pub const DeclGen = struct { module: *Module, decl: *Decl, fwd_decl: std.ArrayList(u8), - error_msg: ?*Compilation.ErrorMsg, + error_msg: ?*Module.ErrorMsg, fn fail(dg: *DeclGen, src: usize, comptime format: []const u8, args: anytype) error{ AnalysisFail, OutOfMemory } { - dg.error_msg = try Compilation.ErrorMsg.create(dg.module.gpa, src, format, args); + dg.error_msg = try Module.ErrorMsg.create(dg.module.gpa, .{ + .file_scope = dg.decl.getFileScope(), + .byte_offset = src, + }, format, args); return error.AnalysisFail; } |
