VCodeGenerator

Struct VCodeGenerator 

Source
pub struct VCodeGenerator<I, S>
where S: InstructionSelector<Instruction = I>, I: Instr,
{ /* private fields */ }
Expand description

VCodeGenerator is an internal structure used to generate VCode for a given backend.

Implementations§

Source§

impl<I, S> VCodeGenerator<I, S>
where S: InstructionSelector<Instruction = I>, I: Instr,

Source

pub fn get_vreg(&mut self, value: Value) -> VReg

Gets the VReg associated with the given Value.

Source

pub fn new_unassociated_vreg(&mut self) -> VReg

Creates a new VReg that is unassociated with any Value.

Source

pub fn func_map(&self) -> &HashMap<FunctionId, usize>

Returns the map from IR FunctionIds to indexes into the VCode’s list of functions.

Source

pub fn label_map(&self) -> &HashMap<BasicBlockId, usize>

Returns the map from IR BasicBlockIds to indexes into the current function’s list of labels.

Source

pub fn push_prelabel_instruction(&mut self, instruction: I)

Source

pub fn push_prereturn_instruction(&mut self, instruction: I)

Source

pub fn push_instruction(&mut self, instruction: I)

Pushes an instruction into the VCode being generated.

Auto Trait Implementations§

§

impl<I, S> Freeze for VCodeGenerator<I, S>

§

impl<I, S> RefUnwindSafe for VCodeGenerator<I, S>

§

impl<I, S> Send for VCodeGenerator<I, S>
where S: Send, I: Send,

§

impl<I, S> Sync for VCodeGenerator<I, S>
where S: Sync, I: Sync,

§

impl<I, S> Unpin for VCodeGenerator<I, S>
where S: Unpin, I: Unpin,

§

impl<I, S> UnwindSafe for VCodeGenerator<I, S>
where S: UnwindSafe, I: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.