[−][src]Struct cranelift_codegen::machinst::lower::Lower
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]
f: &'func Function,
abi: Box<dyn ABIBody<I = I>>
) -> CodegenResult<Lower<'func, I>>
Prepare a new lowering context for the given IR function.
pub fn lower<B: LowerBackend<MInst = I>>(
self,
backend: &B
) -> CodegenResult<VCode<I>>
[src]
self,
backend: &B
) -> CodegenResult<VCode<I>>
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 abi(&mut self) -> &dyn ABIBody<I = I>
[src]
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 idx
th 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 idx
th input to the given IR instruction as a virtual register.
fn output(&self, ir_inst: Inst, idx: usize) -> Writable<Reg>
[src]
Get the idx
th 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,
I: Unpin,
impl<'func, I> !UnwindSafe for Lower<'func, I>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,