diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-07-30 21:27:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-30 21:27:29 -0700 |
| commit | 43b830415368ac4fb08bf5e154a222a38baf4a24 (patch) | |
| tree | eaf6206e2038cbf7af17098162458b78cac91058 /src | |
| parent | 235e6ac05df95e5dc2656cfb1a33d7b18c45a603 (diff) | |
| parent | acbb6418c3899eb79aea98e7f5d3173298716377 (diff) | |
| download | zig-43b830415368ac4fb08bf5e154a222a38baf4a24.tar.gz zig-43b830415368ac4fb08bf5e154a222a38baf4a24.zip | |
Merge pull request #16446 from MasterQ32/buildsystem_rename_orgy
Build.zig rename orgy. Renames FileSource to LazyPath and others
Diffstat (limited to 'src')
| -rw-r--r-- | src/link.zig | 6 | ||||
| -rw-r--r-- | src/link/Coff.zig | 2 | ||||
| -rw-r--r-- | src/link/Elf.zig | 2 | ||||
| -rw-r--r-- | src/link/MachO.zig | 2 | ||||
| -rw-r--r-- | src/link/NvPtx.zig | 3 | ||||
| -rw-r--r-- | src/link/Wasm.zig | 2 |
6 files changed, 14 insertions, 3 deletions
diff --git a/src/link.zig b/src/link.zig index 703dfb8739..42322cbda8 100644 --- a/src/link.zig +++ b/src/link.zig @@ -966,6 +966,8 @@ pub const File = struct { } pub fn linkAsArchive(base: *File, comp: *Compilation, prog_node: *std.Progress.Node) FlushError!void { + const emit = base.options.emit orelse return; + const tracy = trace(@src()); defer tracy.end(); @@ -973,8 +975,8 @@ pub const File = struct { defer arena_allocator.deinit(); const arena = arena_allocator.allocator(); - const directory = base.options.emit.?.directory; // Just an alias to make it shorter to type. - const full_out_path = try directory.join(arena, &[_][]const u8{base.options.emit.?.sub_path}); + const directory = emit.directory; // Just an alias to make it shorter to type. + const full_out_path = try directory.join(arena, &[_][]const u8{emit.sub_path}); const full_out_path_z = try arena.dupeZ(u8, full_out_path); // If there is no Zig code to compile, then we should skip flushing the output file diff --git a/src/link/Coff.zig b/src/link/Coff.zig index 8720fc1037..f1b914c368 100644 --- a/src/link/Coff.zig +++ b/src/link/Coff.zig @@ -1452,6 +1452,8 @@ pub fn updateDeclExports( if (self.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); } + if (self.base.options.emit == null) return; + const gpa = self.base.allocator; const decl = mod.declPtr(decl_index); diff --git a/src/link/Elf.zig b/src/link/Elf.zig index 4bb049e074..ec4da9c728 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -2865,6 +2865,8 @@ pub fn updateDeclExports( if (self.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); } + if (self.base.options.emit == null) return; + const tracy = trace(@src()); defer tracy.end(); diff --git a/src/link/MachO.zig b/src/link/MachO.zig index d124a1f51c..44e6acc397 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -2386,6 +2386,8 @@ pub fn updateDeclExports( return llvm_object.updateDeclExports(mod, decl_index, exports); } + if (self.base.options.emit == null) return; + const tracy = trace(@src()); defer tracy.end(); diff --git a/src/link/NvPtx.zig b/src/link/NvPtx.zig index fc3d659770..fd1504a3d3 100644 --- a/src/link/NvPtx.zig +++ b/src/link/NvPtx.zig @@ -106,10 +106,11 @@ pub fn flushModule(self: *NvPtx, comp: *Compilation, prog_node: *std.Progress.No 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(); - const outfile = comp.bin_file.options.emit.?; // 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. diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig index c2a2de398f..11294daa84 100644 --- a/src/link/Wasm.zig +++ b/src/link/Wasm.zig @@ -1712,6 +1712,8 @@ pub fn updateDeclExports( if (wasm.llvm_object) |llvm_object| return llvm_object.updateDeclExports(mod, decl_index, exports); } + if (wasm.base.options.emit == null) return; + const decl = mod.declPtr(decl_index); const atom_index = try wasm.getOrCreateAtomForDecl(decl_index); const atom = wasm.getAtom(atom_index); |
