Skip to content

Commit

Permalink
Prepare for JuliaLang/julia#56036 (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
topolarity authored Oct 11, 2024
1 parent 6aa0fd6 commit b43e75f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/codeedges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,23 @@ function print_with_code(preprint, postprint, io::IO, src::CodeInfo)
for stmt in src.code
Core.Compiler.scan_ssa_use!(push!, used, stmt)
end
@static if VERSION > v"1.11" && __has_internal_change(v"1.12-alpha", :printcodeinfocalls)
parent = src.parent
sptypes = if parent isa MethodInstance
Core.Compiler.sptypes_from_meth_instance(parent)
else Core.Compiler.EMPTY_SPTYPES end
end
line_info_preprinter = Base.IRShow.lineinfo_disabled
line_info_postprinter = Base.IRShow.default_expr_type_printer
preprint(io)
bb_idx_prev = bb_idx = 1
for idx = 1:length(src.code)
preprint(io, idx)
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, used, cfg, bb_idx)
@static if VERSION > v"1.11" && __has_internal_change(v"1.12-alpha", :printcodeinfocalls)
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, sptypes, used, cfg, bb_idx)
else
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, used, cfg, bb_idx)
end
postprint(io, idx, bb_idx != bb_idx_prev)
bb_idx_prev = bb_idx
end
Expand Down

0 comments on commit b43e75f

Please sign in to comment.