| 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 | 966 | } |
| 967 | 967 | |
| 968 | 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 | 971 | const tracy = trace(@src()); |
| 970 | 972 | defer tracy.end(); |
| 971 | 973 | |
| ... | ... | @@ -973,8 +975,8 @@ pub const File = struct { |
| 973 | 975 | defer arena_allocator.deinit(); |
| 974 | 976 | const arena = arena_allocator.allocator(); |
| 975 | 977 | |
| 976 | const directory = base.options.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}); | |
| 978 | const directory = emit.directory; // Just an alias to make it shorter to type. | |
| 979 | const full_out_path = try directory.join(arena, &[_][]const u8{emit.sub_path}); | |
| 978 | 980 | const full_out_path_z = try arena.dupeZ(u8, full_out_path); |
| 979 | 981 | |
| 980 | 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 | 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 | 1457 | const gpa = self.base.allocator; |
| 1456 | 1458 | |
| 1457 | 1459 | const decl = mod.declPtr(decl_index); |
src/link/Elf.zig+2| ... | ... | @@ -2865,6 +2865,8 @@ pub fn updateDeclExports( |
| 2865 | 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 | 2870 | const tracy = trace(@src()); |
| 2869 | 2871 | defer tracy.end(); |
| 2870 | 2872 |
src/link/MachO.zig+2| ... | ... | @@ -2386,6 +2386,8 @@ pub fn updateDeclExports( |
| 2386 | 2386 | return llvm_object.updateDeclExports(mod, decl_index, exports); |
| 2387 | 2387 | } |
| 2388 | 2388 | |
| 2389 | if (self.base.options.emit == null) return; | |
| 2390 | ||
| 2389 | 2391 | const tracy = trace(@src()); |
| 2390 | 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 | 106 | if (build_options.skip_non_native) { |
| 107 | 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 | 111 | const tracy = trace(@src()); |
| 110 | 112 | defer tracy.end(); |
| 111 | 113 | |
| 112 | const outfile = comp.bin_file.options.emit.?; | |
| 113 | 114 | // We modify 'comp' before passing it to LLVM, but restore value afterwards. |
| 114 | 115 | // We tell LLVM to not try to build a .o, only an "assembly" file. |
| 115 | 116 | // This is required by the LLVM PTX backend. |
src/link/Wasm.zig+2| ... | ... | @@ -1712,6 +1712,8 @@ pub fn updateDeclExports( |
| 1712 | 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 | 1717 | const decl = mod.declPtr(decl_index); |
| 1716 | 1718 | const atom_index = try wasm.getOrCreateAtomForDecl(decl_index); |
| 1717 | 1719 | const atom = wasm.getAtom(atom_index); |