[][src]Struct cranelift_codegen::machinst::lower::Lower

pub struct Lower<'func, I: VCodeInst> { /* fields omitted */ }

Machine-independent lowering driver / machine-instruction container. Maintains a correspondence from original Inst to MachInsts.

Methods

impl<'func, I: VCodeInst> Lower<'func, I>[src]

pub fn new(
    f: &'func Function,
    abi: Box<dyn ABIBody<I = I>>
) -> CodegenResult<Lower<'func, I>>
[src]

Prepare a new lowering context for the given IR function.

pub fn lower<B: LowerBackend<MInst = I>>(
    self,
    backend: &B
) -> CodegenResult<VCode<I>>
[src]

Lower the function.

Trait Implementations

impl<'func, I: VCodeInst> LowerCtx for Lower<'func, I>[src]

type I = I

The instruction type for which this lowering framework is instantiated.

fn data(&self, ir_inst: Inst) -> &InstructionData[src]

Get the instdata for a given IR instruction.

fn ty(&self, ir_inst: Inst) -> Type[src]

Get the controlling type for a polymorphic IR instruction.

fn emit(&mut self, mach_inst: I)[src]

Emit a machine instruction.

fn merged(&mut self, from_inst: Inst)[src]

Indicate that a merge has occurred.

fn input_inst(&self, ir_inst: Inst, idx: usize) -> Option<(Inst, usize)>[src]

Get the producing instruction, if any, and output number, for the idxth input to the given IR instruction.

fn value_to_writable_reg(&self, val: Value) -> Writable<Reg>[src]

Map a Value to its associated writable (probably virtual) Reg.

fn value_to_reg(&self, val: Value) -> Reg[src]

Map a Value to its associated (probably virtual) Reg.

fn input(&self, ir_inst: Inst, idx: usize) -> Reg[src]

Get the idxth input to the given IR instruction as a virtual register.

fn output(&self, ir_inst: Inst, idx: usize) -> Writable<Reg>[src]

Get the idxth output of the given IR instruction as a virtual register.

fn tmp(&mut self, rc: RegClass, ty: Type) -> Writable<Reg>[src]

Get a new temp.

fn num_inputs(&self, ir_inst: Inst) -> usize[src]

Get the number of inputs for the given IR instruction.

fn num_outputs(&self, ir_inst: Inst) -> usize[src]

Get the number of outputs for the given IR instruction.

fn input_ty(&self, ir_inst: Inst, idx: usize) -> Type[src]

Get the type for an instruction's input.

fn output_ty(&self, ir_inst: Inst, idx: usize) -> Type[src]

Get the type for an instruction's output.

fn num_bb_params(&self, bb: Block) -> usize[src]

Get the number of block params.

fn bb_param(&self, bb: Block, idx: usize) -> Reg[src]

Get the register for a block param.

fn retval(&self, idx: usize) -> Writable<Reg>[src]

Get the register for a return value.

fn call_target<'b>(&'b self, ir_inst: Inst) -> Option<&'b ExternalName>[src]

Get the target for a call instruction, as an ExternalName.

fn call_sig<'b>(&'b self, ir_inst: Inst) -> Option<&'b Signature>[src]

Get the signature for a call or call-indirect instruction.

fn symbol_value<'b>(&'b self, ir_inst: Inst) -> Option<(&'b ExternalName, i64)>[src]

Get the symbol name and offset for a symbol_value instruction.

fn memflags(&self, ir_inst: Inst) -> Option<MemFlags>[src]

Returns the memory flags of a given memory access.

fn srcloc(&self, ir_inst: Inst) -> SourceLoc[src]

Get the source location for a given instruction.

Auto Trait Implementations

impl<'func, I> !RefUnwindSafe for Lower<'func, I>

impl<'func, I> !Send for Lower<'func, I>

impl<'func, I> !Sync for Lower<'func, I>

impl<'func, I> Unpin for Lower<'func, I> where
    I: Unpin

impl<'func, I> !UnwindSafe for Lower<'func, I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.