| author | |
| committer | |
| log | d5c97fded5d31114f8fc684938a2de22af929949 |
| tree | b54ce623de1c4a43165db4cff8a9e5f7e921ac47 |
| parent | 3afc6fbac63b31fd250b6cbc4451758e50f85b24 |
22 files changed, 127 insertions(+), 151 deletions(-)
lib/compiler/aro/aro/Diagnostics.zig+5-6| ... | ... | @@ -328,8 +328,8 @@ pub fn render(comp: *Compilation, config: std.io.tty.Config) void { |
| 328 | 328 | defer m.deinit(); |
| 329 | 329 | renderMessages(comp, &m); |
| 330 | 330 | } |
| 331 | pub fn defaultMsgWriter(config: std.io.tty.Config) MsgWriter { | |
| 332 | return MsgWriter.init(config); | |
| 331 | pub fn defaultMsgWriter(config: std.io.tty.Config, buffer: []u8) MsgWriter { | |
| 332 | return MsgWriter.init(config, buffer); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | pub fn renderMessages(comp: *Compilation, m: anytype) void { |
| ... | ... | @@ -529,16 +529,15 @@ const MsgWriter = struct { |
| 529 | 529 | config: std.io.tty.Config, |
| 530 | 530 | |
| 531 | 531 | fn init(config: std.io.tty.Config, buffer: []u8) MsgWriter { |
| 532 | std.debug.lockStdErr(); | |
| 533 | 532 | return .{ |
| 534 | .w = std.fs.stderr().writer(buffer), | |
| 533 | .w = std.debug.lockStderrWriter(buffer), | |
| 535 | 534 | .config = config, |
| 536 | 535 | }; |
| 537 | 536 | } |
| 538 | 537 | |
| 539 | 538 | pub fn deinit(m: *MsgWriter) void { |
| 540 | m.w.flush() catch {}; | |
| 541 | std.debug.unlockStdErr(); | |
| 539 | std.debug.unlockStderrWriter(); | |
| 540 | m.* = undefined; | |
| 542 | 541 | } |
| 543 | 542 | |
| 544 | 543 | pub fn print(m: *MsgWriter, comptime fmt: []const u8, args: anytype) void { |
lib/compiler/aro/aro/Value.zig+1-1| ... | ... | @@ -961,7 +961,7 @@ pub fn print(v: Value, ty: Type, comp: *const Compilation, w: anytype) @TypeOf(w |
| 961 | 961 | switch (key) { |
| 962 | 962 | .null => return w.writeAll("nullptr_t"), |
| 963 | 963 | .int => |repr| switch (repr) { |
| 964 | inline else => |x| return w.print("{d}", .{x}), | |
| 964 | inline else => |x| return w.print("{fd}", .{x}), | |
| 965 | 965 | }, |
| 966 | 966 | .float => |repr| switch (repr) { |
| 967 | 967 | .f16 => |x| return w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000) / 1000}), |
lib/std/io/Writer.zig+9-24| ... | ... | @@ -1981,21 +1981,15 @@ pub fn Hashed(comptime Hasher: type) type { |
| 1981 | 1981 | .hasher = hasher, |
| 1982 | 1982 | .writer = .{ |
| 1983 | 1983 | .buffer = buffer, |
| 1984 | .vtable = &.{@This().drain}, | |
| 1984 | .vtable = &.{ .drain = @This().drain }, | |
| 1985 | 1985 | }, |
| 1986 | 1986 | }; |
| 1987 | 1987 | } |
| 1988 | 1988 | |
| 1989 | 1989 | fn drain(w: *Writer, data: []const []const u8, splat: usize) Error!usize { |
| 1990 | 1990 | const this: *@This() = @alignCast(@fieldParentPtr("writer", w)); |
| 1991 | if (data.len == 0) { | |
| 1992 | const buf = w.buffered(); | |
| 1993 | try this.out.writeAll(buf); | |
| 1994 | this.hasher.update(buf); | |
| 1995 | w.end = 0; | |
| 1996 | return buf.len; | |
| 1997 | } | |
| 1998 | const aux_n = try this.out.writeSplatAux(w.buffered(), data, splat); | |
| 1991 | const aux = w.buffered(); | |
| 1992 | const aux_n = try this.out.writeSplatHeader(aux, data, splat); | |
| 1999 | 1993 | if (aux_n < w.end) { |
| 2000 | 1994 | this.hasher.update(w.buffer[0..aux_n]); |
| 2001 | 1995 | const remaining = w.buffer[aux_n..w.end]; |
| ... | ... | @@ -2003,29 +1997,20 @@ pub fn Hashed(comptime Hasher: type) type { |
| 2003 | 1997 | w.end = remaining.len; |
| 2004 | 1998 | return 0; |
| 2005 | 1999 | } |
| 2006 | this.hasher.update(w.buffered()); | |
| 2000 | this.hasher.update(aux); | |
| 2007 | 2001 | const n = aux_n - w.end; |
| 2008 | 2002 | w.end = 0; |
| 2009 | 2003 | var remaining: usize = n; |
| 2010 | const short_data = data[0 .. data.len - @intFromBool(splat == 0)]; | |
| 2011 | for (short_data) |slice| { | |
| 2012 | if (remaining < slice.len) { | |
| 2004 | for (data[0 .. data.len - 1]) |slice| { | |
| 2005 | if (remaining <= slice.len) { | |
| 2013 | 2006 | this.hasher.update(slice[0..remaining]); |
| 2014 | 2007 | return n; |
| 2015 | } else { | |
| 2016 | remaining -= slice.len; | |
| 2017 | this.hasher.update(slice); | |
| 2018 | 2008 | } |
| 2009 | remaining -= slice.len; | |
| 2010 | this.hasher.update(slice); | |
| 2019 | 2011 | } |
| 2020 | const remaining_splat = switch (splat) { | |
| 2021 | 0, 1 => { | |
| 2022 | assert(remaining == 0); | |
| 2023 | return n; | |
| 2024 | }, | |
| 2025 | else => splat - 1, | |
| 2026 | }; | |
| 2027 | 2012 | const pattern = data[data.len - 1]; |
| 2028 | assert(remaining == remaining_splat * pattern.len); | |
| 2013 | assert(remaining == splat * pattern.len); | |
| 2029 | 2014 | switch (pattern.len) { |
| 2030 | 2015 | 0 => { |
| 2031 | 2016 | assert(remaining == 0); |
lib/std/zig/llvm/Builder.zig+1-1| ... | ... | @@ -1262,7 +1262,7 @@ pub const Attribute = union(Kind) { |
| 1262 | 1262 | try w.writeByte(')'); |
| 1263 | 1263 | }, |
| 1264 | 1264 | .alignstack => |alignment| { |
| 1265 | try w.print(" {s}", .{attribute}); | |
| 1265 | try w.print(" {f}", .{attribute}); | |
| 1266 | 1266 | const alignment_bytes = alignment.toByteUnits() orelse return; |
| 1267 | 1267 | switch (data.mode) { |
| 1268 | 1268 | .pound => try w.print("({d})", .{alignment_bytes}), |
src/Builtin.zig+1-1| ... | ... | @@ -317,7 +317,7 @@ pub fn updateFileOnDisk(file: *File, comp: *Compilation) !void { |
| 317 | 317 | if (root_dir.statFile(sub_path)) |stat| { |
| 318 | 318 | if (stat.size != file.source.?.len) { |
| 319 | 319 | std.log.warn( |
| 320 | "the cached file '{f}{s}' had the wrong size. Expected {d}, found {d}. " ++ | |
| 320 | "the cached file '{f}' had the wrong size. Expected {d}, found {d}. " ++ | |
| 321 | 321 | "Overwriting with correct file contents now", |
| 322 | 322 | .{ file.path.fmt(comp), file.source.?.len, stat.size }, |
| 323 | 323 | ); |
src/Compilation.zig+4-3| ... | ... | @@ -399,9 +399,8 @@ pub const Path = struct { |
| 399 | 399 | const Formatter = struct { |
| 400 | 400 | p: Path, |
| 401 | 401 | comp: *Compilation, |
| 402 | pub fn format(f: Formatter, comptime unused_fmt: []const u8, options: std.fmt.FormatOptions, w: anytype) !void { | |
| 402 | pub fn format(f: Formatter, w: *std.io.Writer, comptime unused_fmt: []const u8) std.io.Writer.Error!void { | |
| 403 | 403 | comptime assert(unused_fmt.len == 0); |
| 404 | _ = options; | |
| 405 | 404 | const root_path: []const u8 = switch (f.p.root) { |
| 406 | 405 | .zig_lib => f.comp.dirs.zig_lib.path orelse ".", |
| 407 | 406 | .global_cache => f.comp.dirs.global_cache.path orelse ".", |
| ... | ... | @@ -6034,7 +6033,9 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 6034 | 6033 | // 24 is RT_MANIFEST |
| 6035 | 6034 | const resource_type = 24; |
| 6036 | 6035 | |
| 6037 | const input = try std.fmt.allocPrint(arena, "{} {} \"{s}\"", .{ resource_id, resource_type, fmtRcEscape(src_path) }); | |
| 6036 | const input = try std.fmt.allocPrint(arena, "{} {} \"{f}\"", .{ | |
| 6037 | resource_id, resource_type, fmtRcEscape(src_path), | |
| 6038 | }); | |
| 6038 | 6039 | |
| 6039 | 6040 | try o_dir.writeFile(.{ .sub_path = rc_basename, .data = input }); |
| 6040 | 6041 |
src/Package/Fetch.zig+2-2| ... | ... | @@ -1079,13 +1079,13 @@ fn initResource(f: *Fetch, uri: std.Uri, server_header_buffer: []u8) RunError!Re |
| 1079 | 1079 | }); |
| 1080 | 1080 | const notes_start = try eb.reserveNotes(notes_len); |
| 1081 | 1081 | eb.extra.items[notes_start] = @intFromEnum(try eb.addErrorMessage(.{ |
| 1082 | .msg = try eb.printString("try .url = \"{;+/}#{}\",", .{ uri, want_oid }), | |
| 1082 | .msg = try eb.printString("try .url = \"{f;+/}#{f}\",", .{ uri, want_oid }), | |
| 1083 | 1083 | })); |
| 1084 | 1084 | return error.FetchFailed; |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | var want_oid_buf: [git.Oid.max_formatted_length]u8 = undefined; |
| 1088 | _ = std.fmt.bufPrint(&want_oid_buf, "{}", .{want_oid}) catch unreachable; | |
| 1088 | _ = std.fmt.bufPrint(&want_oid_buf, "{f}", .{want_oid}) catch unreachable; | |
| 1089 | 1089 | var fetch_stream = session.fetch(&.{&want_oid_buf}, server_header_buffer) catch |err| { |
| 1090 | 1090 | return f.fail(f.location_tok, try eb.printString( |
| 1091 | 1091 | "unable to create fetch stream: {s}", |
src/Package/Fetch/git.zig+10-16| ... | ... | @@ -119,14 +119,8 @@ pub const Oid = union(Format) { |
| 119 | 119 | } else error.InvalidOid; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | pub fn format( | |
| 123 | oid: Oid, | |
| 124 | comptime fmt: []const u8, | |
| 125 | options: std.fmt.FormatOptions, | |
| 126 | writer: anytype, | |
| 127 | ) @TypeOf(writer).Error!void { | |
| 128 | _ = fmt; | |
| 129 | _ = options; | |
| 122 | pub fn format(oid: Oid, writer: *std.io.Writer, comptime fmt: []const u8) std.io.Writer.Error!void { | |
| 123 | comptime assert(fmt.len == 0); | |
| 130 | 124 | try writer.print("{x}", .{oid.slice()}); |
| 131 | 125 | } |
| 132 | 126 | |
| ... | ... | @@ -669,13 +663,13 @@ pub const Session = struct { |
| 669 | 663 | fn init(allocator: Allocator, uri: std.Uri) !Location { |
| 670 | 664 | const scheme = try allocator.dupe(u8, uri.scheme); |
| 671 | 665 | errdefer allocator.free(scheme); |
| 672 | const user = if (uri.user) |user| try std.fmt.allocPrint(allocator, "{user}", .{user}) else null; | |
| 666 | const user = if (uri.user) |user| try std.fmt.allocPrint(allocator, "{fuser}", .{user}) else null; | |
| 673 | 667 | errdefer if (user) |s| allocator.free(s); |
| 674 | const password = if (uri.password) |password| try std.fmt.allocPrint(allocator, "{password}", .{password}) else null; | |
| 668 | const password = if (uri.password) |password| try std.fmt.allocPrint(allocator, "{fpassword}", .{password}) else null; | |
| 675 | 669 | errdefer if (password) |s| allocator.free(s); |
| 676 | const host = if (uri.host) |host| try std.fmt.allocPrint(allocator, "{host}", .{host}) else null; | |
| 670 | const host = if (uri.host) |host| try std.fmt.allocPrint(allocator, "{fhost}", .{host}) else null; | |
| 677 | 671 | errdefer if (host) |s| allocator.free(s); |
| 678 | const path = try std.fmt.allocPrint(allocator, "{path}", .{uri.path}); | |
| 672 | const path = try std.fmt.allocPrint(allocator, "{fpath}", .{uri.path}); | |
| 679 | 673 | errdefer allocator.free(path); |
| 680 | 674 | // The query and fragment are not used as part of the base server URI. |
| 681 | 675 | return .{ |
| ... | ... | @@ -706,7 +700,7 @@ pub const Session = struct { |
| 706 | 700 | fn getCapabilities(session: *Session, http_headers_buffer: []u8) !CapabilityIterator { |
| 707 | 701 | var info_refs_uri = session.location.uri; |
| 708 | 702 | { |
| 709 | const session_uri_path = try std.fmt.allocPrint(session.allocator, "{path}", .{session.location.uri.path}); | |
| 703 | const session_uri_path = try std.fmt.allocPrint(session.allocator, "{fpath}", .{session.location.uri.path}); | |
| 710 | 704 | defer session.allocator.free(session_uri_path); |
| 711 | 705 | info_refs_uri.path = .{ .percent_encoded = try std.fs.path.resolvePosix(session.allocator, &.{ "/", session_uri_path, "info/refs" }) }; |
| 712 | 706 | } |
| ... | ... | @@ -730,7 +724,7 @@ pub const Session = struct { |
| 730 | 724 | if (request.response.status != .ok) return error.ProtocolError; |
| 731 | 725 | const any_redirects_occurred = request.redirect_behavior.remaining() < max_redirects; |
| 732 | 726 | if (any_redirects_occurred) { |
| 733 | const request_uri_path = try std.fmt.allocPrint(session.allocator, "{path}", .{request.uri.path}); | |
| 727 | const request_uri_path = try std.fmt.allocPrint(session.allocator, "{fpath}", .{request.uri.path}); | |
| 734 | 728 | defer session.allocator.free(request_uri_path); |
| 735 | 729 | if (!mem.endsWith(u8, request_uri_path, "/info/refs")) return error.UnparseableRedirect; |
| 736 | 730 | var new_uri = request.uri; |
| ... | ... | @@ -817,7 +811,7 @@ pub const Session = struct { |
| 817 | 811 | pub fn listRefs(session: Session, options: ListRefsOptions) !RefIterator { |
| 818 | 812 | var upload_pack_uri = session.location.uri; |
| 819 | 813 | { |
| 820 | const session_uri_path = try std.fmt.allocPrint(session.allocator, "{path}", .{session.location.uri.path}); | |
| 814 | const session_uri_path = try std.fmt.allocPrint(session.allocator, "{fpath}", .{session.location.uri.path}); | |
| 821 | 815 | defer session.allocator.free(session_uri_path); |
| 822 | 816 | upload_pack_uri.path = .{ .percent_encoded = try std.fs.path.resolvePosix(session.allocator, &.{ "/", session_uri_path, "git-upload-pack" }) }; |
| 823 | 817 | } |
| ... | ... | @@ -932,7 +926,7 @@ pub const Session = struct { |
| 932 | 926 | ) !FetchStream { |
| 933 | 927 | var upload_pack_uri = session.location.uri; |
| 934 | 928 | { |
| 935 | const session_uri_path = try std.fmt.allocPrint(session.allocator, "{path}", .{session.location.uri.path}); | |
| 929 | const session_uri_path = try std.fmt.allocPrint(session.allocator, "{fpath}", .{session.location.uri.path}); | |
| 936 | 930 | defer session.allocator.free(session_uri_path); |
| 937 | 931 | upload_pack_uri.path = .{ .percent_encoded = try std.fs.path.resolvePosix(session.allocator, &.{ "/", session_uri_path, "git-upload-pack" }) }; |
| 938 | 932 | } |
src/codegen/c.zig+26-26| ... | ... | @@ -1563,7 +1563,7 @@ pub const DeclGen = struct { |
| 1563 | 1563 | .payload => { |
| 1564 | 1564 | try writer.writeByte('{'); |
| 1565 | 1565 | if (field_ty.hasRuntimeBits(zcu)) { |
| 1566 | try writer.print(" .{ } = ", .{fmtIdentSolo(field_name.toSlice(ip))}); | |
| 1566 | try writer.print(" .{f} = ", .{fmtIdentSolo(field_name.toSlice(ip))}); | |
| 1567 | 1567 | try dg.renderValue( |
| 1568 | 1568 | writer, |
| 1569 | 1569 | Value.fromInterned(un.val), |
| ... | ... | @@ -1667,7 +1667,7 @@ pub const DeclGen = struct { |
| 1667 | 1667 | try writer.writeAll("{("); |
| 1668 | 1668 | const ptr_ty = ty.slicePtrFieldType(zcu); |
| 1669 | 1669 | try dg.renderType(writer, ptr_ty); |
| 1670 | return writer.print("){f}, {0x}}}", .{ | |
| 1670 | return writer.print("){f}, {0fx}}}", .{ | |
| 1671 | 1671 | try dg.fmtIntLiteralHex(.undef_usize, .Other), |
| 1672 | 1672 | }); |
| 1673 | 1673 | }, |
| ... | ... | @@ -1972,17 +1972,17 @@ pub const DeclGen = struct { |
| 1972 | 1972 | const is_mangled = isMangledIdent(extern_name, true); |
| 1973 | 1973 | const is_export = @"export".extern_name != @"export".main_name; |
| 1974 | 1974 | if (is_mangled and is_export) { |
| 1975 | try w.print(" zig_mangled_export({ }, {s}, {s})", .{ | |
| 1975 | try w.print(" zig_mangled_export({f}, {f}, {f})", .{ | |
| 1976 | 1976 | fmtIdentSolo(extern_name), |
| 1977 | 1977 | fmtStringLiteral(extern_name, null), |
| 1978 | 1978 | fmtStringLiteral(@"export".main_name.toSlice(ip), null), |
| 1979 | 1979 | }); |
| 1980 | 1980 | } else if (is_mangled) { |
| 1981 | try w.print(" zig_mangled({ }, {s})", .{ | |
| 1981 | try w.print(" zig_mangled({f}, {f})", .{ | |
| 1982 | 1982 | fmtIdentSolo(extern_name), fmtStringLiteral(extern_name, null), |
| 1983 | 1983 | }); |
| 1984 | 1984 | } else if (is_export) { |
| 1985 | try w.print(" zig_export({s}, {s})", .{ | |
| 1985 | try w.print(" zig_export({f}, {f})", .{ | |
| 1986 | 1986 | fmtStringLiteral(@"export".main_name.toSlice(ip), null), |
| 1987 | 1987 | fmtStringLiteral(extern_name, null), |
| 1988 | 1988 | }); |
| ... | ... | @@ -2210,7 +2210,7 @@ pub const DeclGen = struct { |
| 2210 | 2210 | .new_local, .local => |i| try w.print("t{d}", .{i}), |
| 2211 | 2211 | .constant => |uav| try renderUavName(w, uav), |
| 2212 | 2212 | .nav => |nav| try dg.renderNavName(w, nav), |
| 2213 | .identifier => |ident| try w.print("{ }", .{fmtIdentSolo(ident)}), | |
| 2213 | .identifier => |ident| try w.print("{f}", .{fmtIdentSolo(ident)}), | |
| 2214 | 2214 | else => unreachable, |
| 2215 | 2215 | } |
| 2216 | 2216 | } |
| ... | ... | @@ -2227,8 +2227,8 @@ pub const DeclGen = struct { |
| 2227 | 2227 | try dg.renderNavName(w, nav); |
| 2228 | 2228 | }, |
| 2229 | 2229 | .undef => |ty| try dg.renderUndefValue(w, ty, .Other), |
| 2230 | .identifier => |ident| try w.print("{ }", .{fmtIdentSolo(ident)}), | |
| 2231 | .payload_identifier => |ident| try w.print("{ }.{ }", .{ | |
| 2230 | .identifier => |ident| try w.print("{f}", .{fmtIdentSolo(ident)}), | |
| 2231 | .payload_identifier => |ident| try w.print("{f}.{f}", .{ | |
| 2232 | 2232 | fmtIdentSolo("payload"), |
| 2233 | 2233 | fmtIdentSolo(ident), |
| 2234 | 2234 | }), |
| ... | ... | @@ -2257,8 +2257,8 @@ pub const DeclGen = struct { |
| 2257 | 2257 | }, |
| 2258 | 2258 | .nav_ref => |nav| try dg.renderNavName(w, nav), |
| 2259 | 2259 | .undef => unreachable, |
| 2260 | .identifier => |ident| try w.print("(*{ })", .{fmtIdentSolo(ident)}), | |
| 2261 | .payload_identifier => |ident| try w.print("(*{ }.{ })", .{ | |
| 2260 | .identifier => |ident| try w.print("(*{f})", .{fmtIdentSolo(ident)}), | |
| 2261 | .payload_identifier => |ident| try w.print("(*{f}.{f})", .{ | |
| 2262 | 2262 | fmtIdentSolo("payload"), |
| 2263 | 2263 | fmtIdentSolo(ident), |
| 2264 | 2264 | }), |
| ... | ... | @@ -2345,7 +2345,7 @@ pub const DeclGen = struct { |
| 2345 | 2345 | const ip = &zcu.intern_pool; |
| 2346 | 2346 | const nav = ip.getNav(nav_index); |
| 2347 | 2347 | if (nav.getExtern(ip)) |@"extern"| { |
| 2348 | try writer.print("{ }", .{ | |
| 2348 | try writer.print("{f}", .{ | |
| 2349 | 2349 | fmtIdentSolo(ip.getNav(@"extern".owner_nav).name.toSlice(ip)), |
| 2350 | 2350 | }); |
| 2351 | 2351 | } else { |
| ... | ... | @@ -2790,7 +2790,7 @@ pub fn genTypeDecl( |
| 2790 | 2790 | |
| 2791 | 2791 | pub fn genGlobalAsm(zcu: *Zcu, writer: anytype) !void { |
| 2792 | 2792 | for (zcu.global_assembly.values()) |asm_source| { |
| 2793 | try writer.print("__asm({s});\n", .{fmtStringLiteral(asm_source, null)}); | |
| 2793 | try writer.print("__asm({f});\n", .{fmtStringLiteral(asm_source, null)}); | |
| 2794 | 2794 | } |
| 2795 | 2795 | } |
| 2796 | 2796 | |
| ... | ... | @@ -3063,7 +3063,7 @@ fn genFunc(f: *Function) !void { |
| 3063 | 3063 | try fwd.writeAll(";\n"); |
| 3064 | 3064 | |
| 3065 | 3065 | if (nav.status.fully_resolved.@"linksection".toSlice(ip)) |s| |
| 3066 | try o.writer().print("zig_linksection_fn({s}) ", .{fmtStringLiteral(s, null)}); | |
| 3066 | try o.writer().print("zig_linksection_fn({f}) ", .{fmtStringLiteral(s, null)}); | |
| 3067 | 3067 | try o.dg.renderFunctionSignature( |
| 3068 | 3068 | o.writer(), |
| 3069 | 3069 | nav_val, |
| ... | ... | @@ -3176,7 +3176,7 @@ pub fn genDecl(o: *Object) !void { |
| 3176 | 3176 | const w = o.writer(); |
| 3177 | 3177 | if (variable.is_threadlocal and !o.dg.mod.single_threaded) try w.writeAll("zig_threadlocal "); |
| 3178 | 3178 | if (nav.status.fully_resolved.@"linksection".toSlice(&zcu.intern_pool)) |s| |
| 3179 | try w.print("zig_linksection({s}) ", .{fmtStringLiteral(s, null)}); | |
| 3179 | try w.print("zig_linksection({f}) ", .{fmtStringLiteral(s, null)}); | |
| 3180 | 3180 | try o.dg.renderTypeAndName( |
| 3181 | 3181 | w, |
| 3182 | 3182 | nav_ty, |
| ... | ... | @@ -3217,7 +3217,7 @@ pub fn genDeclValue( |
| 3217 | 3217 | |
| 3218 | 3218 | const w = o.writer(); |
| 3219 | 3219 | if (@"linksection".toSlice(&zcu.intern_pool)) |s| |
| 3220 | try w.print("zig_linksection({s}) ", .{fmtStringLiteral(s, null)}); | |
| 3220 | try w.print("zig_linksection({f}) ", .{fmtStringLiteral(s, null)}); | |
| 3221 | 3221 | try o.dg.renderTypeAndName(w, ty, decl_c_value, Const, alignment, .complete); |
| 3222 | 3222 | try w.writeAll(" = "); |
| 3223 | 3223 | try o.dg.renderValue(w, val, .StaticInitializer); |
| ... | ... | @@ -3236,7 +3236,7 @@ pub fn genExports(dg: *DeclGen, exported: Zcu.Exported, export_indices: []const |
| 3236 | 3236 | .uav => |uav| try DeclGen.renderUavName(fwd, Value.fromInterned(uav)), |
| 3237 | 3237 | } |
| 3238 | 3238 | try fwd.writeByte(' '); |
| 3239 | try fwd.print("{ }", .{fmtIdentSolo(main_name.toSlice(ip))}); | |
| 3239 | try fwd.print("{f}", .{fmtIdentSolo(main_name.toSlice(ip))}); | |
| 3240 | 3240 | try fwd.writeByte('\n'); |
| 3241 | 3241 | |
| 3242 | 3242 | const exported_val = exported.getValue(zcu); |
| ... | ... | @@ -3266,7 +3266,7 @@ pub fn genExports(dg: *DeclGen, exported: Zcu.Exported, export_indices: []const |
| 3266 | 3266 | const @"export" = export_index.ptr(zcu); |
| 3267 | 3267 | try fwd.writeAll("zig_extern "); |
| 3268 | 3268 | if (@"export".opts.linkage == .weak) try fwd.writeAll("zig_weak_linkage "); |
| 3269 | if (@"export".opts.section.toSlice(ip)) |s| try fwd.print("zig_linksection({s}) ", .{ | |
| 3269 | if (@"export".opts.section.toSlice(ip)) |s| try fwd.print("zig_linksection({f}) ", .{ | |
| 3270 | 3270 | fmtStringLiteral(s, null), |
| 3271 | 3271 | }); |
| 3272 | 3272 | const extern_name = @"export".opts.name.toSlice(ip); |
| ... | ... | @@ -3281,17 +3281,17 @@ pub fn genExports(dg: *DeclGen, exported: Zcu.Exported, export_indices: []const |
| 3281 | 3281 | .complete, |
| 3282 | 3282 | ); |
| 3283 | 3283 | if (is_mangled and is_export) { |
| 3284 | try fwd.print(" zig_mangled_export({ }, {s}, {s})", .{ | |
| 3284 | try fwd.print(" zig_mangled_export({f}, {f}, {f})", .{ | |
| 3285 | 3285 | fmtIdentSolo(extern_name), |
| 3286 | 3286 | fmtStringLiteral(extern_name, null), |
| 3287 | 3287 | fmtStringLiteral(main_name.toSlice(ip), null), |
| 3288 | 3288 | }); |
| 3289 | 3289 | } else if (is_mangled) { |
| 3290 | try fwd.print(" zig_mangled({ }, {s})", .{ | |
| 3290 | try fwd.print(" zig_mangled({f}, {f})", .{ | |
| 3291 | 3291 | fmtIdentSolo(extern_name), fmtStringLiteral(extern_name, null), |
| 3292 | 3292 | }); |
| 3293 | 3293 | } else if (is_export) { |
| 3294 | try fwd.print(" zig_export({s}, {s})", .{ | |
| 3294 | try fwd.print(" zig_export({f}, {f})", .{ | |
| 3295 | 3295 | fmtStringLiteral(main_name.toSlice(ip), null), |
| 3296 | 3296 | fmtStringLiteral(extern_name, null), |
| 3297 | 3297 | }); |
| ... | ... | @@ -4570,7 +4570,7 @@ fn airCmpLtErrorsLen(f: *Function, inst: Air.Inst.Index) !CValue { |
| 4570 | 4570 | try f.writeCValue(writer, local, .Other); |
| 4571 | 4571 | try writer.writeAll(" = "); |
| 4572 | 4572 | try f.writeCValue(writer, operand, .Other); |
| 4573 | try writer.print(" < sizeof({ }) / sizeof(*{0 });\n", .{fmtIdentSolo("zig_errorName")}); | |
| 4573 | try writer.print(" < sizeof({f}) / sizeof(*{0f});\n", .{fmtIdentSolo("zig_errorName")}); | |
| 4574 | 4574 | return local; |
| 4575 | 4575 | } |
| 4576 | 4576 | |
| ... | ... | @@ -5644,7 +5644,7 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue { |
| 5644 | 5644 | |
| 5645 | 5645 | try writer.writeAll("__asm"); |
| 5646 | 5646 | if (is_volatile) try writer.writeAll(" volatile"); |
| 5647 | try writer.print("({s}", .{fmtStringLiteral(fixed_asm_source[0..dst_i], null)}); | |
| 5647 | try writer.print("({f}", .{fmtStringLiteral(fixed_asm_source[0..dst_i], null)}); | |
| 5648 | 5648 | } |
| 5649 | 5649 | |
| 5650 | 5650 | extra_i = constraints_extra_begin; |
| ... | ... | @@ -5662,7 +5662,7 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue { |
| 5662 | 5662 | try writer.writeByte(' '); |
| 5663 | 5663 | if (!mem.eql(u8, name, "_")) try writer.print("[{s}]", .{name}); |
| 5664 | 5664 | const is_reg = constraint[1] == '{'; |
| 5665 | try writer.print("{s}(", .{fmtStringLiteral(if (is_reg) "=r" else constraint, null)}); | |
| 5665 | try writer.print("{f}(", .{fmtStringLiteral(if (is_reg) "=r" else constraint, null)}); | |
| 5666 | 5666 | if (is_reg) { |
| 5667 | 5667 | try f.writeCValue(writer, .{ .local = locals_index }, .Other); |
| 5668 | 5668 | locals_index += 1; |
| ... | ... | @@ -5688,7 +5688,7 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue { |
| 5688 | 5688 | |
| 5689 | 5689 | const is_reg = constraint[0] == '{'; |
| 5690 | 5690 | const input_val = try f.resolveInst(input); |
| 5691 | try writer.print("{s}(", .{fmtStringLiteral(if (is_reg) "r" else constraint, null)}); | |
| 5691 | try writer.print("{f}(", .{fmtStringLiteral(if (is_reg) "r" else constraint, null)}); | |
| 5692 | 5692 | try f.writeCValue(writer, if (asmInputNeedsLocal(f, constraint, input_val)) local: { |
| 5693 | 5693 | const input_local_idx = locals_index; |
| 5694 | 5694 | locals_index += 1; |
| ... | ... | @@ -5706,7 +5706,7 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue { |
| 5706 | 5706 | if (clobber.len == 0) continue; |
| 5707 | 5707 | |
| 5708 | 5708 | if (clobber_i > 0) try writer.writeByte(','); |
| 5709 | try writer.print(" {s}", .{fmtStringLiteral(clobber, null)}); | |
| 5709 | try writer.print(" {f}", .{fmtStringLiteral(clobber, null)}); | |
| 5710 | 5710 | } |
| 5711 | 5711 | try writer.writeAll(");\n"); |
| 5712 | 5712 | |
| ... | ... | @@ -8160,7 +8160,7 @@ fn StringLiteral(comptime WriterType: type) type { |
| 8160 | 8160 | cur_len: u64 = 0, |
| 8161 | 8161 | counting_writer: std.io.CountingWriter(WriterType), |
| 8162 | 8162 | |
| 8163 | pub const Error = WriterType.Error; | |
| 8163 | pub const Error = if (WriterType == *std.io.Writer) error{WriteFailed} else WriterType.Error; | |
| 8164 | 8164 | |
| 8165 | 8165 | const Self = @This(); |
| 8166 | 8166 |
src/link.zig+9-9| ... | ... | @@ -838,7 +838,7 @@ pub const File = struct { |
| 838 | 838 | const cached_pp_file_path = the_key.status.success.object_path; |
| 839 | 839 | cached_pp_file_path.root_dir.handle.copyFile(cached_pp_file_path.sub_path, emit.root_dir.handle, emit.sub_path, .{}) catch |err| { |
| 840 | 840 | const diags = &base.comp.link_diags; |
| 841 | return diags.fail("failed to copy '{'}' to '{'}': {s}", .{ | |
| 841 | return diags.fail("failed to copy '{f'}' to '{f'}': {s}", .{ | |
| 842 | 842 | @as(Path, cached_pp_file_path), @as(Path, emit), @errorName(err), |
| 843 | 843 | }); |
| 844 | 844 | }; |
| ... | ... | @@ -2086,13 +2086,13 @@ fn resolvePathInputLib( |
| 2086 | 2086 | }) { |
| 2087 | 2087 | var file = test_path.root_dir.handle.openFile(test_path.sub_path, .{}) catch |err| switch (err) { |
| 2088 | 2088 | error.FileNotFound => return .no_match, |
| 2089 | else => |e| fatal("unable to search for {s} library '{'}': {s}", .{ | |
| 2089 | else => |e| fatal("unable to search for {s} library '{f'}': {s}", .{ | |
| 2090 | 2090 | @tagName(link_mode), test_path, @errorName(e), |
| 2091 | 2091 | }), |
| 2092 | 2092 | }; |
| 2093 | 2093 | errdefer file.close(); |
| 2094 | 2094 | try ld_script_bytes.resize(gpa, @max(std.elf.MAGIC.len, std.elf.ARMAG.len)); |
| 2095 | const n = file.preadAll(ld_script_bytes.items, 0) catch |err| fatal("failed to read '{'}': {s}", .{ | |
| 2095 | const n = file.preadAll(ld_script_bytes.items, 0) catch |err| fatal("failed to read '{f'}': {s}", .{ | |
| 2096 | 2096 | test_path, @errorName(err), |
| 2097 | 2097 | }); |
| 2098 | 2098 | const buf = ld_script_bytes.items[0..n]; |
| ... | ... | @@ -2101,14 +2101,14 @@ fn resolvePathInputLib( |
| 2101 | 2101 | return finishResolveLibInput(resolved_inputs, test_path, file, link_mode, pq.query); |
| 2102 | 2102 | } |
| 2103 | 2103 | const stat = file.stat() catch |err| |
| 2104 | fatal("failed to stat {}: {s}", .{ test_path, @errorName(err) }); | |
| 2104 | fatal("failed to stat {f}: {s}", .{ test_path, @errorName(err) }); | |
| 2105 | 2105 | const size = std.math.cast(u32, stat.size) orelse |
| 2106 | fatal("{}: linker script too big", .{test_path}); | |
| 2106 | fatal("{f}: linker script too big", .{test_path}); | |
| 2107 | 2107 | try ld_script_bytes.resize(gpa, size); |
| 2108 | 2108 | const buf2 = ld_script_bytes.items[n..]; |
| 2109 | 2109 | const n2 = file.preadAll(buf2, n) catch |err| |
| 2110 | fatal("failed to read {}: {s}", .{ test_path, @errorName(err) }); | |
| 2111 | if (n2 != buf2.len) fatal("failed to read {}: unexpected end of file", .{test_path}); | |
| 2110 | fatal("failed to read {f}: {s}", .{ test_path, @errorName(err) }); | |
| 2111 | if (n2 != buf2.len) fatal("failed to read {f}: unexpected end of file", .{test_path}); | |
| 2112 | 2112 | var diags = Diags.init(gpa); |
| 2113 | 2113 | defer diags.deinit(); |
| 2114 | 2114 | const ld_script_result = LdScript.parse(gpa, &diags, test_path, ld_script_bytes.items); |
| ... | ... | @@ -2128,7 +2128,7 @@ fn resolvePathInputLib( |
| 2128 | 2128 | } |
| 2129 | 2129 | |
| 2130 | 2130 | var ld_script = ld_script_result catch |err| |
| 2131 | fatal("{}: failed to parse linker script: {s}", .{ test_path, @errorName(err) }); | |
| 2131 | fatal("{f}: failed to parse linker script: {s}", .{ test_path, @errorName(err) }); | |
| 2132 | 2132 | defer ld_script.deinit(gpa); |
| 2133 | 2133 | |
| 2134 | 2134 | try unresolved_inputs.ensureUnusedCapacity(gpa, ld_script.args.len); |
| ... | ... | @@ -2159,7 +2159,7 @@ fn resolvePathInputLib( |
| 2159 | 2159 | |
| 2160 | 2160 | var file = test_path.root_dir.handle.openFile(test_path.sub_path, .{}) catch |err| switch (err) { |
| 2161 | 2161 | error.FileNotFound => return .no_match, |
| 2162 | else => |e| fatal("unable to search for {s} library {}: {s}", .{ | |
| 2162 | else => |e| fatal("unable to search for {s} library {f}: {s}", .{ | |
| 2163 | 2163 | @tagName(link_mode), test_path, @errorName(e), |
| 2164 | 2164 | }), |
| 2165 | 2165 | }; |
src/link/C.zig+1-1| ... | ... | @@ -493,7 +493,7 @@ pub fn flush(self: *C, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.P |
| 493 | 493 | |
| 494 | 494 | const file = self.base.file.?; |
| 495 | 495 | file.setEndPos(f.file_size) catch |err| return diags.fail("failed to allocate file: {s}", .{@errorName(err)}); |
| 496 | file.pwritevAll(f.all_buffers.items, 0) catch |err| return diags.fail("failed to write to '{'}': {s}", .{ | |
| 496 | file.pwritevAll(f.all_buffers.items, 0) catch |err| return diags.fail("failed to write to '{f'}': {s}", .{ | |
| 497 | 497 | self.base.emit, @errorName(err), |
| 498 | 498 | }); |
| 499 | 499 | } |
src/link/Coff.zig+1-1| ... | ... | @@ -2588,7 +2588,7 @@ fn logSymtab(coff: *Coff) void { |
| 2588 | 2588 | .DEBUG => unreachable, // TODO |
| 2589 | 2589 | else => @intFromEnum(sym.section_number), |
| 2590 | 2590 | }; |
| 2591 | log.debug(" %{d}: {?s} @{x} in {s}({d}), {s}", .{ | |
| 2591 | log.debug(" %{d}: {s} @{x} in {s}({d}), {s}", .{ | |
| 2592 | 2592 | sym_id, |
| 2593 | 2593 | coff.getSymbolName(.{ .sym_index = @as(u32, @intCast(sym_id)), .file = null }), |
| 2594 | 2594 | sym.value, |
src/link/Elf.zig+8-8| ... | ... | @@ -3544,7 +3544,7 @@ pub fn addRelaDyn(self: *Elf, opts: RelaDyn) !void { |
| 3544 | 3544 | } |
| 3545 | 3545 | |
| 3546 | 3546 | pub fn addRelaDynAssumeCapacity(self: *Elf, opts: RelaDyn) void { |
| 3547 | relocs_log.debug(" {s}: [{x} => {d}({s})] + {x}", .{ | |
| 3547 | relocs_log.debug(" {f}: [{x} => {d}({s})] + {x}", .{ | |
| 3548 | 3548 | relocation.fmtRelocType(opts.type, self.getTarget().cpu.arch), |
| 3549 | 3549 | opts.offset, |
| 3550 | 3550 | opts.sym, |
| ... | ... | @@ -3791,7 +3791,7 @@ fn reportUndefinedSymbols(self: *Elf, undefs: anytype) !void { |
| 3791 | 3791 | for (refs.items[0..nrefs]) |ref| { |
| 3792 | 3792 | const atom_ptr = self.atom(ref).?; |
| 3793 | 3793 | const file_ptr = atom_ptr.file(self).?; |
| 3794 | err.addNote("referenced by {s}:{s}", .{ file_ptr.fmtPath(), atom_ptr.name(self) }); | |
| 3794 | err.addNote("referenced by {f}:{s}", .{ file_ptr.fmtPath(), atom_ptr.name(self) }); | |
| 3795 | 3795 | } |
| 3796 | 3796 | |
| 3797 | 3797 | if (refs.items.len > max_notes) { |
| ... | ... | @@ -4020,19 +4020,19 @@ fn fmtDumpState(self: *Elf, writer: *std.io.Writer) std.io.Writer.Error!void { |
| 4020 | 4020 | { |
| 4021 | 4021 | try writer.writeAll("atom lists\n"); |
| 4022 | 4022 | for (slice.items(.shdr), slice.items(.atom_list_2), 0..) |shdr, atom_list, shndx| { |
| 4023 | try writer.print("shdr({d}) : {s} : {}\n", .{ shndx, self.getShString(shdr.sh_name), atom_list.fmt(self) }); | |
| 4023 | try writer.print("shdr({d}) : {s} : {f}\n", .{ shndx, self.getShString(shdr.sh_name), atom_list.fmt(self) }); | |
| 4024 | 4024 | } |
| 4025 | 4025 | } |
| 4026 | 4026 | |
| 4027 | 4027 | if (self.requiresThunks()) { |
| 4028 | 4028 | try writer.writeAll("thunks\n"); |
| 4029 | 4029 | for (self.thunks.items, 0..) |th, index| { |
| 4030 | try writer.print("thunk({d}) : {}\n", .{ index, th.fmt(self) }); | |
| 4030 | try writer.print("thunk({d}) : {f}\n", .{ index, th.fmt(self) }); | |
| 4031 | 4031 | } |
| 4032 | 4032 | } |
| 4033 | 4033 | |
| 4034 | try writer.print("{}\n", .{self.got.fmt(self)}); | |
| 4035 | try writer.print("{}\n", .{self.plt.fmt(self)}); | |
| 4034 | try writer.print("{f}\n", .{self.got.fmt(self)}); | |
| 4035 | try writer.print("{f}\n", .{self.plt.fmt(self)}); | |
| 4036 | 4036 | |
| 4037 | 4037 | try writer.writeAll("Output groups\n"); |
| 4038 | 4038 | for (self.group_sections.items) |cg| { |
| ... | ... | @@ -4041,7 +4041,7 @@ fn fmtDumpState(self: *Elf, writer: *std.io.Writer) std.io.Writer.Error!void { |
| 4041 | 4041 | |
| 4042 | 4042 | try writer.writeAll("\nOutput merge sections\n"); |
| 4043 | 4043 | for (self.merge_sections.items) |msec| { |
| 4044 | try writer.print(" shdr({d}) : {}\n", .{ msec.output_section_index, msec.fmt(self) }); | |
| 4044 | try writer.print(" shdr({d}) : {f}\n", .{ msec.output_section_index, msec.fmt(self) }); | |
| 4045 | 4045 | } |
| 4046 | 4046 | |
| 4047 | 4047 | try writer.writeAll("\nOutput shdrs\n"); |
| ... | ... | @@ -4424,7 +4424,7 @@ fn createThunks(elf_file: *Elf, atom_list: *AtomList) !void { |
| 4424 | 4424 | |
| 4425 | 4425 | thunk_ptr.value = try advance(atom_list, thunk_ptr.size(elf_file), Atom.Alignment.fromNonzeroByteUnits(2)); |
| 4426 | 4426 | |
| 4427 | log.debug("thunk({d}) : {}", .{ thunk_index, thunk_ptr.fmt(elf_file) }); | |
| 4427 | log.debug("thunk({d}) : {f}", .{ thunk_index, thunk_ptr.fmt(elf_file) }); | |
| 4428 | 4428 | } |
| 4429 | 4429 | } |
| 4430 | 4430 |
src/link/Elf/Atom.zig+2-2| ... | ... | @@ -243,7 +243,7 @@ pub fn writeRelocs(self: Atom, elf_file: *Elf, out_relocs: *std.ArrayList(elf.El |
| 243 | 243 | }, |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | relocs_log.debug(" {s}: [{x} => {d}({s})] + {x}", .{ | |
| 246 | relocs_log.debug(" {f}: [{x} => {d}({s})] + {x}", .{ | |
| 247 | 247 | relocation.fmtRelocType(rel.r_type(), cpu_arch), |
| 248 | 248 | r_offset, |
| 249 | 249 | r_sym, |
| ... | ... | @@ -652,7 +652,7 @@ pub fn resolveRelocsAlloc(self: Atom, elf_file: *Elf, code: []u8) RelocError!voi |
| 652 | 652 | // Address of the dynamic thread pointer. |
| 653 | 653 | const DTP = elf_file.dtpAddress(); |
| 654 | 654 | |
| 655 | relocs_log.debug(" {s}: {x}: [{x} => {x}] GOT({x}) ({s})", .{ | |
| 655 | relocs_log.debug(" {f}: {x}: [{x} => {x}] GOT({x}) ({s})", .{ | |
| 656 | 656 | relocation.fmtRelocType(rel.r_type(), cpu_arch), |
| 657 | 657 | r_offset, |
| 658 | 658 | P, |
src/link/Elf/Object.zig+7-10| ... | ... | @@ -488,10 +488,7 @@ fn parseEhFrame( |
| 488 | 488 | if (cie.offset == cie_ptr) break @as(u32, @intCast(cie_index)); |
| 489 | 489 | } else { |
| 490 | 490 | // TODO convert into an error |
| 491 | log.debug("{s}: no matching CIE found for FDE at offset {x}", .{ | |
| 492 | self.fmtPath(), | |
| 493 | fde.offset, | |
| 494 | }); | |
| 491 | log.debug("{f}: no matching CIE found for FDE at offset {x}", .{ self.fmtPath(), fde.offset }); | |
| 495 | 492 | continue; |
| 496 | 493 | }; |
| 497 | 494 | fde.cie_index = cie_index; |
| ... | ... | @@ -582,7 +579,7 @@ pub fn scanRelocs(self: *Object, elf_file: *Elf, undefs: anytype) !void { |
| 582 | 579 | if (sym.flags.import) { |
| 583 | 580 | if (sym.type(elf_file) != elf.STT_FUNC) |
| 584 | 581 | // TODO convert into an error |
| 585 | log.debug("{s}: {s}: CIE referencing external data reference", .{ | |
| 582 | log.debug("{f}: {s}: CIE referencing external data reference", .{ | |
| 586 | 583 | self.fmtPath(), sym.name(elf_file), |
| 587 | 584 | }); |
| 588 | 585 | sym.flags.needs_plt = true; |
| ... | ... | @@ -1448,14 +1445,14 @@ const Format = struct { |
| 1448 | 1445 | const elf_file = f.elf_file; |
| 1449 | 1446 | try writer.writeAll(" locals\n"); |
| 1450 | 1447 | for (object.locals()) |sym| { |
| 1451 | try writer.print(" {}\n", .{sym.fmt(elf_file)}); | |
| 1448 | try writer.print(" {f}\n", .{sym.fmt(elf_file)}); | |
| 1452 | 1449 | } |
| 1453 | 1450 | try writer.writeAll(" globals\n"); |
| 1454 | 1451 | for (object.globals(), 0..) |sym, i| { |
| 1455 | 1452 | const first_global = object.first_global.?; |
| 1456 | 1453 | const ref = object.resolveSymbol(@intCast(i + first_global), elf_file); |
| 1457 | 1454 | if (elf_file.symbol(ref)) |ref_sym| { |
| 1458 | try writer.print(" {}\n", .{ref_sym.fmt(elf_file)}); | |
| 1455 | try writer.print(" {f}\n", .{ref_sym.fmt(elf_file)}); | |
| 1459 | 1456 | } else { |
| 1460 | 1457 | try writer.print(" {s} : unclaimed\n", .{sym.name(elf_file)}); |
| 1461 | 1458 | } |
| ... | ... | @@ -1467,7 +1464,7 @@ const Format = struct { |
| 1467 | 1464 | try writer.writeAll(" atoms\n"); |
| 1468 | 1465 | for (object.atoms_indexes.items) |atom_index| { |
| 1469 | 1466 | const atom_ptr = object.atom(atom_index) orelse continue; |
| 1470 | try writer.print(" {}\n", .{atom_ptr.fmt(f.elf_file)}); | |
| 1467 | try writer.print(" {f}\n", .{atom_ptr.fmt(f.elf_file)}); | |
| 1471 | 1468 | } |
| 1472 | 1469 | } |
| 1473 | 1470 | |
| ... | ... | @@ -1475,7 +1472,7 @@ const Format = struct { |
| 1475 | 1472 | const object = f.object; |
| 1476 | 1473 | try writer.writeAll(" cies\n"); |
| 1477 | 1474 | for (object.cies.items, 0..) |cie, i| { |
| 1478 | try writer.print(" cie({d}) : {}\n", .{ i, cie.fmt(f.elf_file) }); | |
| 1475 | try writer.print(" cie({d}) : {f}\n", .{ i, cie.fmt(f.elf_file) }); | |
| 1479 | 1476 | } |
| 1480 | 1477 | } |
| 1481 | 1478 | |
| ... | ... | @@ -1483,7 +1480,7 @@ const Format = struct { |
| 1483 | 1480 | const object = f.object; |
| 1484 | 1481 | try writer.writeAll(" fdes\n"); |
| 1485 | 1482 | for (object.fdes.items, 0..) |fde, i| { |
| 1486 | try writer.print(" fde({d}) : {}\n", .{ i, fde.fmt(f.elf_file) }); | |
| 1483 | try writer.print(" fde({d}) : {f}\n", .{ i, fde.fmt(f.elf_file) }); | |
| 1487 | 1484 | } |
| 1488 | 1485 | } |
| 1489 | 1486 |
src/link/Elf/ZigObject.zig+14-14| ... | ... | @@ -925,7 +925,7 @@ pub fn getNavVAddr( |
| 925 | 925 | const zcu = pt.zcu; |
| 926 | 926 | const ip = &zcu.intern_pool; |
| 927 | 927 | const nav = ip.getNav(nav_index); |
| 928 | log.debug("getNavVAddr {}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 928 | log.debug("getNavVAddr {f}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 929 | 929 | const this_sym_index = if (nav.getExtern(ip)) |@"extern"| try self.getGlobalSymbol( |
| 930 | 930 | elf_file, |
| 931 | 931 | nav.name.toSlice(ip), |
| ... | ... | @@ -1268,7 +1268,7 @@ fn updateNavCode( |
| 1268 | 1268 | const ip = &zcu.intern_pool; |
| 1269 | 1269 | const nav = ip.getNav(nav_index); |
| 1270 | 1270 | |
| 1271 | log.debug("updateNavCode {}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 1271 | log.debug("updateNavCode {f}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 1272 | 1272 | |
| 1273 | 1273 | const target = &zcu.navFileScope(nav_index).mod.?.resolved_target.result; |
| 1274 | 1274 | const required_alignment = switch (pt.navAlignment(nav_index)) { |
| ... | ... | @@ -1302,7 +1302,7 @@ fn updateNavCode( |
| 1302 | 1302 | self.allocateAtom(atom_ptr, true, elf_file) catch |err| |
| 1303 | 1303 | return elf_file.base.cgFail(nav_index, "failed to allocate atom: {s}", .{@errorName(err)}); |
| 1304 | 1304 | |
| 1305 | log.debug("growing {} from 0x{x} to 0x{x}", .{ nav.fqn.fmt(ip), old_vaddr, atom_ptr.value }); | |
| 1305 | log.debug("growing {f} from 0x{x} to 0x{x}", .{ nav.fqn.fmt(ip), old_vaddr, atom_ptr.value }); | |
| 1306 | 1306 | if (old_vaddr != atom_ptr.value) { |
| 1307 | 1307 | sym.value = 0; |
| 1308 | 1308 | esym.st_value = 0; |
| ... | ... | @@ -1347,7 +1347,7 @@ fn updateNavCode( |
| 1347 | 1347 | const file_offset = atom_ptr.offset(elf_file); |
| 1348 | 1348 | elf_file.base.file.?.pwriteAll(code, file_offset) catch |err| |
| 1349 | 1349 | return elf_file.base.cgFail(nav_index, "failed to write to output file: {s}", .{@errorName(err)}); |
| 1350 | log.debug("writing {} from 0x{x} to 0x{x}", .{ nav.fqn.fmt(ip), file_offset, file_offset + code.len }); | |
| 1350 | log.debug("writing {f} from 0x{x} to 0x{x}", .{ nav.fqn.fmt(ip), file_offset, file_offset + code.len }); | |
| 1351 | 1351 | } |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| ... | ... | @@ -1365,7 +1365,7 @@ fn updateTlv( |
| 1365 | 1365 | const gpa = zcu.gpa; |
| 1366 | 1366 | const nav = ip.getNav(nav_index); |
| 1367 | 1367 | |
| 1368 | log.debug("updateTlv {}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 1368 | log.debug("updateTlv {f}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 1369 | 1369 | |
| 1370 | 1370 | const required_alignment = pt.navAlignment(nav_index); |
| 1371 | 1371 | |
| ... | ... | @@ -1424,7 +1424,7 @@ pub fn updateFunc( |
| 1424 | 1424 | const gpa = elf_file.base.comp.gpa; |
| 1425 | 1425 | const func = zcu.funcInfo(func_index); |
| 1426 | 1426 | |
| 1427 | log.debug("updateFunc {}({d})", .{ ip.getNav(func.owner_nav).fqn.fmt(ip), func.owner_nav }); | |
| 1427 | log.debug("updateFunc {f}({d})", .{ ip.getNav(func.owner_nav).fqn.fmt(ip), func.owner_nav }); | |
| 1428 | 1428 | |
| 1429 | 1429 | const sym_index = try self.getOrCreateMetadataForNav(zcu, func.owner_nav); |
| 1430 | 1430 | self.atom(self.symbol(sym_index).ref.index).?.freeRelocs(self); |
| ... | ... | @@ -1447,7 +1447,7 @@ pub fn updateFunc( |
| 1447 | 1447 | const code = code_buffer.items; |
| 1448 | 1448 | |
| 1449 | 1449 | const shndx = try self.getNavShdrIndex(elf_file, zcu, func.owner_nav, sym_index, code); |
| 1450 | log.debug("setting shdr({x},{s}) for {}", .{ | |
| 1450 | log.debug("setting shdr({x},{s}) for {f}", .{ | |
| 1451 | 1451 | shndx, |
| 1452 | 1452 | elf_file.getShString(elf_file.sections.items(.shdr)[shndx].sh_name), |
| 1453 | 1453 | ip.getNav(func.owner_nav).fqn.fmt(ip), |
| ... | ... | @@ -1529,7 +1529,7 @@ pub fn updateNav( |
| 1529 | 1529 | const ip = &zcu.intern_pool; |
| 1530 | 1530 | const nav = ip.getNav(nav_index); |
| 1531 | 1531 | |
| 1532 | log.debug("updateNav {}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 1532 | log.debug("updateNav {f}({d})", .{ nav.fqn.fmt(ip), nav_index }); | |
| 1533 | 1533 | |
| 1534 | 1534 | const nav_init = switch (ip.indexToKey(nav.status.fully_resolved.val)) { |
| 1535 | 1535 | .func => .none, |
| ... | ... | @@ -1576,7 +1576,7 @@ pub fn updateNav( |
| 1576 | 1576 | const code = code_buffer.items; |
| 1577 | 1577 | |
| 1578 | 1578 | const shndx = try self.getNavShdrIndex(elf_file, zcu, nav_index, sym_index, code); |
| 1579 | log.debug("setting shdr({x},{s}) for {}", .{ | |
| 1579 | log.debug("setting shdr({x},{s}) for {f}", .{ | |
| 1580 | 1580 | shndx, |
| 1581 | 1581 | elf_file.getShString(elf_file.sections.items(.shdr)[shndx].sh_name), |
| 1582 | 1582 | nav.fqn.fmt(ip), |
| ... | ... | @@ -1622,7 +1622,7 @@ fn updateLazySymbol( |
| 1622 | 1622 | defer code_buffer.deinit(gpa); |
| 1623 | 1623 | |
| 1624 | 1624 | const name_str_index = blk: { |
| 1625 | const name = try std.fmt.allocPrint(gpa, "__lazy_{s}_{}", .{ | |
| 1625 | const name = try std.fmt.allocPrint(gpa, "__lazy_{s}_{f}", .{ | |
| 1626 | 1626 | @tagName(sym.kind), |
| 1627 | 1627 | Type.fromInterned(sym.ty).fmt(pt), |
| 1628 | 1628 | }); |
| ... | ... | @@ -1941,7 +1941,7 @@ pub fn allocateAtom(self: *ZigObject, atom_ptr: *Atom, requires_padding: bool, e |
| 1941 | 1941 | .requires_padding = requires_padding, |
| 1942 | 1942 | }); |
| 1943 | 1943 | atom_ptr.value = @intCast(alloc_res.value); |
| 1944 | log.debug("allocated {s} at {x}\n placement {?}", .{ | |
| 1944 | log.debug("allocated {s} at {x}\n placement {f}", .{ | |
| 1945 | 1945 | atom_ptr.name(elf_file), |
| 1946 | 1946 | atom_ptr.offset(elf_file), |
| 1947 | 1947 | alloc_res.placement, |
| ... | ... | @@ -1986,7 +1986,7 @@ pub fn allocateAtom(self: *ZigObject, atom_ptr: *Atom, requires_padding: bool, e |
| 1986 | 1986 | atom_ptr.next_atom_ref = .{ .index = 0, .file = 0 }; |
| 1987 | 1987 | } |
| 1988 | 1988 | |
| 1989 | log.debug(" prev {?}, next {?}", .{ atom_ptr.prev_atom_ref, atom_ptr.next_atom_ref }); | |
| 1989 | log.debug(" prev {f}, next {f}", .{ atom_ptr.prev_atom_ref, atom_ptr.next_atom_ref }); | |
| 1990 | 1990 | } |
| 1991 | 1991 | |
| 1992 | 1992 | pub fn resetShdrIndexes(self: *ZigObject, backlinks: []const u32) void { |
| ... | ... | @@ -2271,7 +2271,7 @@ fn checkNavAllocated(pt: Zcu.PerThread, index: InternPool.Nav.Index, meta: AvMet |
| 2271 | 2271 | const zcu = pt.zcu; |
| 2272 | 2272 | const ip = &zcu.intern_pool; |
| 2273 | 2273 | const nav = ip.getNav(index); |
| 2274 | log.err("NAV {}({d}) assigned symbol {d} but not allocated!", .{ | |
| 2274 | log.err("NAV {f}({d}) assigned symbol {d} but not allocated!", .{ | |
| 2275 | 2275 | nav.fqn.fmt(ip), |
| 2276 | 2276 | index, |
| 2277 | 2277 | meta.symbol_index, |
| ... | ... | @@ -2284,7 +2284,7 @@ fn checkUavAllocated(pt: Zcu.PerThread, index: InternPool.Index, meta: AvMetadat |
| 2284 | 2284 | const zcu = pt.zcu; |
| 2285 | 2285 | const uav = Value.fromInterned(index); |
| 2286 | 2286 | const ty = uav.typeOf(zcu); |
| 2287 | log.err("UAV {}({d}) assigned symbol {d} but not allocated!", .{ | |
| 2287 | log.err("UAV {f}({d}) assigned symbol {d} but not allocated!", .{ | |
| 2288 | 2288 | ty.fmt(pt), |
| 2289 | 2289 | index, |
| 2290 | 2290 | meta.symbol_index, |
src/link/Elf/eh_frame.zig+2-2| ... | ... | @@ -276,7 +276,7 @@ fn resolveReloc(rec: anytype, sym: *const Symbol, rel: elf.Elf64_Rela, elf_file: |
| 276 | 276 | const S = math.cast(i64, sym.address(.{}, elf_file)) orelse return error.Overflow; |
| 277 | 277 | const A = rel.r_addend; |
| 278 | 278 | |
| 279 | relocs_log.debug(" {s}: {x}: [{x} => {x}] ({s})", .{ | |
| 279 | relocs_log.debug(" {f}: {x}: [{x} => {x}] ({s})", .{ | |
| 280 | 280 | relocation.fmtRelocType(rel.r_type(), cpu_arch), |
| 281 | 281 | offset, |
| 282 | 282 | P, |
| ... | ... | @@ -398,7 +398,7 @@ fn emitReloc(elf_file: *Elf, r_offset: u64, sym: *const Symbol, rel: elf.Elf64_R |
| 398 | 398 | }, |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | relocs_log.debug(" {s}: [{x} => {d}({s})] + {x}", .{ | |
| 401 | relocs_log.debug(" {f}: [{x} => {d}({s})] + {x}", .{ | |
| 402 | 402 | relocation.fmtRelocType(r_type, cpu_arch), |
| 403 | 403 | r_offset, |
| 404 | 404 | r_sym, |
src/link/Elf/synthetic_sections.zig+1-1| ... | ... | @@ -696,7 +696,7 @@ pub const PltSection = struct { |
| 696 | 696 | const r_sym: u64 = extra.dynamic; |
| 697 | 697 | const r_type = relocation.encode(.jump_slot, cpu_arch); |
| 698 | 698 | |
| 699 | relocs_log.debug(" {s}: [{x} => {d}({s})] + 0", .{ | |
| 699 | relocs_log.debug(" {f}: [{x} => {d}({s})] + 0", .{ | |
| 700 | 700 | relocation.fmtRelocType(r_type, cpu_arch), |
| 701 | 701 | r_offset, |
| 702 | 702 | r_sym, |
src/link/MachO/Atom.zig+1-1| ... | ... | @@ -653,7 +653,7 @@ fn resolveRelocInner( |
| 653 | 653 | const divExact = struct { |
| 654 | 654 | fn divExact(atom: Atom, r: Relocation, num: u12, den: u12, ctx: *MachO) !u12 { |
| 655 | 655 | return math.divExact(u12, num, den) catch { |
| 656 | try ctx.reportParseError2(atom.getFile(ctx).getIndex(), "{s}: unexpected remainder when resolving {s} at offset 0x{x}", .{ | |
| 656 | try ctx.reportParseError2(atom.getFile(ctx).getIndex(), "{s}: unexpected remainder when resolving {f} at offset 0x{x}", .{ | |
| 657 | 657 | atom.getName(ctx), |
| 658 | 658 | r.fmtPretty(ctx.getTarget().cpu.arch), |
| 659 | 659 | r.offset, |
src/link/MachO/dyld_info/bind.zig+2-2| ... | ... | @@ -205,7 +205,7 @@ pub const Bind = struct { |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | log.debug("{x}, {d}, {x}, {?x}, {s}", .{ offset, count, skip, addend, @tagName(state) }); | |
| 208 | log.debug("{x}, {d}, {x}, {x}, {s}", .{ offset, count, skip, addend, @tagName(state) }); | |
| 209 | 209 | log.debug(" => {x}", .{current.offset}); |
| 210 | 210 | switch (state) { |
| 211 | 211 | .start => { |
| ... | ... | @@ -447,7 +447,7 @@ pub const WeakBind = struct { |
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | log.debug("{x}, {d}, {x}, {?x}, {s}", .{ offset, count, skip, addend, @tagName(state) }); | |
| 450 | log.debug("{x}, {d}, {x}, {x}, {s}", .{ offset, count, skip, addend, @tagName(state) }); | |
| 451 | 451 | log.debug(" => {x}", .{current.offset}); |
| 452 | 452 | switch (state) { |
| 453 | 453 | .start => { |
src/link/Wasm/Flush.zig+1-1| ... | ... | @@ -534,7 +534,7 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { |
| 534 | 534 | wasm.memories.limits.max = @intCast(max_memory / page_size); |
| 535 | 535 | wasm.memories.limits.flags.has_max = true; |
| 536 | 536 | if (shared_memory) wasm.memories.limits.flags.is_shared = true; |
| 537 | log.debug("maximum memory pages: {?d}", .{wasm.memories.limits.max}); | |
| 537 | log.debug("maximum memory pages: {d}", .{wasm.memories.limits.max}); | |
| 538 | 538 | } |
| 539 | 539 | f.memory_layout_finished = true; |
| 540 | 540 |
src/print_value.zig+19-19| ... | ... | @@ -73,35 +73,35 @@ pub fn print( |
| 73 | 73 | else => try writer.writeAll(@tagName(simple_value)), |
| 74 | 74 | }, |
| 75 | 75 | .variable => try writer.writeAll("(variable)"), |
| 76 | .@"extern" => |e| try writer.print("(extern '{}')", .{e.name.fmt(ip)}), | |
| 77 | .func => |func| try writer.print("(function '{}')", .{ip.getNav(func.owner_nav).name.fmt(ip)}), | |
| 76 | .@"extern" => |e| try writer.print("(extern '{f}')", .{e.name.fmt(ip)}), | |
| 77 | .func => |func| try writer.print("(function '{f}')", .{ip.getNav(func.owner_nav).name.fmt(ip)}), | |
| 78 | 78 | .int => |int| switch (int.storage) { |
| 79 | 79 | inline .u64, .i64, .big_int => |x| try writer.print("{}", .{x}), |
| 80 | 80 | .lazy_align => |ty| if (opt_sema != null) { |
| 81 | 81 | const a = try Type.fromInterned(ty).abiAlignmentSema(pt); |
| 82 | 82 | try writer.print("{}", .{a.toByteUnits() orelse 0}); |
| 83 | } else try writer.print("@alignOf({})", .{Type.fromInterned(ty).fmt(pt)}), | |
| 83 | } else try writer.print("@alignOf({f})", .{Type.fromInterned(ty).fmt(pt)}), | |
| 84 | 84 | .lazy_size => |ty| if (opt_sema != null) { |
| 85 | 85 | const s = try Type.fromInterned(ty).abiSizeSema(pt); |
| 86 | 86 | try writer.print("{}", .{s}); |
| 87 | } else try writer.print("@sizeOf({})", .{Type.fromInterned(ty).fmt(pt)}), | |
| 87 | } else try writer.print("@sizeOf({f})", .{Type.fromInterned(ty).fmt(pt)}), | |
| 88 | 88 | }, |
| 89 | .err => |err| try writer.print("error.{}", .{ | |
| 89 | .err => |err| try writer.print("error.{f}", .{ | |
| 90 | 90 | err.name.fmt(ip), |
| 91 | 91 | }), |
| 92 | 92 | .error_union => |error_union| switch (error_union.val) { |
| 93 | .err_name => |err_name| try writer.print("error.{}", .{ | |
| 93 | .err_name => |err_name| try writer.print("error.{f}", .{ | |
| 94 | 94 | err_name.fmt(ip), |
| 95 | 95 | }), |
| 96 | 96 | .payload => |payload| try print(Value.fromInterned(payload), writer, level, pt, opt_sema), |
| 97 | 97 | }, |
| 98 | .enum_literal => |enum_literal| try writer.print(".{}", .{ | |
| 98 | .enum_literal => |enum_literal| try writer.print(".{f}", .{ | |
| 99 | 99 | enum_literal.fmt(ip), |
| 100 | 100 | }), |
| 101 | 101 | .enum_tag => |enum_tag| { |
| 102 | 102 | const enum_type = ip.loadEnumType(val.typeOf(zcu).toIntern()); |
| 103 | 103 | if (enum_type.tagValueIndex(ip, val.toIntern())) |tag_index| { |
| 104 | return writer.print(".{i}", .{enum_type.names.get(ip)[tag_index].fmt(ip)}); | |
| 104 | return writer.print(".{fi}", .{enum_type.names.get(ip)[tag_index].fmt(ip)}); | |
| 105 | 105 | } |
| 106 | 106 | if (level == 0) { |
| 107 | 107 | return writer.writeAll("@enumFromInt(...)"); |
| ... | ... | @@ -164,7 +164,7 @@ pub fn print( |
| 164 | 164 | } |
| 165 | 165 | if (un.tag == .none) { |
| 166 | 166 | const backing_ty = try val.typeOf(zcu).unionBackingType(pt); |
| 167 | try writer.print("@bitCast(@as({}, ", .{backing_ty.fmt(pt)}); | |
| 167 | try writer.print("@bitCast(@as({f}, ", .{backing_ty.fmt(pt)}); | |
| 168 | 168 | try print(Value.fromInterned(un.val), writer, level - 1, pt, opt_sema); |
| 169 | 169 | try writer.writeAll("))"); |
| 170 | 170 | } else { |
| ... | ... | @@ -206,7 +206,7 @@ fn printAggregate( |
| 206 | 206 | for (0..max_len) |i| { |
| 207 | 207 | if (i != 0) try writer.writeAll(", "); |
| 208 | 208 | const field_name = ty.structFieldName(@intCast(i), zcu).unwrap().?; |
| 209 | try writer.print(".{i} = ", .{field_name.fmt(ip)}); | |
| 209 | try writer.print(".{fi} = ", .{field_name.fmt(ip)}); | |
| 210 | 210 | try print(try val.fieldValue(pt, i), writer, level - 1, pt, opt_sema); |
| 211 | 211 | } |
| 212 | 212 | try writer.writeAll(" }"); |
| ... | ... | @@ -391,14 +391,14 @@ pub fn printPtrDerivation( |
| 391 | 391 | const agg_ty = (try field.parent.ptrType(pt)).childType(zcu); |
| 392 | 392 | switch (agg_ty.zigTypeTag(zcu)) { |
| 393 | 393 | .@"struct" => if (agg_ty.structFieldName(field.field_idx, zcu).unwrap()) |field_name| { |
| 394 | try writer.print(".{i}", .{field_name.fmt(ip)}); | |
| 394 | try writer.print(".{fi}", .{field_name.fmt(ip)}); | |
| 395 | 395 | } else { |
| 396 | 396 | try writer.print("[{d}]", .{field.field_idx}); |
| 397 | 397 | }, |
| 398 | 398 | .@"union" => { |
| 399 | 399 | const tag_ty = agg_ty.unionTagTypeHypothetical(zcu); |
| 400 | 400 | const field_name = tag_ty.enumFieldName(field.field_idx, zcu); |
| 401 | try writer.print(".{i}", .{field_name.fmt(ip)}); | |
| 401 | try writer.print(".{fi}", .{field_name.fmt(ip)}); | |
| 402 | 402 | }, |
| 403 | 403 | .pointer => switch (field.field_idx) { |
| 404 | 404 | Value.slice_ptr_index => try writer.writeAll(".ptr"), |
| ... | ... | @@ -416,12 +416,12 @@ pub fn printPtrDerivation( |
| 416 | 416 | }, |
| 417 | 417 | |
| 418 | 418 | .offset_and_cast => |oac| if (oac.byte_offset == 0) root: { |
| 419 | try writer.print("@as({}, @ptrCast(", .{oac.new_ptr_ty.fmt(pt)}); | |
| 419 | try writer.print("@as({f}, @ptrCast(", .{oac.new_ptr_ty.fmt(pt)}); | |
| 420 | 420 | const root = try printPtrDerivation(oac.parent.*, writer, pt, .rvalue, root_strat, ptr_depth - 1); |
| 421 | 421 | try writer.writeAll("))"); |
| 422 | 422 | break :root root; |
| 423 | 423 | } else root: { |
| 424 | try writer.print("@as({}, @ptrFromInt(@intFromPtr(", .{oac.new_ptr_ty.fmt(pt)}); | |
| 424 | try writer.print("@as({f}, @ptrFromInt(@intFromPtr(", .{oac.new_ptr_ty.fmt(pt)}); | |
| 425 | 425 | const root = try printPtrDerivation(oac.parent.*, writer, pt, .rvalue, root_strat, ptr_depth - 1); |
| 426 | 426 | try writer.print(") + {d}))", .{oac.byte_offset}); |
| 427 | 427 | break :root root; |
| ... | ... | @@ -433,22 +433,22 @@ pub fn printPtrDerivation( |
| 433 | 433 | if (root_or_null == null) switch (root_strat) { |
| 434 | 434 | .str => |x| try writer.writeAll(x), |
| 435 | 435 | .print_val => |x| switch (derivation) { |
| 436 | .int => |int| try writer.print("@as({}, @ptrFromInt(0x{x}))", .{ int.ptr_ty.fmt(pt), int.addr }), | |
| 437 | .nav_ptr => |nav| try writer.print("{}", .{ip.getNav(nav).fqn.fmt(ip)}), | |
| 436 | .int => |int| try writer.print("@as({f}, @ptrFromInt(0x{x}))", .{ int.ptr_ty.fmt(pt), int.addr }), | |
| 437 | .nav_ptr => |nav| try writer.print("{f}", .{ip.getNav(nav).fqn.fmt(ip)}), | |
| 438 | 438 | .uav_ptr => |uav| { |
| 439 | 439 | const ty = Value.fromInterned(uav.val).typeOf(zcu); |
| 440 | try writer.print("@as({}, ", .{ty.fmt(pt)}); | |
| 440 | try writer.print("@as({f}, ", .{ty.fmt(pt)}); | |
| 441 | 441 | try print(Value.fromInterned(uav.val), writer, x.level - 1, pt, x.opt_sema); |
| 442 | 442 | try writer.writeByte(')'); |
| 443 | 443 | }, |
| 444 | 444 | .comptime_alloc_ptr => |info| { |
| 445 | try writer.print("@as({}, ", .{info.val.typeOf(zcu).fmt(pt)}); | |
| 445 | try writer.print("@as({f}, ", .{info.val.typeOf(zcu).fmt(pt)}); | |
| 446 | 446 | try print(info.val, writer, x.level - 1, pt, x.opt_sema); |
| 447 | 447 | try writer.writeByte(')'); |
| 448 | 448 | }, |
| 449 | 449 | .comptime_field_ptr => |val| { |
| 450 | 450 | const ty = val.typeOf(zcu); |
| 451 | try writer.print("@as({}, ", .{ty.fmt(pt)}); | |
| 451 | try writer.print("@as({f}, ", .{ty.fmt(pt)}); | |
| 452 | 452 | try print(val, writer, x.level - 1, pt, x.opt_sema); |
| 453 | 453 | try writer.writeByte(')'); |
| 454 | 454 | }, |