pub struct Places<'a> { /* private fields */ }Expand description
Where the values a call passes are, worked out one after another.
crate::abi::Call answers a different question: whether a value travels in registers at all
and in how many, which is what decides the shape of a signature and is settled before the IR
for a function exists. This answers the question after it. Given values in the order the
signature holds them, it says which register each one is in and how far up the argument area
the ones that got no register are. Both count registers, and they agree about how many fit
because they read the same lists, but they run at opposite ends of the compiler and neither
can be the other.
Ask about each value in the order the signature holds them. Asking out of order answers about a different signature, because where a value is depends on every value before it.
Implementations§
Source§impl<'a> Places<'a>
impl<'a> Places<'a>
Sourcepub fn new(regs: &'a CallRegs) -> Self
pub fn new(regs: &'a CallRegs) -> Self
Where the first value is, for a call under that convention.
Sourcepub fn integer(&mut self) -> Where
pub fn integer(&mut self) -> Where
Where the next value is, when it travels in a general purpose register.
Sourcepub fn float(&mut self) -> Where
pub fn float(&mut self) -> Where
Where the next value is, when it travels in a vector register.
Sourcepub fn on_stack(&mut self, size: u32, align: u32) -> Where
pub fn on_stack(&mut self, size: u32, align: u32) -> Where
Where the next value is, when it travels in memory whatever is left.
Every argument area is a run of whole words, so a value narrower than one still takes one and a value that is not a whole number of them is rounded up. An alignment wider than a word is respected, which is what a sixteen byte aligned structure passed by value needs.
Sourcepub fn size(&self) -> u32
pub fn size(&self) -> u32
How many bytes of argument area the values so far need, shadow space included.
Sourcepub fn integers(&self) -> usize
pub fn integers(&self) -> usize
How many general purpose argument registers the values so far took.
What a variadic callee needs and nothing else does. va_start has to record how far into
each of the two register sequences the arguments the signature names got, because the first
argument it does not name is the one after them, and asking here is the only way to know
that is the same count the caller worked from.