authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-12-03 11:35:59-05:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-12-03 11:36:23-05:00
log82ba9b8560f6f173953e6d89321235036b98bafe
treed0078b83a7f7571d3cebaab3695b99d202e279c8
parente00f1397e33715512f205eeac240d836b0d1b172

print_air: fix printing of instruction indices


1 files changed, 11 insertions(+), 11 deletions(-)

src/print_air.zig+11-11
......@@ -97,7 +97,7 @@ const Writer = struct {
9797 const tag = w.air.instructions.items(.tag)[@intFromEnum(inst)];
9898 try s.writeByteNTimes(' ', w.indent);
9999 try s.print("%{d}{c}= {s}(", .{
100 inst,
100 @intFromEnum(inst),
101101 @as(u8, if (if (w.liveness) |liveness| liveness.isUnused(inst) else false) '!' else ' '),
102102 @tagName(tag),
103103 });
......@@ -388,7 +388,7 @@ const Writer = struct {
388388 try s.writeAll("}");
389389
390390 for (liveness_block.deaths) |operand| {
391 try s.print(" %{d}!", .{operand});
391 try s.print(" %{d}!", .{@intFromEnum(operand)});
392392 }
393393 }
394394
......@@ -715,7 +715,7 @@ const Writer = struct {
715715 try s.writeByteNTimes(' ', w.indent);
716716 for (liveness_condbr.else_deaths, 0..) |operand, i| {
717717 if (i != 0) try s.writeAll(" ");
718 try s.print("%{d}!", .{operand});
718 try s.print("%{d}!", .{@intFromEnum(operand)});
719719 }
720720 try s.writeAll("\n");
721721 }
......@@ -726,7 +726,7 @@ const Writer = struct {
726726 try s.writeAll("}");
727727
728728 for (liveness_condbr.then_deaths) |operand| {
729 try s.print(" %{d}!", .{operand});
729 try s.print(" %{d}!", .{@intFromEnum(operand)});
730730 }
731731 }
732732
......@@ -752,7 +752,7 @@ const Writer = struct {
752752 try s.writeByteNTimes(' ', w.indent);
753753 for (liveness_condbr.else_deaths, 0..) |operand, i| {
754754 if (i != 0) try s.writeAll(" ");
755 try s.print("%{d}!", .{operand});
755 try s.print("%{d}!", .{@intFromEnum(operand)});
756756 }
757757 try s.writeAll("\n");
758758 }
......@@ -763,7 +763,7 @@ const Writer = struct {
763763 try s.writeAll("}");
764764
765765 for (liveness_condbr.then_deaths) |operand| {
766 try s.print(" %{d}!", .{operand});
766 try s.print(" %{d}!", .{@intFromEnum(operand)});
767767 }
768768 }
769769
......@@ -787,7 +787,7 @@ const Writer = struct {
787787 try s.writeByteNTimes(' ', w.indent);
788788 for (liveness_condbr.then_deaths, 0..) |operand, i| {
789789 if (i != 0) try s.writeAll(" ");
790 try s.print("%{d}!", .{operand});
790 try s.print("%{d}!", .{@intFromEnum(operand)});
791791 }
792792 try s.writeAll("\n");
793793 }
......@@ -800,7 +800,7 @@ const Writer = struct {
800800 try s.writeByteNTimes(' ', w.indent);
801801 for (liveness_condbr.else_deaths, 0..) |operand, i| {
802802 if (i != 0) try s.writeAll(" ");
803 try s.print("%{d}!", .{operand});
803 try s.print("%{d}!", .{@intFromEnum(operand)});
804804 }
805805 try s.writeAll("\n");
806806 }
......@@ -852,7 +852,7 @@ const Writer = struct {
852852 try s.writeByteNTimes(' ', w.indent);
853853 for (deaths, 0..) |operand, i| {
854854 if (i != 0) try s.writeAll(" ");
855 try s.print("%{d}!", .{operand});
855 try s.print("%{d}!", .{@intFromEnum(operand)});
856856 }
857857 try s.writeAll("\n");
858858 }
......@@ -873,7 +873,7 @@ const Writer = struct {
873873 try s.writeByteNTimes(' ', w.indent);
874874 for (deaths, 0..) |operand, i| {
875875 if (i != 0) try s.writeAll(" ");
876 try s.print("%{d}!", .{operand});
876 try s.print("%{d}!", .{@intFromEnum(operand)});
877877 }
878878 try s.writeAll("\n");
879879 }
......@@ -957,7 +957,7 @@ const Writer = struct {
957957 dies: bool,
958958 ) @TypeOf(s).Error!void {
959959 _ = w;
960 try s.print("%{d}", .{inst});
960 try s.print("%{d}", .{@intFromEnum(inst)});
961961 if (dies) try s.writeByte('!');
962962 }
963963