Skip to content

Commit 3c261b3

Browse files
authored
Use Compiler.IRShow instead of Base.IRShow (#132)
1 parent 88690be commit 3c261b3

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LoweredCodeUtils"
22
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
3-
version = "3.4.0"
3+
version = "3.4.1"
44
authors = ["Tim Holy <[email protected]>"]
55

66
[deps]

src/codeedges.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ function print_with_code(preprint, postprint, io::IO, src::CodeInfo)
115115
CC.EMPTY_SPTYPES
116116
end
117117
end
118-
line_info_preprinter = Base.IRShow.lineinfo_disabled
119-
line_info_postprinter = Base.IRShow.default_expr_type_printer
118+
line_info_preprinter = IRShow.lineinfo_disabled
119+
line_info_postprinter = IRShow.default_expr_type_printer
120120
preprint(io)
121121
bb_idx_prev = bb_idx = 1
122122
for idx = 1:length(src.code)
123123
preprint(io, idx)
124124
@static if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :printcodeinfocalls)
125-
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, sptypes, used, cfg, bb_idx)
125+
bb_idx = IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, sptypes, used, cfg, bb_idx)
126126
else
127-
bb_idx = Base.IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, used, cfg, bb_idx)
127+
bb_idx = IRShow.show_ir_stmt(io, src, idx, line_info_preprinter, line_info_postprinter, used, cfg, bb_idx)
128128
end
129129
postprint(io, idx, bb_idx != bb_idx_prev)
130130
bb_idx_prev = bb_idx

src/packagedef.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ using .CC:
1010
BasicBlock, CFG,
1111
compute_basic_blocks, construct_domtree, construct_postdomtree,
1212
nearest_common_dominator, postdominates
13+
14+
@static if isdefined(CC, :IRShow)
15+
using .CC: IRShow
16+
else
17+
using Base: IRShow
18+
end
19+
1320
using Base.Meta: isexpr
1421

1522
const SSAValues = Union{Core.IR.SSAValue, JuliaInterpreter.SSAValue}

0 commit comments

Comments
 (0)