diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-13 04:46:30 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-19 11:45:06 -0400 |
| commit | 917640810e7f3e18daff9e75b5ecefe761a1896c (patch) | |
| tree | 579e627d695f898d411a3cb1fbc0578d1a763cc2 /tools | |
| parent | 16d78bc0c024da307c7ab5f6b94622e6b4b37397 (diff) | |
| download | zig-917640810e7f3e18daff9e75b5ecefe761a1896c.tar.gz zig-917640810e7f3e18daff9e75b5ecefe761a1896c.zip | |
Target: pass and use locals by pointer instead of by value
This struct is larger than 256 bytes and code that copies it
consistently shows up in profiles of the compiler.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/doctest.zig | 4 | ||||
| -rw-r--r-- | tools/incr-check.zig | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/doctest.zig b/tools/doctest.zig index 86eb2009bd..af5ce9f983 100644 --- a/tools/doctest.zig +++ b/tools/doctest.zig @@ -317,7 +317,7 @@ fn printOutput( const target = try std.zig.system.resolveTargetQuery( target_query, ); - switch (getExternalExecutor(host, &target, .{ + switch (getExternalExecutor(&host, &target, .{ .link_libc = code.link_libc, })) { .native => {}, @@ -538,7 +538,7 @@ fn printOutput( .lib => { const bin_basename = try std.zig.binNameAlloc(arena, .{ .root_name = code_name, - .target = builtin.target, + .target = &builtin.target, .output_mode = .Lib, }); diff --git a/tools/incr-check.zig b/tools/incr-check.zig index 6c048f7a87..08b8a21e3b 100644 --- a/tools/incr-check.zig +++ b/tools/incr-check.zig @@ -316,7 +316,7 @@ const Eval = struct { const bin_name = try std.zig.EmitArtifact.bin.cacheName(arena, .{ .root_name = "root", // corresponds to the module name "root" - .target = eval.target.resolved, + .target = &eval.target.resolved, .output_mode = .Exe, }); const bin_path = try std.fs.path.join(arena, &.{ result_dir, bin_name }); @@ -444,7 +444,7 @@ const Eval = struct { var argv_buf: [2][]const u8 = undefined; const argv: []const []const u8, const is_foreign: bool = switch (std.zig.system.getExternalExecutor( - eval.host, + &eval.host, &eval.target.resolved, .{ .link_libc = eval.target.backend == .cbe }, )) { |
