| author | |
| committer | |
| log | 6393928d508d5a18d3a15b8c9ecbc53ffb3812ce |
| tree | 0084cfb1d96fa3357afa4ee68eab0412c60a7dd7 |
| parent | 38840e2e586d71f2b38ed825ea02529f615c5f0c |
closes #163476 files changed, 14 insertions(+), 3 deletions(-)
src/link.zig+4-2| ... | @@ -966,6 +966,8 @@ pub const File = struct { | ... | @@ -966,6 +966,8 @@ pub const File = struct { |
| 966 | } | 966 | } |
| 967 | 967 | ||
| 968 | pub fn linkAsArchive(base: *File, comp: *Compilation, prog_node: *std.Progress.Node) FlushError!void { | 968 | pub fn linkAsArchive(base: *File, comp: *Compilation, prog_node: *std.Progress.Node) FlushError!void { |
| 969 | const emit = base.options.emit orelse return; | ||
| 970 | |||
| 969 | const tracy = trace(@src()); | 971 | const tracy = trace(@src()); |
| 970 | defer tracy.end(); | 972 | defer tracy.end(); |
| 971 | 973 | ||
| ... | @@ -973,8 +975,8 @@ pub const File = struct { | ... | @@ -973,8 +975,8 @@ pub const File = struct { |
| 973 | defer arena_allocator.deinit(); | 975 | defer arena_allocator.deinit(); |
| 974 | const arena = arena_allocator.allocator(); | 976 | const arena = arena_allocator.allocator(); |
| 975 | 977 | ||
| 976 | const directory = base.options.emit.?.directory; // Just an alias to make it shorter to type. | 978 | const directory = emit.directory; // Just an alias to make it shorter to type. |
| 977 | const full_out_path = try directory.join(arena, &[_][]const u8{base.options.emit.?.sub_path}); | 979 | const full_out_path = try directory.join(arena, &[_][]const u8{emit.sub_path}); |
| 978 | const full_out_path_z = try arena.dupeZ(u8, full_out_path); | 980 | const full_out_path_z = try arena.dupeZ(u8, full_out_path); |
| 979 | 981 | ||
| 980 | // If there is no Zig code to compile, then we should skip flushing the output file | 982 | // If there is no Zig code to compile, then we should skip flushing the output file |
src/link/Coff.zig+2| ... | @@ -1452,6 +1452,8 @@ pub fn updateDeclExports( | ... | @@ -1452,6 +1452,8 @@ pub fn updateDeclExports( |
| 1452 | if (self.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); | 1452 | if (self.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); |
| 1453 | } | 1453 | } |
| 1454 | 1454 | ||
| 1455 | if (self.base.options.emit == null) return; | ||
| 1456 | |||
| 1455 | const gpa = self.base.allocator; | 1457 | const gpa = self.base.allocator; |
| 1456 | 1458 | ||
| 1457 | const decl = mod.declPtr(decl_index); | 1459 | const decl = mod.declPtr(decl_index); |
src/link/Elf.zig+2| ... | @@ -2865,6 +2865,8 @@ pub fn updateDeclExports( | ... | @@ -2865,6 +2865,8 @@ pub fn updateDeclExports( |
| 2865 | if (self.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); | 2865 | if (self.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); |
| 2866 | } | 2866 | } |
| 2867 | 2867 | ||
| 2868 | if (self.base.options.emit == null) return; | ||
| 2869 | |||
| 2868 | const tracy = trace(@src()); | 2870 | const tracy = trace(@src()); |
| 2869 | defer tracy.end(); | 2871 | defer tracy.end(); |
| 2870 | 2872 |
src/link/MachO.zig+2| ... | @@ -2386,6 +2386,8 @@ pub fn updateDeclExports( | ... | @@ -2386,6 +2386,8 @@ pub fn updateDeclExports( |
| 2386 | return llvm_object.updateDeclExports(mod, decl_index, exports); | 2386 | return llvm_object.updateDeclExports(mod, decl_index, exports); |
| 2387 | } | 2387 | } |
| 2388 | 2388 | ||
| 2389 | if (self.base.options.emit == null) return; | ||
| 2390 | |||
| 2389 | const tracy = trace(@src()); | 2391 | const tracy = trace(@src()); |
| 2390 | defer tracy.end(); | 2392 | defer tracy.end(); |
| 2391 | 2393 |
src/link/NvPtx.zig+2-1| ... | @@ -106,10 +106,11 @@ pub fn flushModule(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.No | ... | @@ -106,10 +106,11 @@ pub fn flushModule(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.No |
| 106 | if (build_options.skip_non_native) { | 106 | if (build_options.skip_non_native) { |
| 107 | @panic("Attempted to compile for architecture that was disabled by build configuration"); | 107 | @panic("Attempted to compile for architecture that was disabled by build configuration"); |
| 108 | } | 108 | } |
| 109 | const outfile = comp.bin_file.options.emit orelse return; | ||
| 110 | |||
| 109 | const tracy = trace(@src()); | 111 | const tracy = trace(@src()); |
| 110 | defer tracy.end(); | 112 | defer tracy.end(); |
| 111 | 113 | ||
| 112 | const outfile = comp.bin_file.options.emit.?; | ||
| 113 | // We modify 'comp' before passing it to LLVM, but restore value afterwards. | 114 | // We modify 'comp' before passing it to LLVM, but restore value afterwards. |
| 114 | // We tell LLVM to not try to build a .o, only an "assembly" file. | 115 | // We tell LLVM to not try to build a .o, only an "assembly" file. |
| 115 | // This is required by the LLVM PTX backend. | 116 | // This is required by the LLVM PTX backend. |
src/link/Wasm.zig+2| ... | @@ -1712,6 +1712,8 @@ pub fn updateDeclExports( | ... | @@ -1712,6 +1712,8 @@ pub fn updateDeclExports( |
| 1712 | if (wasm.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); | 1712 | if (wasm.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); |
| 1713 | } | 1713 | } |
| 1714 | 1714 | ||
| 1715 | if (wasm.base.options.emit == null) return; | ||
| 1716 | |||
| 1715 | const decl = mod.declPtr(decl_index); | 1717 | const decl = mod.declPtr(decl_index); |
| 1716 | const atom_index = try wasm.getOrCreateAtomForDecl(decl_index); | 1718 | const atom_index = try wasm.getOrCreateAtomForDecl(decl_index); |
| 1717 | const atom = wasm.getAtom(atom_index); | 1719 | const atom = wasm.getAtom(atom_index); |