Skip to content

Commit 24ef40d

Browse files
committed
Minor refactor rhs_ir_finish!
1 parent 4a6d52f commit 24ef40d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/transform/codegen/rhs.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,19 @@ function rhs_finish!(
236236

237237
# Just before the end of the function
238238
spec = RHSSpec(key, ir_ordinal)
239-
daef_ci = rhs_ir_finish!(ir, ci, settings, spec, slotnames)
239+
daef_ci = rhs_finish_ir!(ir, ci, settings, spec, slotnames; single_block = true)
240240
push!(cis, daef_ci)
241241
end
242242

243243
return cis[ordinal]
244244
end
245245

246-
function rhs_ir_finish!(ir::IRCode, ci::CodeInstance, settings::Settings, owner::Union{RHSSpec, UnoptimizedKey}, slotnames)
246+
function rhs_finish_ir!(ir::IRCode, ci::CodeInstance, settings::Settings, owner::Union{RHSSpec, UnoptimizedKey}, slotnames; single_block = false)
247247
ir = Compiler.compact!(ir)
248-
resize!(ir.cfg.blocks, 1)
249-
empty!(ir.cfg.blocks[1].succs)
248+
if single_block
249+
resize!(ir.cfg.blocks, 1)
250+
empty!(ir.cfg.blocks[1].succs)
251+
end
250252

251253
widen_extra_info!(ir)
252254
Compiler.verify_ir(ir)

src/transform/unoptimized.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function rhs_finish_noopt!(
6363
end
6464
end
6565

66-
daef_ci = rhs_ir_finish!(Compiler.finish(compact), ci, settings, key, slotnames)
66+
daef_ci = rhs_finish_ir!(Compiler.finish(compact), ci, settings, key, slotnames)
6767
return daef_ci
6868
end
6969

0 commit comments

Comments
 (0)