Skip to main content

ReadOnly

Struct ReadOnly 

Source
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>

Source

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.

Source

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.

Source

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.

Source

pub const fn next(&self) -> u32

The number the next name will be made from.

Source

pub fn into_tables(self) -> Vec<Table>

Every table asked for so far, in the order they were asked for.

Trait Implementations§

Source§

impl<'a> Debug for ReadOnly<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for ReadOnly<'a>

§

impl<'a> Freeze for ReadOnly<'a>

§

impl<'a> RefUnwindSafe for ReadOnly<'a>

§

impl<'a> Send for ReadOnly<'a>

§

impl<'a> Sync for ReadOnly<'a>

§

impl<'a> Unpin for ReadOnly<'a>

§

impl<'a> UnsafeUnpin for ReadOnly<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.