From 2893de764f86e3990e74a3cefdd46e13eb93a676 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:08:23 +0900 Subject: [PATCH] IRShow: fix problematic code (#41603) * IRShow: fix problematic code * Update base/compiler/ssair/show.jl Co-authored-by: Simeon Schaub Co-authored-by: Simeon Schaub --- base/compiler/ssair/show.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/compiler/ssair/show.jl b/base/compiler/ssair/show.jl index 1f1c838c62ae7..ba3a637f61e93 100644 --- a/base/compiler/ssair/show.jl +++ b/base/compiler/ssair/show.jl @@ -726,7 +726,7 @@ function statementidx_lineinfo_printer(f, code::CodeInfo) end statementidx_lineinfo_printer(code) = statementidx_lineinfo_printer(DILineInfoPrinter, code) -function stmts_used(code::IRCode, warn_unset_entry=true) +function stmts_used(io::IO, code::IRCode, warn_unset_entry=true) stmts = code.stmts used = BitSet() for stmt in stmts @@ -744,7 +744,7 @@ function stmts_used(code::IRCode, warn_unset_entry=true) return used end -function stmts_used(code::CodeInfo) +function stmts_used(::IO, code::CodeInfo) stmts = code.code used = BitSet() for stmt in stmts @@ -763,7 +763,7 @@ default_config(code::CodeInfo) = IRShowConfig(statementidx_lineinfo_printer(code function show_ir(io::IO, code::Union{IRCode, CodeInfo}, config::IRShowConfig=default_config(code); pop_new_node! = code isa IRCode ? ircode_new_nodes_iter(code) : Returns(nothing)) stmts = code isa IRCode ? code.stmts : code.code - used = stmts_used(code) + used = stmts_used(io, code) cfg = code isa IRCode ? code.cfg : compute_basic_blocks(stmts) bb_idx = 1