Skip to content

Commit

Permalink
[IRShow] expose index information to postprinter (#41828)
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit c2b4b38)
  • Loading branch information
simeonschaub authored and KristofferC committed Aug 25, 2021
1 parent 929ea9f commit 9a15a35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/compiler/ssair/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function show_ir_stmt(io::IO, code::Union{IRCode, CodeInfo}, idx::Int, line_info
if new_node_type === UNDEF # try to be robust against errors
printstyled(io, "::#UNDEF", color=:red)
elseif show_type
line_info_postprinter(io, new_node_type, node_idx in used)
line_info_postprinter(IOContext(io, :idx => node_idx), new_node_type, node_idx in used)
end
println(io)
i += 1
Expand All @@ -643,7 +643,7 @@ function show_ir_stmt(io::IO, code::Union{IRCode, CodeInfo}, idx::Int, line_info
# This is an error, but can happen if passes don't update their type information
printstyled(io, "::#UNDEF", color=:red)
elseif show_type
line_info_postprinter(io, type, idx in used)
line_info_postprinter(IOContext(io, :idx => idx), type, idx in used)
end
end
println(io)
Expand Down

0 comments on commit 9a15a35

Please sign in to comment.