Struct cranelift_codegen::machinst::vcode::VCodeBuilder [−][src]
pub struct VCodeBuilder<I: VCodeInst> { /* fields omitted */ }
Expand description
A builder for a VCode function body. This builder is designed for the lowering approach that we take: we traverse basic blocks in forward (original IR) order, but within each basic block, we generate code from bottom to top; and within each IR instruction that we visit in this reverse order, we emit machine instructions in forward order again.
Hence, to produce the final instructions in proper order, we perform two
swaps. First, the machine instructions (I
instances) are produced in
forward order for an individual IR instruction. Then these are reversed
and concatenated to bb_insns
at the end of the IR instruction lowering.
The bb_insns
vec will thus contain all machine instructions for a basic
block, in reverse order. Finally, when we’re done with a basic block, we
reverse the whole block’s vec of instructions again, and concatenate onto
the VCode’s insts.
Implementations
pub fn new(
abi: Box<dyn ABICallee<I = I>>,
emit_info: I::Info,
block_order: BlockLoweringOrder,
constants: VCodeConstants
) -> VCodeBuilder<I>
[src]
pub fn new(
abi: Box<dyn ABICallee<I = I>>,
emit_info: I::Info,
block_order: BlockLoweringOrder,
constants: VCodeConstants
) -> VCodeBuilder<I>
[src]Create a new VCodeBuilder.
Access to the BlockLoweringOrder object.
Set the type of a VReg.
Are there any reference-typed values at all among the vregs?
Set the current block as the entry block.
End the current basic block. Must be called after emitting vcode insts for IR insts and prior to ending the function (building the VCode).
Push an instruction for the current BB and current IR inst within the BB.
Get the current source location.
Set the current source location.
Access the constants.
Auto Trait Implementations
impl<I> !RefUnwindSafe for VCodeBuilder<I>
impl<I> !Send for VCodeBuilder<I>
impl<I> !Sync for VCodeBuilder<I>
impl<I> Unpin for VCodeBuilder<I> where
I: Unpin,
<I as MachInstEmit>::Info: Unpin,
impl<I> !UnwindSafe for VCodeBuilder<I>