From cbbc7cc8b1edeeae1715248a5d13304027698367 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 11 May 2021 17:34:13 -0700 Subject: stage2: better handling of file-level compile errors across updates * `Module.File` now retains the most recent successful ZIR in the event that an update causes a ZIR compile error. This way Zig does not throw out useful semantic analysis results when an update temporarily introduces a ZIR compile error. * Semantic analysis of a File now unconditionally creates a Decl object for the File. The Decl object is marked as `file_failed` in case of File-level compile errors. This allows detecting of the File being outdated, and dependency tracking just like any other Decl. --- src/Compilation.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index ac53abb127..90e229c4a9 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1902,6 +1902,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor .in_progress => unreachable, .outdated => unreachable, + .file_failure, .sema_failure, .codegen_failure, .dependency_failure, @@ -1970,6 +1971,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor .in_progress => unreachable, .outdated => unreachable, + .file_failure, .sema_failure, .dependency_failure, .sema_failure_retryable, -- cgit v1.2.3