aboutsummaryrefslogtreecommitdiff
path: root/src/link/Coff.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-10-24 16:48:15 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-10-24 23:30:57 -0700
commitb3cd38ea4a7520fabbb05d3d2e74351c7c8effdb (patch)
tree51a821b640352c1967490e96165e2d5abbd94c2b /src/link/Coff.zig
parent4f04759c874d5fd41c7cadeb974b4459559bc2a7 (diff)
downloadzig-b3cd38ea4a7520fabbb05d3d2e74351c7c8effdb.tar.gz
zig-b3cd38ea4a7520fabbb05d3d2e74351c7c8effdb.zip
link: add an explicit error set for flush() and flushModule()
This makes it easier to understand how control flow should happen in various cases; already just by doing this it is revealed that UndefinedSymbol and UndefinedSymbolReference should be merged, and that MissingMainEntrypoint should be removed in favor of the ErrorFlags mechanism thath we already have for missing the main entrypoint. The main motivation for this change, however, is preventing a compile error when there is conditional compilation inside linker implementations, causing the flush() error set to depend on compilation options. With this change, the error set is fixed, and, notably, the `-Donly-c` flag no longer has compilation errors due to this error set.
Diffstat (limited to 'src/link/Coff.zig')
-rw-r--r--src/link/Coff.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/link/Coff.zig b/src/link/Coff.zig
index 80182104a9..8f29f4bd56 100644
--- a/src/link/Coff.zig
+++ b/src/link/Coff.zig
@@ -1442,7 +1442,7 @@ fn resolveGlobalSymbol(self: *Coff, current: SymbolWithLoc) !void {
gop.value_ptr.* = current;
}
-pub fn flush(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Node) !void {
+pub fn flush(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void {
if (self.base.options.emit == null) {
if (build_options.have_llvm) {
if (self.llvm_object) |llvm_object| {
@@ -1461,7 +1461,7 @@ pub fn flush(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Node) !vo
}
}
-pub fn flushModule(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Node) !void {
+pub fn flushModule(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void {
const tracy = trace(@src());
defer tracy.end();