pub struct ReadOnly<'a> { /* private fields */ }Expand description
Where a pass puts the tables it asks for, until the pipeline takes them.
Implementations§
Source§impl<'a> ReadOnly<'a>
impl<'a> ReadOnly<'a>
Sourcepub fn new(
names: &'a mut Interner,
taken: &'a HashSet<Symbol>,
pointer_bits: u32,
next: u32,
) -> Self
pub fn new( names: &'a mut Interner, taken: &'a HashSet<Symbol>, pointer_bits: u32, next: u32, ) -> Self
A place for tables in a module where taken are the names already in use.
next is the number the next name is made from. The pipeline makes one of these for every
function a pass runs over, so the count is handed in and read back out with
ReadOnly::next, and two functions never get the same name.
Sourcepub const fn pointer_bits(&self) -> u32
pub const fn pointer_bits(&self) -> u32
The width of an address on the target, which is how wide an index into a table is made.
Sourcepub fn table(&mut self, ty: Type, cells: Vec<i128>) -> Symbol
pub fn table(&mut self, ty: Type, cells: Vec<i128>) -> Symbol
Asks for a table and gets back the name to load from it by.
The name is gcc’s, CSWTCH. and a number, which nothing written in C can spell because of
the dot and which reads the same in a disassembly of either compiler. A name the module
already has is stepped over rather than trusted not to be there, since an asm label can
spell anything.
Sourcepub fn into_tables(self) -> Vec<Table>
pub fn into_tables(self) -> Vec<Table>
Every table asked for so far, in the order they were asked for.