authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-02 17:49:29-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-07 22:43:52-07:00
logf409457925918da254080be9ddcbe1182073d1e2
tree03034d24a64d8c45cb2416c78619d22bb3460e3f
parent494819be91be1a320c269207f9bd55a1bc09c60b

compiler: fix a bunch of format strings


11 files changed, 104 insertions(+), 112 deletions(-)

src/Air.zig+5-9
......@@ -957,18 +957,14 @@ pub const Inst = struct {
957957 return index.unwrap().target;
958958 }
959959
960 pub fn format(
961 index: Index,
962 comptime _: []const u8,
963 _: std.fmt.FormatOptions,
964 writer: anytype,
965 ) @TypeOf(writer).Error!void {
966 try writer.writeByte('%');
960 pub fn format(index: Index, w: *std.io.Writer, comptime fmt: []const u8) std.io.Writer.Error!void {
961 comptime assert(fmt.len == 0);
962 try w.writeByte('%');
967963 switch (index.unwrap()) {
968964 .ref => {},
969 .target => try writer.writeByte('t'),
965 .target => try w.writeByte('t'),
970966 }
971 try writer.print("{d}", .{@as(u31, @truncate(@intFromEnum(index)))});
967 try w.print("{d}", .{@as(u31, @truncate(@intFromEnum(index)))});
972968 }
973969 };
974970
src/Air/Liveness.zig+23-23
......@@ -1299,10 +1299,10 @@ fn analyzeOperands(
12991299
13001300 // This logic must synchronize with `will_die_immediately` in `AnalyzeBigOperands.init`.
13011301 const immediate_death = if (data.live_set.remove(inst)) blk: {
1302 log.debug("[{}] %{}: removed from live set", .{ pass, @intFromEnum(inst) });
1302 log.debug("[{}] %{d}: removed from live set", .{ pass, @intFromEnum(inst) });
13031303 break :blk false;
13041304 } else blk: {
1305 log.debug("[{}] %{}: immediate death", .{ pass, @intFromEnum(inst) });
1305 log.debug("[{}] %{d}: immediate death", .{ pass, @intFromEnum(inst) });
13061306 break :blk true;
13071307 };
13081308
......@@ -1323,7 +1323,7 @@ fn analyzeOperands(
13231323 const mask = @as(Bpi, 1) << @as(OperandInt, @intCast(i));
13241324
13251325 if ((try data.live_set.fetchPut(gpa, operand, {})) == null) {
1326 log.debug("[{}] %{}: added %{} to live set (operand dies here)", .{ pass, @intFromEnum(inst), operand });
1326 log.debug("[{}] %{f}: added %{d} to live set (operand dies here)", .{ pass, @intFromEnum(inst), operand });
13271327 tomb_bits |= mask;
13281328 }
13291329 }
......@@ -1462,19 +1462,19 @@ fn analyzeInstBlock(
14621462 },
14631463
14641464 .main_analysis => {
1465 log.debug("[{}] %{}: block live set is {}", .{ pass, inst, fmtInstSet(&data.live_set) });
1465 log.debug("[{}] %{f}: block live set is {f}", .{ pass, inst, fmtInstSet(&data.live_set) });
14661466 // We can move the live set because the body should have a noreturn
14671467 // instruction which overrides the set.
14681468 try data.block_scopes.put(gpa, inst, .{
14691469 .live_set = data.live_set.move(),
14701470 });
14711471 defer {
1472 log.debug("[{}] %{}: popped block scope", .{ pass, inst });
1472 log.debug("[{}] %{f}: popped block scope", .{ pass, inst });
14731473 var scope = data.block_scopes.fetchRemove(inst).?.value;
14741474 scope.live_set.deinit(gpa);
14751475 }
14761476
1477 log.debug("[{}] %{}: pushed new block scope", .{ pass, inst });
1477 log.debug("[{}] %{f}: pushed new block scope", .{ pass, inst });
14781478 try analyzeBody(a, pass, data, body);
14791479
14801480 // If the block is noreturn, block deaths not only aren't useful, they're impossible to
......@@ -1501,7 +1501,7 @@ fn analyzeInstBlock(
15011501 }
15021502 assert(measured_num == num_deaths); // post-live-set should be a subset of pre-live-set
15031503 try a.special.put(gpa, inst, extra_index);
1504 log.debug("[{}] %{}: block deaths are {}", .{
1504 log.debug("[{}] %{f}: block deaths are {f}", .{
15051505 pass,
15061506 inst,
15071507 fmtInstList(@ptrCast(a.extra.items[extra_index + 1 ..][0..num_deaths])),
......@@ -1538,7 +1538,7 @@ fn writeLoopInfo(
15381538 const block_inst = key.*;
15391539 a.extra.appendAssumeCapacity(@intFromEnum(block_inst));
15401540 }
1541 log.debug("[{}] %{}: includes breaks to {}", .{ LivenessPass.loop_analysis, inst, fmtInstSet(&data.breaks) });
1541 log.debug("[{}] %{f}: includes breaks to {f}", .{ LivenessPass.loop_analysis, inst, fmtInstSet(&data.breaks) });
15421542
15431543 // Now we put the live operands from the loop body in too
15441544 const num_live = data.live_set.count();
......@@ -1550,7 +1550,7 @@ fn writeLoopInfo(
15501550 const alive = key.*;
15511551 a.extra.appendAssumeCapacity(@intFromEnum(alive));
15521552 }
1553 log.debug("[{}] %{}: maintain liveness of {}", .{ LivenessPass.loop_analysis, inst, fmtInstSet(&data.live_set) });
1553 log.debug("[{}] %{f}: maintain liveness of {f}", .{ LivenessPass.loop_analysis, inst, fmtInstSet(&data.live_set) });
15541554
15551555 try a.special.put(gpa, inst, extra_index);
15561556
......@@ -1591,7 +1591,7 @@ fn resolveLoopLiveSet(
15911591 try data.live_set.ensureUnusedCapacity(gpa, @intCast(loop_live.len));
15921592 for (loop_live) |alive| data.live_set.putAssumeCapacity(alive, {});
15931593
1594 log.debug("[{}] %{}: block live set is {}", .{ LivenessPass.main_analysis, inst, fmtInstSet(&data.live_set) });
1594 log.debug("[{}] %{f}: block live set is {f}", .{ LivenessPass.main_analysis, inst, fmtInstSet(&data.live_set) });
15951595
15961596 for (breaks) |block_inst| {
15971597 // We might break to this block, so include every operand that the block needs alive
......@@ -1604,7 +1604,7 @@ fn resolveLoopLiveSet(
16041604 }
16051605 }
16061606
1607 log.debug("[{}] %{}: loop live set is {}", .{ LivenessPass.main_analysis, inst, fmtInstSet(&data.live_set) });
1607 log.debug("[{}] %{f}: loop live set is {f}", .{ LivenessPass.main_analysis, inst, fmtInstSet(&data.live_set) });
16081608}
16091609
16101610fn analyzeInstLoop(
......@@ -1642,7 +1642,7 @@ fn analyzeInstLoop(
16421642 .live_set = data.live_set.move(),
16431643 });
16441644 defer {
1645 log.debug("[{}] %{}: popped loop block scop", .{ pass, inst });
1645 log.debug("[{}] %{f}: popped loop block scop", .{ pass, inst });
16461646 var scope = data.block_scopes.fetchRemove(inst).?.value;
16471647 scope.live_set.deinit(gpa);
16481648 }
......@@ -1743,13 +1743,13 @@ fn analyzeInstCondBr(
17431743 }
17441744 }
17451745
1746 log.debug("[{}] %{}: 'then' branch mirrored deaths are {}", .{ pass, inst, fmtInstList(then_mirrored_deaths.items) });
1747 log.debug("[{}] %{}: 'else' branch mirrored deaths are {}", .{ pass, inst, fmtInstList(else_mirrored_deaths.items) });
1746 log.debug("[{}] %{f}: 'then' branch mirrored deaths are {f}", .{ pass, inst, fmtInstList(then_mirrored_deaths.items) });
1747 log.debug("[{}] %{f}: 'else' branch mirrored deaths are {f}", .{ pass, inst, fmtInstList(else_mirrored_deaths.items) });
17481748
17491749 data.live_set.deinit(gpa);
17501750 data.live_set = then_live.move(); // Really the union of both live sets
17511751
1752 log.debug("[{}] %{}: new live set is {}", .{ pass, inst, fmtInstSet(&data.live_set) });
1752 log.debug("[{}] %{f}: new live set is {f}", .{ pass, inst, fmtInstSet(&data.live_set) });
17531753
17541754 // Write the mirrored deaths to `extra`
17551755 const then_death_count = @as(u32, @intCast(then_mirrored_deaths.items.len));
......@@ -1817,7 +1817,7 @@ fn analyzeInstSwitchBr(
18171817 });
18181818 }
18191819 defer if (is_dispatch_loop) {
1820 log.debug("[{}] %{}: popped loop block scop", .{ pass, inst });
1820 log.debug("[{}] %{f}: popped loop block scop", .{ pass, inst });
18211821 var scope = data.block_scopes.fetchRemove(inst).?.value;
18221822 scope.live_set.deinit(gpa);
18231823 };
......@@ -1875,13 +1875,13 @@ fn analyzeInstSwitchBr(
18751875 }
18761876
18771877 for (mirrored_deaths, 0..) |mirrored, i| {
1878 log.debug("[{}] %{}: case {} mirrored deaths are {}", .{ pass, inst, i, fmtInstList(mirrored.items) });
1878 log.debug("[{}] %{f}: case {} mirrored deaths are {f}", .{ pass, inst, i, fmtInstList(mirrored.items) });
18791879 }
18801880
18811881 data.live_set.deinit(gpa);
18821882 data.live_set = all_alive.move();
18831883
1884 log.debug("[{}] %{}: new live set is {}", .{ pass, inst, fmtInstSet(&data.live_set) });
1884 log.debug("[{}] %{f}: new live set is {f}", .{ pass, inst, fmtInstSet(&data.live_set) });
18851885 }
18861886
18871887 const else_death_count = @as(u32, @intCast(mirrored_deaths[ncases].items.len));
......@@ -1980,7 +1980,7 @@ fn AnalyzeBigOperands(comptime pass: LivenessPass) type {
19801980
19811981 .main_analysis => {
19821982 if ((try big.data.live_set.fetchPut(gpa, operand, {})) == null) {
1983 log.debug("[{}] %{}: added %{} to live set (operand dies here)", .{ pass, big.inst, operand });
1983 log.debug("[{}] %{f}: added %{f} to live set (operand dies here)", .{ pass, big.inst, operand });
19841984 big.extra_tombs[extra_byte] |= @as(u32, 1) << extra_bit;
19851985 }
19861986 },
......@@ -2042,9 +2042,9 @@ const FmtInstSet = struct {
20422042 return;
20432043 }
20442044 var it = val.set.keyIterator();
2045 try w.print("%{}", .{it.next().?.*});
2045 try w.print("%{f}", .{it.next().?.*});
20462046 while (it.next()) |key| {
2047 try w.print(" %{}", .{key.*});
2047 try w.print(" %{f}", .{key.*});
20482048 }
20492049 }
20502050};
......@@ -2061,9 +2061,9 @@ const FmtInstList = struct {
20612061 try w.writeAll("[no instructions]");
20622062 return;
20632063 }
2064 try w.print("%{}", .{val.list[0]});
2064 try w.print("%{f}", .{val.list[0]});
20652065 for (val.list[1..]) |inst| {
2066 try w.print(" %{}", .{inst});
2066 try w.print(" %{f}", .{inst});
20672067 }
20682068 }
20692069};
src/IncrementalDebugServer.zig+1-1
......@@ -234,7 +234,7 @@ fn handleCommand(zcu: *Zcu, output: *std.ArrayListUnmanaged(u8), cmd_str: []cons
234234 for (unit_info.deps.items, 0..) |dependee, i| {
235235 try w.print("[{d}] ", .{i});
236236 switch (dependee) {
237 .src_hash, .namespace, .namespace_name, .zon_file, .embed_file => try w.print("{}", .{zcu.fmtDependee(dependee)}),
237 .src_hash, .namespace, .namespace_name, .zon_file, .embed_file => try w.print("{f}", .{zcu.fmtDependee(dependee)}),
238238 .nav_val, .nav_ty => |nav| try w.print("{s} {d}", .{ @tagName(dependee), @intFromEnum(nav) }),
239239 .interned => |ip_index| switch (ip.indexToKey(ip_index)) {
240240 .struct_type, .union_type, .enum_type => try w.print("type {d}", .{@intFromEnum(ip_index)}),
src/Sema/LowerZon.zig+16-20
......@@ -338,7 +338,7 @@ fn failUnsupportedResultType(
338338 const gpa = sema.gpa;
339339 const pt = sema.pt;
340340 return sema.failWithOwnedErrorMsg(self.block, msg: {
341 const msg = try sema.errMsg(self.import_loc, "type '{}' is not available in ZON", .{ty.fmt(pt)});
341 const msg = try sema.errMsg(self.import_loc, "type '{f}' is not available in ZON", .{ty.fmt(pt)});
342342 errdefer msg.destroy(gpa);
343343 if (opt_note) |n| try sema.errNote(self.import_loc, msg, "{s}", .{n});
344344 break :msg msg;
......@@ -360,11 +360,7 @@ fn fail(
360360fn lowerExprKnownResTy(self: *LowerZon, node: Zoir.Node.Index, res_ty: Type) CompileError!InternPool.Index {
361361 const pt = self.sema.pt;
362362 return self.lowerExprKnownResTyInner(node, res_ty) catch |err| switch (err) {
363 error.WrongType => return self.fail(
364 node,
365 "expected type '{}'",
366 .{res_ty.fmt(pt)},
367 ),
363 error.WrongType => return self.fail(node, "expected type '{f}'", .{res_ty.fmt(pt)}),
368364 else => |e| return e,
369365 };
370366}
......@@ -428,7 +424,7 @@ fn lowerExprKnownResTyInner(
428424 .frame,
429425 .@"anyframe",
430426 .void,
431 => return self.fail(node, "type '{}' not available in ZON", .{res_ty.fmt(pt)}),
427 => return self.fail(node, "type '{f}' not available in ZON", .{res_ty.fmt(pt)}),
432428 }
433429}
434430
......@@ -458,7 +454,7 @@ fn lowerInt(
458454 // If lhs is unsigned and rhs is less than 0, we're out of bounds
459455 if (lhs_info.signedness == .unsigned and rhs < 0) return self.fail(
460456 node,
461 "type '{}' cannot represent integer value '{}'",
457 "type '{f}' cannot represent integer value '{d}'",
462458 .{ res_ty.fmt(self.sema.pt), rhs },
463459 );
464460
......@@ -478,7 +474,7 @@ fn lowerInt(
478474 if (rhs < min_int or rhs > max_int) {
479475 return self.fail(
480476 node,
481 "type '{}' cannot represent integer value '{}'",
477 "type '{f}' cannot represent integer value '{d}'",
482478 .{ res_ty.fmt(self.sema.pt), rhs },
483479 );
484480 }
......@@ -496,7 +492,7 @@ fn lowerInt(
496492 if (!val.fitsInTwosComp(int_info.signedness, int_info.bits)) {
497493 return self.fail(
498494 node,
499 "type '{}' cannot represent integer value '{}'",
495 "type '{f}' cannot represent integer value '{f}'",
500496 .{ res_ty.fmt(self.sema.pt), val },
501497 );
502498 }
......@@ -517,7 +513,7 @@ fn lowerInt(
517513 switch (big_int.setFloat(val, .trunc)) {
518514 .inexact => return self.fail(
519515 node,
520 "fractional component prevents float value '{}' from coercion to type '{}'",
516 "fractional component prevents float value '{}' from coercion to type '{f}'",
521517 .{ val, res_ty.fmt(self.sema.pt) },
522518 ),
523519 .exact => {},
......@@ -528,8 +524,8 @@ fn lowerInt(
528524 if (!big_int.toConst().fitsInTwosComp(int_info.signedness, int_info.bits)) {
529525 return self.fail(
530526 node,
531 "type '{}' cannot represent integer value '{}'",
532 .{ val, res_ty.fmt(self.sema.pt) },
527 "type '{f}' cannot represent integer value '{}'",
528 .{ res_ty.fmt(self.sema.pt), val },
533529 );
534530 }
535531
......@@ -550,7 +546,7 @@ fn lowerInt(
550546 if (val >= out_of_range) {
551547 return self.fail(
552548 node,
553 "type '{}' cannot represent integer value '{}'",
549 "type '{f}' cannot represent integer value '{d}'",
554550 .{ res_ty.fmt(self.sema.pt), val },
555551 );
556552 }
......@@ -584,7 +580,7 @@ fn lowerFloat(
584580 .pos_inf => b: {
585581 if (res_ty.toIntern() == .comptime_float_type) return self.fail(
586582 node,
587 "expected type '{}'",
583 "expected type '{f}'",
588584 .{res_ty.fmt(self.sema.pt)},
589585 );
590586 break :b try self.sema.pt.floatValue(res_ty, std.math.inf(f128));
......@@ -592,7 +588,7 @@ fn lowerFloat(
592588 .neg_inf => b: {
593589 if (res_ty.toIntern() == .comptime_float_type) return self.fail(
594590 node,
595 "expected type '{}'",
591 "expected type '{f}'",
596592 .{res_ty.fmt(self.sema.pt)},
597593 );
598594 break :b try self.sema.pt.floatValue(res_ty, -std.math.inf(f128));
......@@ -600,7 +596,7 @@ fn lowerFloat(
600596 .nan => b: {
601597 if (res_ty.toIntern() == .comptime_float_type) return self.fail(
602598 node,
603 "expected type '{}'",
599 "expected type '{f}'",
604600 .{res_ty.fmt(self.sema.pt)},
605601 );
606602 break :b try self.sema.pt.floatValue(res_ty, std.math.nan(f128));
......@@ -795,7 +791,7 @@ fn lowerStruct(self: *LowerZon, node: Zoir.Node.Index, res_ty: Type) !InternPool
795791 const field_node = fields.vals.at(@intCast(i));
796792
797793 const name_index = struct_info.nameIndex(ip, field_name) orelse {
798 return self.fail(field_node, "unexpected field '{}'", .{field_name.fmt(ip)});
794 return self.fail(field_node, "unexpected field '{f}'", .{field_name.fmt(ip)});
799795 };
800796
801797 const field_type: Type = .fromInterned(struct_info.field_types.get(ip)[name_index]);
......@@ -816,7 +812,7 @@ fn lowerStruct(self: *LowerZon, node: Zoir.Node.Index, res_ty: Type) !InternPool
816812
817813 const field_names = struct_info.field_names.get(ip);
818814 for (field_values, field_names) |*value, name| {
819 if (value.* == .none) return self.fail(node, "missing field '{}'", .{name.fmt(ip)});
815 if (value.* == .none) return self.fail(node, "missing field '{f}'", .{name.fmt(ip)});
820816 }
821817
822818 return self.sema.pt.intern(.{ .aggregate = .{
......@@ -934,7 +930,7 @@ fn lowerUnion(self: *LowerZon, node: Zoir.Node.Index, res_ty: Type) !InternPool.
934930 .struct_literal => b: {
935931 const fields: @FieldType(Zoir.Node, "struct_literal") = switch (node.get(self.file.zoir.?)) {
936932 .struct_literal => |fields| fields,
937 else => return self.fail(node, "expected type '{}'", .{res_ty.fmt(self.sema.pt)}),
933 else => return self.fail(node, "expected type '{f}'", .{res_ty.fmt(self.sema.pt)}),
938934 };
939935 if (fields.names.len != 1) {
940936 return error.WrongType;
src/arch/riscv64/CodeGen.zig+18-18
......@@ -499,14 +499,14 @@ const InstTracking = struct {
499499 else => target.long,
500500 } else target.long;
501501 inst_tracking.short = target.short;
502 tracking_log.debug("%{d} => {} (materialize)", .{ inst, inst_tracking.* });
502 tracking_log.debug("%{d} => {f} (materialize)", .{ inst, inst_tracking.* });
503503 }
504504
505505 fn resurrect(inst_tracking: *InstTracking, inst: Air.Inst.Index, scope_generation: u32) void {
506506 switch (inst_tracking.short) {
507507 .dead => |die_generation| if (die_generation >= scope_generation) {
508508 inst_tracking.reuseFrame();
509 tracking_log.debug("%{d} => {} (resurrect)", .{ inst, inst_tracking.* });
509 tracking_log.debug("%{d} => {f} (resurrect)", .{ inst, inst_tracking.* });
510510 },
511511 else => {},
512512 }
......@@ -516,7 +516,7 @@ const InstTracking = struct {
516516 if (inst_tracking.short == .dead) return;
517517 try function.freeValue(inst_tracking.short);
518518 inst_tracking.short = .{ .dead = function.scope_generation };
519 tracking_log.debug("%{d} => {} (death)", .{ inst, inst_tracking.* });
519 tracking_log.debug("%{d} => {f} (death)", .{ inst, inst_tracking.* });
520520 }
521521
522522 fn reuse(
......@@ -527,15 +527,15 @@ const InstTracking = struct {
527527 ) void {
528528 inst_tracking.short = .{ .dead = function.scope_generation };
529529 if (new_inst) |inst|
530 tracking_log.debug("%{d} => {} (reuse %{d})", .{ inst, inst_tracking.*, old_inst })
530 tracking_log.debug("%{d} => {f} (reuse %{d})", .{ inst, inst_tracking.*, old_inst })
531531 else
532 tracking_log.debug("tmp => {} (reuse %{d})", .{ inst_tracking.*, old_inst });
532 tracking_log.debug("tmp => {f} (reuse %{d})", .{ inst_tracking.*, old_inst });
533533 }
534534
535535 fn liveOut(inst_tracking: *InstTracking, function: *Func, inst: Air.Inst.Index) void {
536536 for (inst_tracking.getRegs()) |reg| {
537537 if (function.register_manager.isRegFree(reg)) {
538 tracking_log.debug("%{d} => {} (live-out)", .{ inst, inst_tracking.* });
538 tracking_log.debug("%{d} => {f} (live-out)", .{ inst, inst_tracking.* });
539539 continue;
540540 }
541541
......@@ -562,7 +562,7 @@ const InstTracking = struct {
562562 // Perform side-effects of freeValue manually.
563563 function.register_manager.freeReg(reg);
564564
565 tracking_log.debug("%{d} => {} (live-out %{d})", .{ inst, inst_tracking.*, tracked_inst });
565 tracking_log.debug("%{d} => {f} (live-out %{d})", .{ inst, inst_tracking.*, tracked_inst });
566566 }
567567 }
568568
......@@ -572,7 +572,7 @@ const InstTracking = struct {
572572 _: std.fmt.FormatOptions,
573573 writer: anytype,
574574 ) @TypeOf(writer).Error!void {
575 if (!std.meta.eql(inst_tracking.long, inst_tracking.short)) try writer.print("|{}| ", .{inst_tracking.long});
575 if (!std.meta.eql(inst_tracking.long, inst_tracking.short)) try writer.print("|{f}| ", .{inst_tracking.long});
576576 try writer.print("{}", .{inst_tracking.short});
577577 }
578578};
......@@ -802,7 +802,7 @@ pub fn generate(
802802 function.mir_instructions.deinit(gpa);
803803 }
804804
805 wip_mir_log.debug("{}:", .{fmtNav(func.owner_nav, ip)});
805 wip_mir_log.debug("{f}:", .{fmtNav(func.owner_nav, ip)});
806806
807807 try function.frame_allocs.resize(gpa, FrameIndex.named_count);
808808 function.frame_allocs.set(
......@@ -973,7 +973,7 @@ fn formatWipMir(data: FormatWipMirData, writer: *std.io.Writer) std.io.Writer.Er
973973 else => |e| return e,
974974 }).insts) |lowered_inst| {
975975 if (!first) try writer.writeAll("\ndebug(wip_mir): ");
976 try writer.print(" | {}", .{lowered_inst});
976 try writer.print(" | {f}", .{lowered_inst});
977977 first = false;
978978 }
979979}
......@@ -1156,7 +1156,7 @@ fn gen(func: *Func) !void {
11561156 func.ret_mcv.long.address().offset(-func.ret_mcv.short.indirect.off),
11571157 );
11581158 func.ret_mcv.long = .{ .load_frame = .{ .index = frame_index } };
1159 tracking_log.debug("spill {} to {}", .{ func.ret_mcv.long, frame_index });
1159 tracking_log.debug("spill {f} to {f}", .{ func.ret_mcv.long, frame_index });
11601160 },
11611161 else => unreachable,
11621162 }
......@@ -1656,14 +1656,14 @@ fn genBody(func: *Func, body: []const Air.Inst.Index) InnerError!void {
16561656
16571657 if (std.debug.runtime_safety) {
16581658 if (func.air_bookkeeping < old_air_bookkeeping + 1) {
1659 std.debug.panic("in codegen.zig, handling of AIR instruction %{d} ('{}') did not do proper bookkeeping. Look for a missing call to finishAir.", .{ inst, air_tags[@intFromEnum(inst)] });
1659 std.debug.panic("in codegen.zig, handling of AIR instruction %{d} ('{f}') did not do proper bookkeeping. Look for a missing call to finishAir.", .{ inst, air_tags[@intFromEnum(inst)] });
16601660 }
16611661
16621662 { // check consistency of tracked registers
16631663 var it = func.register_manager.free_registers.iterator(.{ .kind = .unset });
16641664 while (it.next()) |index| {
16651665 const tracked_inst = func.register_manager.registers[index];
1666 tracking_log.debug("tracked inst: {}", .{tracked_inst});
1666 tracking_log.debug("tracked inst: {f}", .{tracked_inst});
16671667 const tracking = func.getResolvedInstValue(tracked_inst);
16681668 for (tracking.getRegs()) |reg| {
16691669 if (RegisterManager.indexOfRegIntoTracked(reg).? == index) break;
......@@ -1697,7 +1697,7 @@ fn freeValue(func: *Func, value: MCValue) !void {
16971697
16981698fn feed(func: *Func, bt: *Air.Liveness.BigTomb, operand: Air.Inst.Ref) !void {
16991699 if (bt.feed()) if (operand.toIndex()) |inst| {
1700 log.debug("feed inst: %{}", .{inst});
1700 log.debug("feed inst: %{f}", .{inst});
17011701 try func.processDeath(inst);
17021702 };
17031703}
......@@ -1726,7 +1726,7 @@ fn finishAirResult(func: *Func, inst: Air.Inst.Index, result: MCValue) void {
17261726 else => {},
17271727 }
17281728
1729 tracking_log.debug("%{d} => {} (birth)", .{ inst, result });
1729 tracking_log.debug("%{d} => {f} (birth)", .{ inst, result });
17301730 func.inst_tracking.putAssumeCapacityNoClobber(inst, InstTracking.init(result));
17311731 // In some cases, an operand may be reused as the result.
17321732 // If that operand died and was a register, it was freed by
......@@ -1827,7 +1827,7 @@ fn computeFrameLayout(func: *Func) !FrameLayout {
18271827 total_alloc_size + 64 + args_frame_size + spill_frame_size + call_frame_size,
18281828 @intCast(frame_align[@intFromEnum(FrameIndex.base_ptr)].toByteUnits().?),
18291829 );
1830 log.debug("frame size: {}", .{acc_frame_size});
1830 log.debug("frame size: {f}", .{acc_frame_size});
18311831
18321832 // store the ra at total_size - 8, so it's the very first thing in the stack
18331833 // relative to the fp
......@@ -1888,7 +1888,7 @@ fn splitType(func: *Func, ty: Type) ![2]Type {
18881888 },
18891889 else => unreachable,
18901890 },
1891 else => return func.fail("TODO: splitType class {}", .{class}),
1891 else => return func.fail("TODO: splitType class {f}", .{class}),
18921892 };
18931893 } else if (parts[0].abiSize(zcu) + parts[1].abiSize(zcu) == ty.abiSize(zcu)) return parts;
18941894 return func.fail("TODO implement splitType for {f}", .{ty.fmt(func.pt)});
......@@ -1992,7 +1992,7 @@ fn allocFrameIndex(func: *Func, alloc: FrameAlloc) !FrameIndex {
19921992 }
19931993 const frame_index: FrameIndex = @enumFromInt(func.frame_allocs.len);
19941994 try func.frame_allocs.append(func.gpa, alloc);
1995 log.debug("allocated frame {}", .{frame_index});
1995 log.debug("allocated frame {f}", .{frame_index});
19961996 return frame_index;
19971997}
19981998
src/arch/x86_64/CodeGen.zig+23-23
......@@ -550,9 +550,9 @@ pub const MCValue = union(enum) {
550550 @tagName(pl.reg),
551551 }),
552552 .indirect => |pl| try bw.print("[{s} + 0x{x}]", .{ @tagName(pl.reg), pl.off }),
553 .indirect_load_frame => |pl| try bw.print("[[{} + 0x{x}]]", .{ pl.index, pl.off }),
554 .load_frame => |pl| try bw.print("[{} + 0x{x}]", .{ pl.index, pl.off }),
555 .lea_frame => |pl| try bw.print("{} + 0x{x}", .{ pl.index, pl.off }),
553 .indirect_load_frame => |pl| try bw.print("[[{f} + 0x{x}]]", .{ pl.index, pl.off }),
554 .load_frame => |pl| try bw.print("[{f} + 0x{x}]", .{ pl.index, pl.off }),
555 .lea_frame => |pl| try bw.print("{f} + 0x{x}", .{ pl.index, pl.off }),
556556 .load_nav => |pl| try bw.print("[nav:{d}]", .{@intFromEnum(pl)}),
557557 .lea_nav => |pl| try bw.print("nav:{d}", .{@intFromEnum(pl)}),
558558 .load_uav => |pl| try bw.print("[uav:{d}]", .{@intFromEnum(pl.val)}),
......@@ -561,10 +561,10 @@ pub const MCValue = union(enum) {
561561 .lea_lazy_sym => |pl| try bw.print("lazy:{s}:{d}", .{ @tagName(pl.kind), @intFromEnum(pl.ty) }),
562562 .load_extern_func => |pl| try bw.print("[extern:{d}]", .{@intFromEnum(pl)}),
563563 .lea_extern_func => |pl| try bw.print("extern:{d}", .{@intFromEnum(pl)}),
564 .elementwise_args => |pl| try bw.print("elementwise:{d}:[{} + 0x{x}]", .{
564 .elementwise_args => |pl| try bw.print("elementwise:{d}:[{f} + 0x{x}]", .{
565565 pl.regs, pl.frame_index, pl.frame_off,
566566 }),
567 .reserved_frame => |pl| try bw.print("(dead:{})", .{pl}),
567 .reserved_frame => |pl| try bw.print("(dead:{f})", .{pl}),
568568 .air_ref => |pl| try bw.print("(air:0x{x})", .{@intFromEnum(pl)}),
569569 }
570570 }
......@@ -1195,7 +1195,7 @@ fn formatWipMir(data: FormatWipMirData, w: *Writer) Writer.Error!void {
11951195 };
11961196 try w.print(" {f}", .{mem_op.fmt(.m)});
11971197 },
1198 .pseudo_dbg_arg_val, .pseudo_dbg_var_val => try w.print(" {}", .{
1198 .pseudo_dbg_arg_val, .pseudo_dbg_var_val => try w.print(" {f}", .{
11991199 Value.fromInterned(mir_inst.data.ip_index).fmtValue(data.self.pt),
12001200 }),
12011201 }
......@@ -12887,7 +12887,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
1288712887 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
1288812888 } },
1288912889 } }) catch |err| switch (err) {
12890 error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{
12890 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{
1289112891 @tagName(air_tag),
1289212892 cg.typeOf(bin_op.lhs).fmt(pt),
1289312893 ops[0].tracking(cg),
......@@ -21764,7 +21764,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
2176421764 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
2176521765 } },
2176621766 } }) catch |err| switch (err) {
21767 error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{
21767 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{
2176821768 @tagName(air_tag),
2176921769 cg.typeOf(bin_op.lhs).fmt(pt),
2177021770 ops[0].tracking(cg),
......@@ -32482,7 +32482,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
3248232482 .{ .@"0:", ._, .mov, .memad(.dst0q, .add_size, -8), .tmp3q, ._, ._ },
3248332483 } },
3248432484 } }) catch |err| switch (err) {
32485 error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{
32485 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{
3248632486 @tagName(air_tag),
3248732487 cg.typeOf(bin_op.lhs).fmt(pt),
3248832488 ops[0].tracking(cg),
......@@ -59310,7 +59310,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
5931059310 .{ ._, ._, .@"or", .tmp4q, .tmp5q, ._, ._ },
5931159311 } },
5931259312 } }) catch |err| switch (err) {
59313 error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{
59313 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{
5931459314 @tagName(air_tag),
5931559315 ty_pl.ty.toType().fmt(pt),
5931659316 ops[0].tracking(cg),
......@@ -60809,7 +60809,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
6080960809 .{ ._, ._, .@"or", .dst0d, .tmp0d, ._, ._ },
6081060810 } },
6081160811 } }) catch |err| switch (err) {
60812 error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{
60812 error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{
6081360813 @tagName(air_tag),
6081460814 cg.typeOf(bin_op.rhs).fmt(pt),
6081560815 ops[1].tracking(cg),
......@@ -64066,7 +64066,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
6406664066 .{ .@"0:", ._, .mov, .memad(.dst0q, .add_size, -8), .tmp1q, ._, ._ },
6406764067 } },
6406864068 } }) catch |err| switch (err) {
64069 error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{
64069 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{
6407064070 @tagName(air_tag),
6407164071 lhs_ty.fmt(pt),
6407264072 ops[0].tracking(cg),
......@@ -79428,7 +79428,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
7942879428 .@"struct", .@"union" => {
7942979429 assert(ty.containerLayout(zcu) == .@"packed");
7943079430 for (&ops) |*op| op.wrapInt(cg) catch |err| switch (err) {
79431 error.SelectFailed => return cg.fail("failed to select {s} wrap {} {}", .{
79431 error.SelectFailed => return cg.fail("failed to select {s} wrap {f} {f}", .{
7943279432 @tagName(air_tag),
7943379433 ty.fmt(pt),
7943479434 op.tracking(cg),
......@@ -86521,7 +86521,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
8652186521 } },
8652286522 }),
8652386523 }) catch |err| switch (err) {
86524 error.SelectFailed => return cg.fail("failed to select {s} {s} {} {} {}", .{
86524 error.SelectFailed => return cg.fail("failed to select {s} {s} {f} {f} {f}", .{
8652586525 @tagName(air_tag),
8652686526 @tagName(vector_cmp.compareOperator()),
8652786527 cg.typeOf(vector_cmp.lhs).fmt(pt),
......@@ -157186,7 +157186,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157186157186 } },
157187157187 } },
157188157188 }) catch |err| switch (err) {
157189 error.SelectFailed => return cg.fail("failed to select {s}.{s} {} {}", .{
157189 error.SelectFailed => return cg.fail("failed to select {s}.{s} {f} {f}", .{
157190157190 @tagName(air_tag),
157191157191 @tagName(reduce.operation),
157192157192 cg.typeOf(reduce.operand).fmt(pt),
......@@ -157197,7 +157197,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157197157197 switch (reduce.operation) {
157198157198 .And, .Or, .Xor, .Min, .Max => {},
157199157199 .Add, .Mul => if (cg.intInfo(res_ty)) |_| res[0].wrapInt(cg) catch |err| switch (err) {
157200 error.SelectFailed => return cg.fail("failed to select {s}.{s} wrap {} {}", .{
157200 error.SelectFailed => return cg.fail("failed to select {s}.{s} wrap {f} {f}", .{
157201157201 @tagName(air_tag),
157202157202 @tagName(reduce.operation),
157203157203 res_ty.fmt(pt),
......@@ -164480,7 +164480,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164480164480 } },
164481164481 } },
164482164482 }) catch |err| switch (err) {
164483 error.SelectFailed => return cg.fail("failed to select {s}.{s} {} {}", .{
164483 error.SelectFailed => return cg.fail("failed to select {s}.{s} {f} {f}", .{
164484164484 @tagName(air_tag),
164485164485 @tagName(reduce.operation),
164486164486 cg.typeOf(reduce.operand).fmt(pt),
......@@ -166277,7 +166277,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
166277166277 .{ ._, ._nz, .j, .@"0b", ._, ._, ._ },
166278166278 } },
166279166279 } }) catch |err| switch (err) {
166280 error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{
166280 error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{
166281166281 @tagName(air_tag),
166282166282 ty_op.ty.toType().fmt(pt),
166283166283 ops[0].tracking(cg),
......@@ -166293,7 +166293,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
166293166293 const bin_op = air_datas[@intFromEnum(inst)].bin_op;
166294166294 var ops = try cg.tempsFromOperands(inst, .{ bin_op.lhs, bin_op.rhs }) ++ .{undefined};
166295166295 ops[2] = ops[0].getByteLen(cg) catch |err| switch (err) {
166296 error.SelectFailed => return cg.fail("failed to select {s} {} {} {} {}", .{
166296 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f} {f}", .{
166297166297 @tagName(air_tag),
166298166298 cg.typeOf(bin_op.lhs).fmt(pt),
166299166299 cg.typeOf(bin_op.rhs).fmt(pt),
......@@ -166333,7 +166333,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
166333166333 } },
166334166334 }},
166335166335 }) catch |err| switch (err) {
166336 error.SelectFailed => return cg.fail("failed to select {s} {} {} {} {} {}", .{
166336 error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f} {f} {f}", .{
166337166337 @tagName(air_tag),
166338166338 cg.typeOf(bin_op.lhs).fmt(pt),
166339166339 cg.typeOf(bin_op.rhs).fmt(pt),
......@@ -181502,7 +181502,7 @@ fn genSetReg(
181502181502 assert(!ty.optionalReprIsPayload(zcu));
181503181503 break :first_ty opt_child;
181504181504 },
181505 else => std.debug.panic("{s}: {}\n", .{ @src().fn_name, ty.fmt(pt) }),
181505 else => std.debug.panic("{s}: {f}\n", .{ @src().fn_name, ty.fmt(pt) }),
181506181506 });
181507181507 const first_size: u31 = @intCast(first_ty.abiSize(zcu));
181508181508 const frame_size = std.math.ceilPowerOfTwoAssert(u32, abi_size);
......@@ -186930,7 +186930,7 @@ const Temp = struct {
186930186930 assert(src_regs.len == std.math.divCeil(u16, int_info.bits, 64) catch unreachable);
186931186931 break :part_ty .u64;
186932186932 } else part_ty: switch (ip.indexToKey(src_ty.toIntern())) {
186933 else => std.debug.panic("{s}: {}\n", .{ @src().fn_name, src_ty.fmt(cg.pt) }),
186933 else => std.debug.panic("{s}: {f}\n", .{ @src().fn_name, src_ty.fmt(cg.pt) }),
186934186934 .ptr_type => |ptr_info| {
186935186935 assert(ptr_info.flags.size == .slice);
186936186936 assert(src_regs.len == 2);
......@@ -186941,7 +186941,7 @@ const Temp = struct {
186941186941 break :part_ty try cg.pt.intType(.unsigned, @as(u16, 8) * @min(src_abi_size, 8));
186942186942 },
186943186943 .opt_type => |opt_child| switch (ip.indexToKey(opt_child)) {
186944 else => std.debug.panic("{s}: {}\n", .{ @src().fn_name, src_ty.fmt(cg.pt) }),
186944 else => std.debug.panic("{s}: {f}\n", .{ @src().fn_name, src_ty.fmt(cg.pt) }),
186945186945 .ptr_type => |ptr_info| {
186946186946 assert(ptr_info.flags.size == .slice);
186947186947 assert(src_regs.len == 2);
src/arch/x86_64/encoder.zig+1-1
......@@ -259,7 +259,7 @@ pub const Instruction = struct {
259259 switch (sib.base) {
260260 .none => any = false,
261261 .reg => |reg| try w.print("{s}", .{@tagName(reg)}),
262 .frame => |frame_index| try w.print("{}", .{frame_index}),
262 .frame => |frame_index| try w.print("{f}", .{frame_index}),
263263 .table => try w.print("Table", .{}),
264264 .rip_inst => |inst_index| try w.print("RipInst({d})", .{inst_index}),
265265 .nav => |nav| try w.print("Nav({d})", .{@intFromEnum(nav)}),
src/link/Coff.zig+1-1
......@@ -2625,7 +2625,7 @@ fn logImportTables(coff: *const Coff) void {
26252625 log.debug("import tables:", .{});
26262626 for (coff.import_tables.keys(), 0..) |off, i| {
26272627 const itable = coff.import_tables.values()[i];
2628 log.debug("{}", .{itable.fmtDebug(.{
2628 log.debug("{f}", .{itable.fmtDebug(.{
26292629 .coff = coff,
26302630 .index = i,
26312631 .name_off = off,
src/link/MachO/relocatable.zig+1-1
......@@ -202,7 +202,7 @@ pub fn flushStaticLib(macho_file: *MachO, comp: *Compilation, module_obj_path: ?
202202 };
203203
204204 if (build_options.enable_logging) {
205 state_log.debug("ar_symtab\n{}\n", .{ar_symtab.fmt(macho_file)});
205 state_log.debug("ar_symtab\n{f}\n", .{ar_symtab.fmt(macho_file)});
206206 }
207207
208208 var buffer = std.ArrayList(u8).init(gpa);
src/link/Wasm/Object.zig+7-7
......@@ -856,7 +856,7 @@ pub fn parse(
856856 start_function = @enumFromInt(functions_start + index);
857857 },
858858 .element => {
859 log.warn("unimplemented: element section in {} {?s}", .{ path, archive_member_name });
859 log.warn("unimplemented: element section in {f} {?s}", .{ path, archive_member_name });
860860 pos = section_end;
861861 },
862862 .code => {
......@@ -984,10 +984,10 @@ pub fn parse(
984984 if (gop.value_ptr.type != fn_ty_index) {
985985 var err = try diags.addErrorWithNotes(2);
986986 try err.addMsg("symbol '{s}' mismatching function signatures", .{name.slice(wasm)});
987 gop.value_ptr.source_location.addNote(&err, "imported as {} here", .{
987 gop.value_ptr.source_location.addNote(&err, "imported as {f} here", .{
988988 gop.value_ptr.type.fmt(wasm),
989989 });
990 source_location.addNote(&err, "imported as {} here", .{fn_ty_index.fmt(wasm)});
990 source_location.addNote(&err, "imported as {f} here", .{fn_ty_index.fmt(wasm)});
991991 continue;
992992 }
993993 if (gop.value_ptr.module_name != ptr.module_name.toOptional()) {
......@@ -1155,11 +1155,11 @@ pub fn parse(
11551155 if (gop.value_ptr.type != ptr.type_index) {
11561156 var err = try diags.addErrorWithNotes(2);
11571157 try err.addMsg("function signature mismatch: {s}", .{name.slice(wasm)});
1158 gop.value_ptr.source_location.addNote(&err, "exported as {} here", .{
1158 gop.value_ptr.source_location.addNote(&err, "exported as {f} here", .{
11591159 ptr.type_index.fmt(wasm),
11601160 });
11611161 const word = if (gop.value_ptr.resolution == .unresolved) "imported" else "exported";
1162 source_location.addNote(&err, "{s} as {} here", .{ word, gop.value_ptr.type.fmt(wasm) });
1162 source_location.addNote(&err, "{s} as {f} here", .{ word, gop.value_ptr.type.fmt(wasm) });
11631163 continue;
11641164 }
11651165 if (gop.value_ptr.resolution == .unresolved or gop.value_ptr.flags.binding == .weak) {
......@@ -1176,8 +1176,8 @@ pub fn parse(
11761176 }
11771177 var err = try diags.addErrorWithNotes(2);
11781178 try err.addMsg("symbol collision: {s}", .{name.slice(wasm)});
1179 gop.value_ptr.source_location.addNote(&err, "exported as {} here", .{ptr.type_index.fmt(wasm)});
1180 source_location.addNote(&err, "exported as {} here", .{gop.value_ptr.type.fmt(wasm)});
1179 gop.value_ptr.source_location.addNote(&err, "exported as {f} here", .{ptr.type_index.fmt(wasm)});
1180 source_location.addNote(&err, "exported as {f} here", .{gop.value_ptr.type.fmt(wasm)});
11811181 continue;
11821182 } else {
11831183 gop.value_ptr.* = .{
src/register_manager.zig+8-8
......@@ -149,7 +149,7 @@ pub fn RegisterManager(
149149 /// Only the owner of the `RegisterLock` can unlock the
150150 /// register later.
151151 pub fn lockRegIndex(self: *Self, tracked_index: TrackedIndex) ?RegisterLock {
152 log.debug("locking {}", .{regAtTrackedIndex(tracked_index)});
152 log.debug("locking {f}", .{regAtTrackedIndex(tracked_index)});
153153 if (self.isRegIndexLocked(tracked_index)) {
154154 log.debug(" register already locked", .{});
155155 return null;
......@@ -164,7 +164,7 @@ pub fn RegisterManager(
164164 /// Like `lockReg` but asserts the register was unused always
165165 /// returning a valid lock.
166166 pub fn lockRegIndexAssumeUnused(self: *Self, tracked_index: TrackedIndex) RegisterLock {
167 log.debug("locking asserting free {}", .{regAtTrackedIndex(tracked_index)});
167 log.debug("locking asserting free {f}", .{regAtTrackedIndex(tracked_index)});
168168 assert(!self.isRegIndexLocked(tracked_index));
169169 self.locked_registers.set(tracked_index);
170170 return RegisterLock{ .tracked_index = tracked_index };
......@@ -202,7 +202,7 @@ pub fn RegisterManager(
202202 /// Requires `RegisterLock` to unlock a register.
203203 /// Call `lockReg` to obtain the lock first.
204204 pub fn unlockReg(self: *Self, lock: RegisterLock) void {
205 log.debug("unlocking {}", .{regAtTrackedIndex(lock.tracked_index)});
205 log.debug("unlocking {f}", .{regAtTrackedIndex(lock.tracked_index)});
206206 self.locked_registers.unset(lock.tracked_index);
207207 }
208208
......@@ -238,7 +238,7 @@ pub fn RegisterManager(
238238 if (i < count) return null;
239239
240240 for (regs, insts) |reg, inst| {
241 log.debug("tryAllocReg {} for inst {?}", .{ reg, inst });
241 log.debug("tryAllocReg {f} for inst {f}", .{ reg, inst });
242242 self.markRegAllocated(reg);
243243
244244 if (inst) |tracked_inst| {
......@@ -317,7 +317,7 @@ pub fn RegisterManager(
317317 tracked_index: TrackedIndex,
318318 inst: ?Air.Inst.Index,
319319 ) AllocationError!void {
320 log.debug("getReg {} for inst {?}", .{ regAtTrackedIndex(tracked_index), inst });
320 log.debug("getReg {f} for inst {f}", .{ regAtTrackedIndex(tracked_index), inst });
321321 if (!self.isRegIndexFree(tracked_index)) {
322322 // Move the instruction that was previously there to a
323323 // stack allocation.
......@@ -330,7 +330,7 @@ pub fn RegisterManager(
330330 self.getRegIndexAssumeFree(tracked_index, inst);
331331 }
332332 pub fn getReg(self: *Self, reg: Register, inst: ?Air.Inst.Index) AllocationError!void {
333 log.debug("getting reg: {}", .{reg});
333 log.debug("getting reg: {f}", .{reg});
334334 return self.getRegIndex(indexOfRegIntoTracked(reg) orelse return, inst);
335335 }
336336 pub fn getKnownReg(
......@@ -349,7 +349,7 @@ pub fn RegisterManager(
349349 tracked_index: TrackedIndex,
350350 inst: ?Air.Inst.Index,
351351 ) void {
352 log.debug("getRegAssumeFree {} for inst {?}", .{ regAtTrackedIndex(tracked_index), inst });
352 log.debug("getRegAssumeFree {f} for inst {f}", .{ regAtTrackedIndex(tracked_index), inst });
353353 self.markRegIndexAllocated(tracked_index);
354354
355355 assert(self.isRegIndexFree(tracked_index));
......@@ -364,7 +364,7 @@ pub fn RegisterManager(
364364
365365 /// Marks the specified register as free
366366 pub fn freeRegIndex(self: *Self, tracked_index: TrackedIndex) void {
367 log.debug("freeing register {}", .{regAtTrackedIndex(tracked_index)});
367 log.debug("freeing register {f}", .{regAtTrackedIndex(tracked_index)});
368368 self.registers[tracked_index] = undefined;
369369 self.markRegIndexFree(tracked_index);
370370 }