From e6b175a9def4b1e68d24431c56b5d692519e5626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belmant?= Date: Tue, 8 Jul 2025 13:42:13 +0000 Subject: [PATCH 1/3] Use Compiler.IRShow instead of Base.IRShow --- src/codeedges.jl | 8 ++++---- src/packagedef.jl | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/codeedges.jl b/src/codeedges.jl index d508b12..387b839 100644 --- a/src/codeedges.jl +++ b/src/codeedges.jl @@ -115,16 +115,16 @@ function print_with_code(preprint, postprint, io::IO, src::CodeInfo) CC.EMPTY_SPTYPES end end - line_info_preprinter = Base.IRShow.lineinfo_disabled - line_info_postprinter = Base.IRShow.default_expr_type_printer + line_info_preprinter = IRShow.lineinfo_disabled + line_info_postprinter = IRShow.default_expr_type_printer preprint(io) bb_idx_prev = bb_idx = 1 for idx = 1:length(src.code) preprint(io, idx) @static if isdefined(Base, :__has_internal_change) && Base.__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) + bb_idx = 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) + bb_idx = 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 diff --git a/src/packagedef.jl b/src/packagedef.jl index a690c1e..7cc3ab5 100644 --- a/src/packagedef.jl +++ b/src/packagedef.jl @@ -9,7 +9,8 @@ using Compiler: Compiler as CC using .CC: BasicBlock, CFG, compute_basic_blocks, construct_domtree, construct_postdomtree, - nearest_common_dominator, postdominates + nearest_common_dominator, postdominates, + IRShow using Base.Meta: isexpr const SSAValues = Union{Core.IR.SSAValue, JuliaInterpreter.SSAValue} From a21193f8a8d6759714986cfd4e3af3156d611ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belmant?= Date: Tue, 8 Jul 2025 13:43:44 +0000 Subject: [PATCH 2/3] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6019869..a945fc5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "LoweredCodeUtils" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" -version = "3.4.0" +version = "3.4.1" authors = ["Tim Holy "] [deps] From 73b5d3fa907f8fb50a1d1c6c00a49374801d77d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belmant?= Date: Tue, 8 Jul 2025 14:00:16 +0000 Subject: [PATCH 3/3] Only import IRShow from Compiler when defined (pre-1.12) --- src/packagedef.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/packagedef.jl b/src/packagedef.jl index 7cc3ab5..8ac428e 100644 --- a/src/packagedef.jl +++ b/src/packagedef.jl @@ -9,8 +9,14 @@ using Compiler: Compiler as CC using .CC: BasicBlock, CFG, compute_basic_blocks, construct_domtree, construct_postdomtree, - nearest_common_dominator, postdominates, - IRShow + nearest_common_dominator, postdominates + +@static if isdefined(CC, :IRShow) + using .CC: IRShow +else + using Base: IRShow +end + using Base.Meta: isexpr const SSAValues = Union{Core.IR.SSAValue, JuliaInterpreter.SSAValue}