aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-09 23:52:36 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-04-15 19:06:39 -0700
commita4bb7c8bb17a4ac692401946df6b9f4cc3e5b1b2 (patch)
tree8ee1dbaf12c60c57df253bafa18d624937365f49 /src/Compilation.zig
parentf458192e56b13500ff6eb7c3e94dcf48240f4170 (diff)
downloadzig-a4bb7c8bb17a4ac692401946df6b9f4cc3e5b1b2.tar.gz
zig-a4bb7c8bb17a4ac692401946df6b9f4cc3e5b1b2.zip
stage2: remove redundant source hash
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index c4adfb0e02..eaf9b7f5b4 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1484,22 +1484,14 @@ pub fn update(self: *Compilation) !void {
continue;
}
- const prev_hash = file.source_hash;
- file.unloadSource(module.gpa);
- // TODO handle error here by populating a retryable compile error
- try file.finishGettingSource(module.gpa, f, stat);
- assert(file.source_loaded);
- if (mem.eql(u8, &prev_hash, &file.source_hash)) {
- file.updateTreeToNewSource();
- log.debug("unmodified source hash of file: {s}", .{file.sub_file_path});
- continue;
- }
-
- log.debug("source contents changed: {s}", .{file.sub_file_path});
+ log.debug("metadata changed: {s}", .{file.sub_file_path});
if (file.status == .unloaded_parse_failure) {
module.failed_files.swapRemove(file).?.value.destroy(module.gpa);
}
- file.unloadTree(module.gpa);
+
+ file.unload(module.gpa);
+ // TODO handle error here by populating a retryable compile error
+ try file.finishGettingSource(module.gpa, f, stat);
module.analyzeFile(file) catch |err| switch (err) {
error.OutOfMemory => return error.OutOfMemory,