From 917640810e7f3e18daff9e75b5ecefe761a1896c Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 13 Jun 2025 04:46:30 -0400 Subject: 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. --- lib/std/debug/SelfInfo.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/std/debug/SelfInfo.zig') diff --git a/lib/std/debug/SelfInfo.zig b/lib/std/debug/SelfInfo.zig index 70f3075de7..a879309870 100644 --- a/lib/std/debug/SelfInfo.zig +++ b/lib/std/debug/SelfInfo.zig @@ -1795,10 +1795,10 @@ fn spRegNum(reg_context: Dwarf.abi.RegisterContext) u8 { const ip_reg_num = Dwarf.abi.ipRegNum(native_arch).?; /// Tells whether unwinding for the host is implemented. -pub const supports_unwinding = supportsUnwinding(builtin.target); +pub const supports_unwinding = supportsUnwinding(&builtin.target); comptime { - if (supports_unwinding) assert(Dwarf.abi.supportsUnwinding(builtin.target)); + if (supports_unwinding) assert(Dwarf.abi.supportsUnwinding(&builtin.target)); } /// Tells whether unwinding for this target is *implemented* here in the Zig @@ -1806,7 +1806,7 @@ comptime { /// /// See also `Dwarf.abi.supportsUnwinding` which tells whether Dwarf supports /// unwinding on that target *in theory*. -pub fn supportsUnwinding(target: std.Target) bool { +pub fn supportsUnwinding(target: *const std.Target) bool { return switch (target.cpu.arch) { .x86 => switch (target.os.tag) { .linux, .netbsd, .solaris, .illumos => true, -- cgit v1.2.3