Skip to content

Commit c1670af

Browse files
committed
further cleanup using push_inst!
1 parent 32903c2 commit c1670af

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/utils.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ function call_with_reactant_generator(
640640
function push_inst!(inst)
641641
push!(overdubbed_code, inst)
642642
push!(overdubbed_codelocs, code_info.codelocs[1])
643+
return Core.SSAValue(length(overdubbed_code))
643644
end
644645
# Rewire the arguments from our tuple input of fn and args, to the corresponding calling convention
645646
# required by the base method.
@@ -666,9 +667,9 @@ function call_with_reactant_generator(
666667
actual_argument = Expr(
667668
:call, Core.GlobalRef(Core, :getfield), overdub_args_slot, offset
668669
)
669-
push_inst!(actual_argument)
670+
arg = push_inst!(actual_argument)
670671
offset += 1
671-
push!(fn_args, Core.SSAValue(length(overdubbed_code)))
672+
push!(fn_args, arg)
672673
push!(tys, redub_arguments[i + (guaranteed_error ? 1 : 0)])
673674

674675
if DEBUG_INTERP[]
@@ -688,15 +689,14 @@ function call_with_reactant_generator(
688689
if method.isva
689690
trailing_arguments = Expr(:call, Core.GlobalRef(Core, :tuple))
690691
for i in n_method_args:n_actual_args
691-
push_inst(
692+
arg = push_inst!(
692693
Expr(:call, Core.GlobalRef(Core, :getfield), overdub_args_slot, offset),
693694
)
694-
push!(trailing_arguments.args, Core.SSAValue(length(overdubbed_code)))
695+
push!(trailing_arguments.args, arg)
695696
offset += 1
696697
end
697698

698-
push_inst!(trailing_arguments)
699-
push!(fn_args, Core.SSAValue(length(overdubbed_code)))
699+
push!(fn_args, push_inst!(trailing_arguments))
700700
push!(
701701
tys,
702702
Tuple{

0 commit comments

Comments
 (0)