Skip to content

Commit bd71e05

Browse files
authored
fix ir printing on 1.12 (#661)
1 parent 33f1c25 commit bd71e05

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,15 @@ function framecode_lines(src::CodeInfo)
514514
line_info_postprinter = Base.IRShow.default_expr_type_printer
515515
bb_idx = 1
516516
for idx = 1:length(src.code)
517-
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, used, cfg, bb_idx)
517+
@static if VERSION >= v"1.12.0-DEV.1359"
518+
parent = src.parent
519+
sptypes = if parent isa MethodInstance
520+
Core.Compiler.sptypes_from_meth_instance(parent)
521+
else Core.Compiler.EMPTY_SPTYPES end
522+
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, sptypes, used, cfg, bb_idx)
523+
else
524+
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, used, cfg, bb_idx)
525+
end
518526
push!(lines, chomp(String(take!(buf))))
519527
end
520528
return lines

0 commit comments

Comments
 (0)