diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-10-24 16:48:15 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-10-24 23:30:57 -0700 |
| commit | b3cd38ea4a7520fabbb05d3d2e74351c7c8effdb (patch) | |
| tree | 51a821b640352c1967490e96165e2d5abbd94c2b /src/link/MachO.zig | |
| parent | 4f04759c874d5fd41c7cadeb974b4459559bc2a7 (diff) | |
| download | zig-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/MachO.zig')
| -rw-r--r-- | src/link/MachO.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig index ca8ca6f2bd..bec66b66f0 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -405,7 +405,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*MachO { return self; } -pub fn flush(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) !void { +pub fn flush(self: *MachO, 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| { @@ -430,7 +430,7 @@ pub fn flush(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) !v } } -pub fn flushModule(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) !void { +pub fn flushModule(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void { const tracy = trace(@src()); defer tracy.end(); |
