| author | |
| committer | |
| log | 80bf5af3458b25ae7375b548dc7f42150fbef3c8 |
| tree | 7e3225a8095877a395d8b7604c7e889bd87af912 |
| parent | 3e6dd0da7a9aae1e6e3d3e0d897a2b3a28bfc043 |
2 files changed, 7 insertions(+), 3 deletions(-)
src/TypedValue.zig+6-2| ... | ... | @@ -413,8 +413,12 @@ pub fn print( |
| 413 | 413 | .runtime_value => return writer.writeAll("[runtime value]"), |
| 414 | 414 | }, |
| 415 | 415 | else => { |
| 416 | try writer.print("(interned: {})", .{val.ip_index}); | |
| 417 | return; | |
| 416 | const key = mod.intern_pool.indexToKey(val.ip_index); | |
| 417 | if (key.typeOf() == .type_type) { | |
| 418 | return Type.print(val.toType(), writer, mod); | |
| 419 | } else { | |
| 420 | return writer.print("{}", .{val.ip_index}); | |
| 421 | } | |
| 418 | 422 | }, |
| 419 | 423 | }; |
| 420 | 424 | } |
src/print_air.zig+1-1| ... | ... | @@ -621,7 +621,7 @@ const Writer = struct { |
| 621 | 621 | fn writeInterned(w: *Writer, s: anytype, inst: Air.Inst.Index) @TypeOf(s).Error!void { |
| 622 | 622 | const mod = w.module; |
| 623 | 623 | const ip_index = w.air.instructions.items(.data)[inst].interned; |
| 624 | const ty = ip_index.toType(); | |
| 624 | const ty = mod.intern_pool.indexToKey(ip_index).typeOf().toType(); | |
| 625 | 625 | try w.writeType(s, ty); |
| 626 | 626 | try s.print(", {}", .{ip_index.toValue().fmtValue(ty, mod)}); |
| 627 | 627 | } |