Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRShow: use IOContext for PhiNodes/:invoke printing #43226

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/compiler/ssair/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function print_stmt(io::IO, idx::Int, @nospecialize(stmt), used::BitSet, maxleng
# XXX: this is wrong if `sig` is not a concretetype method
# more correct would be to use `fieldtype(sig, i)`, but that would obscure / discard Varargs information in show
sig = linfo.specTypes == Tuple ? Core.svec() : Base.unwrap_unionall(linfo.specTypes).parameters::Core.SimpleVector
print_arg(i) = sprint() do io
print_arg(i) = sprint(; context=io) do io
show_unquoted(io, stmt.args[i], indent)
if (i - 1) <= length(sig)
print(io, "::", sig[i - 1])
Expand Down Expand Up @@ -82,7 +82,7 @@ function show_unquoted_phinode(io::IO, stmt::PhiNode, indent::Int, prefix::Strin
args = String[let
e = stmt.edges[i]
v = !isassigned(stmt.values, i) ? "#undef" :
sprint() do io′
sprint(; context=io) do io′
show_unquoted(io′, stmt.values[i], indent)
end
"$prefix$e => $v"
Expand Down