aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-12-30 20:49:02 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-01-02 13:16:17 -0700
commit0ad2a99675d331c686847a7b2a84feddfcce6573 (patch)
treeba1b08642950fd481e95bb0cd198ada0176850f5 /src/Compilation.zig
parentdbd0a2c35d590752dfa586a816f2870e4bcb3200 (diff)
downloadzig-0ad2a99675d331c686847a7b2a84feddfcce6573.tar.gz
zig-0ad2a99675d331c686847a7b2a84feddfcce6573.zip
stage2: CacheMode.whole: trigger loading zig source files
Previously the code asserted source files were already loaded, but this is not the case when cached ZIR is loaded. Now it will trigger .zig source code to be loaded for the purposes of hashing the source for `CacheMode.whole`. This additionally refactors stat_size, stat_inode, and stat_mtime fields into using the `Cache.File.Stat` struct.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index ddf331d4f3..e71c84af33 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -421,7 +421,7 @@ pub const AllErrors = struct {
const module_note = module_err_msg.notes[i];
const source = try module_note.src_loc.file_scope.getSource(module.gpa);
const byte_offset = try module_note.src_loc.byteOffset(module.gpa);
- const loc = std.zig.findLineColumn(source, byte_offset);
+ const loc = std.zig.findLineColumn(source.bytes, byte_offset);
const file_path = try module_note.src_loc.file_scope.fullPath(allocator);
note.* = .{
.src = .{
@@ -444,7 +444,7 @@ pub const AllErrors = struct {
}
const source = try module_err_msg.src_loc.file_scope.getSource(module.gpa);
const byte_offset = try module_err_msg.src_loc.byteOffset(module.gpa);
- const loc = std.zig.findLineColumn(source, byte_offset);
+ const loc = std.zig.findLineColumn(source.bytes, byte_offset);
const file_path = try module_err_msg.src_loc.file_scope.fullPath(allocator);
try errors.append(.{
.src = .{