pub struct Calling<'a> {
pub callee: Callee,
pub args: &'a [Passing],
pub returns: &'a [Type],
pub variadic: bool,
pub named: usize,
pub at: Span,
}Expand description
One call, as everything about it that is not the function it is being built into.
Fields§
§callee: CalleeWhat it calls.
args: &'a [Passing]What it passes, in the order the signature holds them, which is the order the convention places them in.
returns: &'a [Type]What comes back, which is empty for a call that gives nothing back, one type for a value, and two for a structure small enough to come back in a pair of registers.
A pair is placed here rather than named by a rule for the reason the arguments are: which register each half goes in depends on the halves before it, since the two files are walked separately, and a pattern over a term cannot see them.
variadic: boolWhether the callee takes arguments beyond the ones its signature names, which is what says whether it reads the count of vector registers the call passed arguments in.
named: usizeHow many of the arguments the signature does name, so that the ones past it can be told apart from the ones before it.
A convention that passes a variadic float in both register files needs that, because which arguments get the second copy is exactly the ones the callee has no prototype for. Every other convention treats the two the same and never asks.
at: SpanWhere the call was written, which every instruction built for it is filed under.
A call is one of the few places in the machine IR where a run of instructions comes from no term in the IR at all: the stores into the outgoing area, the copies a structure passed by value is made of and the call itself are the convention’s answer rather than anything a rule matched. So there is nothing for them to inherit a span from, and without this the bytes of an entire call statement are covered by whichever row came before them, which is usually the line above. gcc names the line the call is written on over all of it.
Span::DUMMY in a call this crate builds for itself, which is the copy into the argument
area that the runtime does, since that one is under whatever the call it belongs to is under.