@@ -84,11 +84,13 @@ function build_callable(sig::Type{<:Tuple})
84
84
return fresh_copy (mc_cache[key])
85
85
else
86
86
ir = Base. code_ircode_by_type (sig)[1 ][1 ]
87
+ # Check whether this is a varargs call.
88
+ isva = which (sig). isva
87
89
bb, refs, types = derive_copyable_task_ir (BBCode (ir))
88
90
unoptimised_ir = IRCode (bb)
89
91
optimised_ir = optimise_ir! (unoptimised_ir)
90
92
mc_ret_type = callable_ret_type (sig, types)
91
- mc = misty_closure (mc_ret_type, optimised_ir, refs... ; do_compile= true )
93
+ mc = misty_closure (mc_ret_type, optimised_ir, refs... ; isva = isva, do_compile= true )
92
94
mc_cache[key] = mc
93
95
return mc, refs[end ]
94
96
end
315
317
"""
316
318
set_taped_globals!(t::TapedTask, new_taped_globals)::Nothing
317
319
318
- Set the `taped_globals` of `t` to `new_taped_globals`. Any calls to
320
+ Set the `taped_globals` of `t` to `new_taped_globals`. Any calls to
319
321
[`get_taped_globals`](@ref) in future calls to `consume(t)` (either directly, or implicitly
320
322
via iteration) will see this new value.
321
323
"""
@@ -573,7 +575,7 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple,Vector{Any}}
573
575
# We enforced above the condition that the final statement in a basic block must not
574
576
# produce. This ensures that the final split does not produce. While not strictly
575
577
# necessary, this simplifies the implementation (see below).
576
- #
578
+ #
577
579
# As a result of the above, a basic block will be associated to exactly one split if it
578
580
# does not contain any statements which may produce.
579
581
#
@@ -595,7 +597,7 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple,Vector{Any}}
595
597
# Owing to splitting blocks up, we will need to re-label some `GotoNode`s and
596
598
# `GotoIfNot`s. To understand this, consider the following block, whose original `ID`
597
599
# we assume to be `ID(old_id)`.
598
- # ID(new_id) - %1 = φ(ID(3) => ...)
600
+ # ID(new_id) - %1 = φ(ID(3) => ...)
599
601
# ID(new_id) - %3 = call_which_must_not_produce(...)
600
602
# ID(new_id) - %4 = produce(%3)
601
603
# ID(old_id) - GotoNode(ID(5))
0 commit comments