Skip to content

Commit 6169ff1

Browse files
committed
[IRShow] expose index information to postprinter
I am experimenting with showing some other information besides just the types here as well and I think this would be generally useful. This passes that information as an `IOContext` as to not break any downstream uses of this code.
1 parent bdd7457 commit 6169ff1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/compiler/ssair/show.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ function show_ir_stmt(io::IO, code::Union{IRCode, CodeInfo}, idx::Int, line_info
628628
if new_node_type === UNDEF # try to be robust against errors
629629
printstyled(io, "::#UNDEF", color=:red)
630630
elseif show_type
631-
line_info_postprinter(io, new_node_type, node_idx in used)
631+
line_info_postprinter(IOContext(io, :idx => node_idx), new_node_type, node_idx in used)
632632
end
633633
println(io)
634634
i += 1
@@ -643,7 +643,7 @@ function show_ir_stmt(io::IO, code::Union{IRCode, CodeInfo}, idx::Int, line_info
643643
# This is an error, but can happen if passes don't update their type information
644644
printstyled(io, "::#UNDEF", color=:red)
645645
elseif show_type
646-
line_info_postprinter(io, type, idx in used)
646+
line_info_postprinter(IOContext(io, :idx => idx), type, idx in used)
647647
end
648648
end
649649
println(io)

0 commit comments

Comments
 (0)