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 {...@@ -97,7 +97,7 @@ const Writer = struct {
97 const tag = w.air.instructions.items(.tag)[@intFromEnum(inst)];97 const tag = w.air.instructions.items(.tag)[@intFromEnum(inst)];
98 try s.writeByteNTimes(' ', w.indent);98 try s.writeByteNTimes(' ', w.indent);
99 try s.print("%{d}{c}= {s}(", .{99 try s.print("%{d}{c}= {s}(", .{
100 inst,100 @intFromEnum(inst),
101 @as(u8, if (if (w.liveness) |liveness| liveness.isUnused(inst) else false) '!' else ' '),101 @as(u8, if (if (w.liveness) |liveness| liveness.isUnused(inst) else false) '!' else ' '),
102 @tagName(tag),102 @tagName(tag),
103 });103 });
...@@ -388,7 +388,7 @@ const Writer = struct {...@@ -388,7 +388,7 @@ const Writer = struct {
388 try s.writeAll("}");388 try s.writeAll("}");
389389
390 for (liveness_block.deaths) |operand| {390 for (liveness_block.deaths) |operand| {
391 try s.print(" %{d}!", .{operand});391 try s.print(" %{d}!", .{@intFromEnum(operand)});
392 }392 }
393 }393 }
394394
...@@ -715,7 +715,7 @@ const Writer = struct {...@@ -715,7 +715,7 @@ const Writer = struct {
715 try s.writeByteNTimes(' ', w.indent);715 try s.writeByteNTimes(' ', w.indent);
716 for (liveness_condbr.else_deaths, 0..) |operand, i| {716 for (liveness_condbr.else_deaths, 0..) |operand, i| {
717 if (i != 0) try s.writeAll(" ");717 if (i != 0) try s.writeAll(" ");
718 try s.print("%{d}!", .{operand});718 try s.print("%{d}!", .{@intFromEnum(operand)});
719 }719 }
720 try s.writeAll("\n");720 try s.writeAll("\n");
721 }721 }
...@@ -726,7 +726,7 @@ const Writer = struct {...@@ -726,7 +726,7 @@ const Writer = struct {
726 try s.writeAll("}");726 try s.writeAll("}");
727727
728 for (liveness_condbr.then_deaths) |operand| {728 for (liveness_condbr.then_deaths) |operand| {
729 try s.print(" %{d}!", .{operand});729 try s.print(" %{d}!", .{@intFromEnum(operand)});
730 }730 }
731 }731 }
732732
...@@ -752,7 +752,7 @@ const Writer = struct {...@@ -752,7 +752,7 @@ const Writer = struct {
752 try s.writeByteNTimes(' ', w.indent);752 try s.writeByteNTimes(' ', w.indent);
753 for (liveness_condbr.else_deaths, 0..) |operand, i| {753 for (liveness_condbr.else_deaths, 0..) |operand, i| {
754 if (i != 0) try s.writeAll(" ");754 if (i != 0) try s.writeAll(" ");
755 try s.print("%{d}!", .{operand});755 try s.print("%{d}!", .{@intFromEnum(operand)});
756 }756 }
757 try s.writeAll("\n");757 try s.writeAll("\n");
758 }758 }
...@@ -763,7 +763,7 @@ const Writer = struct {...@@ -763,7 +763,7 @@ const Writer = struct {
763 try s.writeAll("}");763 try s.writeAll("}");
764764
765 for (liveness_condbr.then_deaths) |operand| {765 for (liveness_condbr.then_deaths) |operand| {
766 try s.print(" %{d}!", .{operand});766 try s.print(" %{d}!", .{@intFromEnum(operand)});
767 }767 }
768 }768 }
769769
...@@ -787,7 +787,7 @@ const Writer = struct {...@@ -787,7 +787,7 @@ const Writer = struct {
787 try s.writeByteNTimes(' ', w.indent);787 try s.writeByteNTimes(' ', w.indent);
788 for (liveness_condbr.then_deaths, 0..) |operand, i| {788 for (liveness_condbr.then_deaths, 0..) |operand, i| {
789 if (i != 0) try s.writeAll(" ");789 if (i != 0) try s.writeAll(" ");
790 try s.print("%{d}!", .{operand});790 try s.print("%{d}!", .{@intFromEnum(operand)});
791 }791 }
792 try s.writeAll("\n");792 try s.writeAll("\n");
793 }793 }
...@@ -800,7 +800,7 @@ const Writer = struct {...@@ -800,7 +800,7 @@ const Writer = struct {
800 try s.writeByteNTimes(' ', w.indent);800 try s.writeByteNTimes(' ', w.indent);
801 for (liveness_condbr.else_deaths, 0..) |operand, i| {801 for (liveness_condbr.else_deaths, 0..) |operand, i| {
802 if (i != 0) try s.writeAll(" ");802 if (i != 0) try s.writeAll(" ");
803 try s.print("%{d}!", .{operand});803 try s.print("%{d}!", .{@intFromEnum(operand)});
804 }804 }
805 try s.writeAll("\n");805 try s.writeAll("\n");
806 }806 }
...@@ -852,7 +852,7 @@ const Writer = struct {...@@ -852,7 +852,7 @@ const Writer = struct {
852 try s.writeByteNTimes(' ', w.indent);852 try s.writeByteNTimes(' ', w.indent);
853 for (deaths, 0..) |operand, i| {853 for (deaths, 0..) |operand, i| {
854 if (i != 0) try s.writeAll(" ");854 if (i != 0) try s.writeAll(" ");
855 try s.print("%{d}!", .{operand});855 try s.print("%{d}!", .{@intFromEnum(operand)});
856 }856 }
857 try s.writeAll("\n");857 try s.writeAll("\n");
858 }858 }
...@@ -873,7 +873,7 @@ const Writer = struct {...@@ -873,7 +873,7 @@ const Writer = struct {
873 try s.writeByteNTimes(' ', w.indent);873 try s.writeByteNTimes(' ', w.indent);
874 for (deaths, 0..) |operand, i| {874 for (deaths, 0..) |operand, i| {
875 if (i != 0) try s.writeAll(" ");875 if (i != 0) try s.writeAll(" ");
876 try s.print("%{d}!", .{operand});876 try s.print("%{d}!", .{@intFromEnum(operand)});
877 }877 }
878 try s.writeAll("\n");878 try s.writeAll("\n");
879 }879 }
...@@ -957,7 +957,7 @@ const Writer = struct {...@@ -957,7 +957,7 @@ const Writer = struct {
957 dies: bool,957 dies: bool,
958 ) @TypeOf(s).Error!void {958 ) @TypeOf(s).Error!void {
959 _ = w;959 _ = w;
960 try s.print("%{d}", .{inst});960 try s.print("%{d}", .{@intFromEnum(inst)});
961 if (dies) try s.writeByte('!');961 if (dies) try s.writeByte('!');
962 }962 }
963963