diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-10 16:36:21 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-04-10 18:35:14 -0700 |
| commit | d2ad3f5074877475c8f0ec0fbbb323a05fe8cf78 (patch) | |
| tree | d0c1596c447d59c76db662db2362affd76ea90d3 /lib/std/Build | |
| parent | 23d7921758524f76f2157e6f8a5823da2511396a (diff) | |
| download | zig-d2ad3f5074877475c8f0ec0fbbb323a05fe8cf78.tar.gz zig-d2ad3f5074877475c8f0ec0fbbb323a05fe8cf78.zip | |
std.Build.CompileStep: remove redundant dest_builder field
The destination *Build object is already known to be step.owner, while
the source object is artifact.step.owner.
Diffstat (limited to 'lib/std/Build')
| -rw-r--r-- | lib/std/Build/CompileStep.zig | 2 | ||||
| -rw-r--r-- | lib/std/Build/InstallArtifactStep.zig | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/std/Build/CompileStep.zig b/lib/std/Build/CompileStep.zig index 0ee6e32826..d1beff69fc 100644 --- a/lib/std/Build/CompileStep.zig +++ b/lib/std/Build/CompileStep.zig @@ -533,7 +533,7 @@ pub fn installLibraryHeaders(cs: *CompileStep, l: *CompileStep) void { const T = id.Type(); const ptr = b.allocator.create(T) catch @panic("OOM"); ptr.* = step.cast(T).?.*; - ptr.dest_builder = b; + ptr.step.owner = b; break :blk &ptr.step; }, else => unreachable, diff --git a/lib/std/Build/InstallArtifactStep.zig b/lib/std/Build/InstallArtifactStep.zig index 445f1e8ea8..b3ebcad89e 100644 --- a/lib/std/Build/InstallArtifactStep.zig +++ b/lib/std/Build/InstallArtifactStep.zig @@ -8,7 +8,6 @@ const fs = std.fs; pub const base_id = .install_artifact; step: Step, -dest_builder: *std.Build, artifact: *CompileStep, dest_dir: InstallDir, pdb_dir: ?InstallDir, @@ -28,7 +27,6 @@ pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep { .owner = owner, .makeFn = make, }), - .dest_builder = owner, .artifact = artifact, .dest_dir = artifact.override_dest_dir orelse switch (artifact.kind) { .obj => @panic("Cannot install a .obj build artifact."), @@ -71,9 +69,9 @@ pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep { fn make(step: *Step, prog_node: *std.Progress.Node) !void { _ = prog_node; - const src_builder = step.owner; const self = @fieldParentPtr(InstallArtifactStep, "step", step); - const dest_builder = self.dest_builder; + const src_builder = self.artifact.step.owner; + const dest_builder = step.owner; const dest_sub_path = if (self.dest_sub_path) |sub_path| sub_path else self.artifact.out_filename; const full_dest_path = dest_builder.getInstallPath(self.dest_dir, dest_sub_path); |
