diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-06 20:09:24 -0400 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-06-12 13:55:41 +0100 |
| commit | 580d622b0dfec3ae9f1e3262673d8d4daa6b5b60 (patch) | |
| tree | 28ea13332a9099d42174d72aca20921a4b1041dd /src/Zcu/PerThread.zig | |
| parent | d24af297422415346dc8fcbecabd2334571c1b5b (diff) | |
| download | zig-580d622b0dfec3ae9f1e3262673d8d4daa6b5b60.tar.gz zig-580d622b0dfec3ae9f1e3262673d8d4daa6b5b60.zip | |
Zcu: fix verbose air
Diffstat (limited to 'src/Zcu/PerThread.zig')
| -rw-r--r-- | src/Zcu/PerThread.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index 5215f787ef..b5eaca0397 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -4428,11 +4428,13 @@ fn runCodegenInner(pt: Zcu.PerThread, func_index: InternPool.Index, air: *Air) e var liveness: Air.Liveness = try .analyze(zcu, air.*, ip); defer liveness.deinit(gpa); - // TODO: surely writing to stderr from n threads simultaneously will work flawlessly if (build_options.enable_debug_extensions and comp.verbose_air) { - std.debug.print("# Begin Function AIR: {}:\n", .{fqn.fmt(ip)}); - air.dump(pt, liveness); - std.debug.print("# End Function AIR: {}\n\n", .{fqn.fmt(ip)}); + std.debug.lockStdErr(); + defer std.debug.unlockStdErr(); + const stderr = std.io.getStdErr().writer(); + stderr.print("# Begin Function AIR: {}:\n", .{fqn.fmt(ip)}) catch {}; + air.write(stderr, pt, liveness); + stderr.print("# End Function AIR: {}\n\n", .{fqn.fmt(ip)}) catch {}; } if (std.debug.runtime_safety) { |
