[−][src]Struct cranelift_codegen::ir::InsertBuilder
Builder that inserts an instruction at the current position.
An InsertBuilder
is a wrapper for an InstInserterBase
that turns it into an instruction
builder with some additional facilities for creating instructions that reuse existing values as
their results.
Methods
impl<'f, IIB: InstInserterBase<'f>> InsertBuilder<'f, IIB>
[src]
pub fn new(inserter: IIB) -> Self
[src]
Create a new builder which inserts instructions at pos
.
The dfg
and pos.layout
references should be from the same Function
.
pub fn with_results<Array>(
self,
reuse: Array
) -> InsertReuseBuilder<'f, IIB, Array> where
Array: AsRef<[Option<Value>]>,
[src]
self,
reuse: Array
) -> InsertReuseBuilder<'f, IIB, Array> where
Array: AsRef<[Option<Value>]>,
Reuse result values in reuse
.
Convert this builder into one that will reuse the provided result values instead of allocating new ones. The provided values for reuse must not be attached to anything. Any missing result values will be allocated as normal.
The reuse
argument is expected to be an array of Option<Value>
.
pub fn with_result(
self,
v: Value
) -> InsertReuseBuilder<'f, IIB, [Option<Value>; 1]>
[src]
self,
v: Value
) -> InsertReuseBuilder<'f, IIB, [Option<Value>; 1]>
Reuse a single result value.
Convert this into a builder that will reuse v
as the single result value. The reused
result value v
must not be attached to anything.
This method should only be used when building an instruction with exactly one result. Use
with_results()
for the more general case.
Trait Implementations
impl<'f, IIB: InstInserterBase<'f>> InstBuilderBase<'f> for InsertBuilder<'f, IIB>
[src]
fn data_flow_graph(&self) -> &DataFlowGraph
[src]
fn data_flow_graph_mut(&mut self) -> &mut DataFlowGraph
[src]
fn build(
self,
data: InstructionData,
ctrl_typevar: Type
) -> (Inst, &'f mut DataFlowGraph)
[src]
self,
data: InstructionData,
ctrl_typevar: Type
) -> (Inst, &'f mut DataFlowGraph)
Auto Trait Implementations
impl<'f, IIB> Send for InsertBuilder<'f, IIB> where
IIB: Send,
IIB: Send,
impl<'f, IIB> Sync for InsertBuilder<'f, IIB> where
IIB: Sync,
IIB: Sync,
impl<'f, IIB> Unpin for InsertBuilder<'f, IIB> where
IIB: Unpin,
IIB: Unpin,
impl<'f, IIB> RefUnwindSafe for InsertBuilder<'f, IIB> where
IIB: RefUnwindSafe,
IIB: RefUnwindSafe,
impl<'f, IIB> UnwindSafe for InsertBuilder<'f, IIB> where
IIB: UnwindSafe,
IIB: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,