aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-04 17:21:55 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-04 17:21:55 -0700
commit2ed1ed9b32ae588f6a8997248d69817b5d89a133 (patch)
tree795a5929a71352c469fcd6018bb57ca5a3ebb20c /src/Module.zig
parent1c5606af9fdbfa18fb312a35a73c68515967c94d (diff)
downloadzig-2ed1ed9b32ae588f6a8997248d69817b5d89a133.tar.gz
zig-2ed1ed9b32ae588f6a8997248d69817b5d89a133.zip
stage2: introduce Module.failed_root_source_file
Use case: zig build-exe non_existent_file.zig Previous behavior: error.FileNotFound, followed by an error return trace Behavior after this commit: error: unable to read non_existent_file.zig: FileNotFound (end of stderr, exit code 1) This turns AllErrors.Message into a tagged union which now has the capability to represent both "plain" errors as well as source-based errors (with file, line, column, byte offset). The "no entry point found" error has moved to be a plain error message.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 7ef32abcc3..20cb7bf195 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -78,6 +78,9 @@ import_table: std.StringArrayHashMapUnmanaged(*Scope.File) = .{},
/// previous analysis.
generation: u32 = 0,
+/// When populated it means there was an error opening/reading the root source file.
+failed_root_src_file: ?anyerror = null,
+
stage1_flags: packed struct {
have_winmain: bool = false,
have_wwinmain: bool = false,