aboutsummaryrefslogtreecommitdiff
path: root/src/link
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-14 19:09:38 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 17:51:19 -0700
commit6b44bddf5dd4a50c79cd1a4d3596cc07d868dd63 (patch)
tree250504693547a4dbd3fbec11f53433f8df9722b4 /src/link
parentc49957dbe82d7f0db555160b50306335bfa03165 (diff)
downloadzig-6b44bddf5dd4a50c79cd1a4d3596cc07d868dd63.tar.gz
zig-6b44bddf5dd4a50c79cd1a4d3596cc07d868dd63.zip
linker: remove bad NvPtx flushModule implementation
it's not supposed to mutate Compilation like this.
Diffstat (limited to 'src/link')
-rw-r--r--src/link/NvPtx.zig32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/link/NvPtx.zig b/src/link/NvPtx.zig
index 57a8352898..b59a527c5a 100644
--- a/src/link/NvPtx.zig
+++ b/src/link/NvPtx.zig
@@ -98,9 +98,9 @@ pub fn updateExports(
exported: Module.Exported,
exports: []const *Module.Export,
) !void {
- if (build_options.skip_non_native and builtin.object_format != .nvptx) {
+ if (build_options.skip_non_native and builtin.object_format != .nvptx)
@panic("Attempted to compile for object format that was disabled by build configuration");
- }
+
return self.llvm_object.updateExports(module, exported, exports);
}
@@ -113,27 +113,13 @@ pub fn flush(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.Node) li
}
pub fn flushModule(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void {
- if (build_options.skip_non_native) {
+ if (build_options.skip_non_native)
@panic("Attempted to compile for architecture that was disabled by build configuration");
- }
- const outfile = comp.bin_file.options.emit orelse return;
-
- const tracy = trace(@src());
- defer tracy.end();
-
- // We modify 'comp' before passing it to LLVM, but restore value afterwards.
- // We tell LLVM to not try to build a .o, only an "assembly" file.
- // This is required by the LLVM PTX backend.
- comp.bin_file.options.emit = null;
- comp.emit_asm = .{
- // 'null' means using the default cache dir: zig-cache/o/...
- .directory = null,
- .basename = self.base.emit.sub_path,
- };
- defer {
- comp.bin_file.options.emit = outfile;
- comp.emit_asm = null;
- }
- try self.llvm_object.flushModule(comp, prog_node);
+ // The code that was here before mutated the Compilation's file emission mechanism.
+ // That's not supposed to happen in flushModule, so I deleted the code.
+ _ = self;
+ _ = comp;
+ _ = prog_node;
+ @panic("TODO: rewrite the NvPtx.flushModule function");
}