aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2025-10-28 12:42:05 +0000
committerMatthew Lugg <mlugg@mlugg.co.uk>2025-10-30 09:31:28 +0000
commit74931fe25cdd94e1cd08b5ece9dcce19959bc079 (patch)
tree75449b1d594d55a872aeb03f2dd3be16ac396274 /src/codegen
parent74c23a237ef5245b63eb06b832a511aabeb715c0 (diff)
downloadzig-74931fe25cdd94e1cd08b5ece9dcce19959bc079.tar.gz
zig-74931fe25cdd94e1cd08b5ece9dcce19959bc079.zip
std.debug.lockStderrWriter: also return ttyconf
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/aarch64/Select.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen/aarch64/Select.zig b/src/codegen/aarch64/Select.zig
index 43edde274c..8103a1a53d 100644
--- a/src/codegen/aarch64/Select.zig
+++ b/src/codegen/aarch64/Select.zig
@@ -11188,7 +11188,7 @@ fn initValueAdvanced(
}
pub fn dumpValues(isel: *Select, which: enum { only_referenced, all }) void {
errdefer |err| @panic(@errorName(err));
- const stderr = std.debug.lockStderrWriter(&.{});
+ const stderr, _ = std.debug.lockStderrWriter(&.{});
defer std.debug.unlockStderrWriter();
const zcu = isel.pt.zcu;