Skip to content
← Back

src/ir/values/packed_parameter_local.ghul

1
namespace IR.Values is
2
use Semantic.Symbols.Symbol
3
4
// A parameter of a literal written with an argument pack spread out
5
// has no CLR parameter: the emitted method takes the pack's tuple and
6
// unpacks it on entry into a local for each. Returns that local, or
7
// null for an argument that keeps its CLR slot.
8
packed_parameter_local_for(symbol: Symbol?) -> IR.LOCAL? is
9
if !symbol? then
10
return null
11
fi
12
13
if let closure: Semantic.Symbols.Closure = symbol.owner then
14
if let parameter: Semantic.Symbols.Variable = symbol /\ closure.is_packed_parameter(symbol) then
15
return parameter.ir_local_for("$pack.{symbol.name}", parameter.type!)
16
fi
17
fi
18
19
return null
20
si
21
si