| ... | @@ -98,9 +98,9 @@ pub fn updateExports( | ... | @@ -98,9 +98,9 @@ pub fn updateExports( |
| 98 | exported: Module.Exported, | 98 | exported: Module.Exported, |
| 99 | exports: []const *Module.Export, | 99 | exports: []const *Module.Export, |
| 100 | ) !void { | 100 | ) !void { |
| 101 | if (build_options.skip_non_native and builtin.object_format != .nvptx) { | 101 | if (build_options.skip_non_native and builtin.object_format != .nvptx) |
| 102 | @panic("Attempted to compile for object format that was disabled by build configuration"); | 102 | @panic("Attempted to compile for object format that was disabled by build configuration"); |
| 103 | } | 103 | |
| 104 | return self.llvm_object.updateExports(module, exported, exports); | 104 | return self.llvm_object.updateExports(module, exported, exports); |
| 105 | } | 105 | } |
| 106 | | 106 | |
| ... | @@ -113,27 +113,13 @@ pub fn flush(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.Node) li | ... | @@ -113,27 +113,13 @@ pub fn flush(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.Node) li |
| 113 | } | 113 | } |
| 114 | | 114 | |
| 115 | pub fn flushModule(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void { | 115 | pub fn flushModule(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void { |
| 116 | if (build_options.skip_non_native) { | 116 | if (build_options.skip_non_native) |
| 117 | @panic("Attempted to compile for architecture that was disabled by build configuration"); | 117 | @panic("Attempted to compile for architecture that was disabled by build configuration"); |
| 118 | } | | |
| 119 | const outfile = comp.bin_file.options.emit orelse return; | | |
| 120 | | | |
| 121 | const tracy = trace(@src()); | | |
| 122 | defer tracy.end(); | | |
| 123 | | | |
| 124 | // We modify 'comp' before passing it to LLVM, but restore value afterwards. | | |
| 125 | // We tell LLVM to not try to build a .o, only an "assembly" file. | | |
| 126 | // This is required by the LLVM PTX backend. | | |
| 127 | comp.bin_file.options.emit = null; | | |
| 128 | comp.emit_asm = .{ | | |
| 129 | // 'null' means using the default cache dir: zig-cache/o/... | | |
| 130 | .directory = null, | | |
| 131 | .basename = self.base.emit.sub_path, | | |
| 132 | }; | | |
| 133 | defer { | | |
| 134 | comp.bin_file.options.emit = outfile; | | |
| 135 | comp.emit_asm = null; | | |
| 136 | } | | |
| 137 | | 118 | |
| 138 | try self.llvm_object.flushModule(comp, prog_node); | 119 | // The code that was here before mutated the Compilation's file emission mechanism. |
| | 120 | // That's not supposed to happen in flushModule, so I deleted the code. |
| | 121 | _ = self; |
| | 122 | _ = comp; |
| | 123 | _ = prog_node; |
| | 124 | @panic("TODO: rewrite the NvPtx.flushModule function"); |
| 139 | } | 125 | } |