InstBlock

Struct InstBlock 

Source
pub struct InstBlock {
    pub block_type: BlockType,
    pub elses: Vec<InstBlock>,
    pub else_block: Option<Box<InstBlock>>,
    pub values: Vec<ValueInfo>,
    pub insts: Vec<InstructionInfo>,
    pub imports: Vec<String>,
    pub blocks: Vec<InstBlock>,
}
Expand description

A block for instruction building.

Fields§

§block_type: BlockType

The type of the block.

§elses: Vec<InstBlock>

A list of elseif statements for the block, if any.

§else_block: Option<Box<InstBlock>>

An else_block for If blocks.

§values: Vec<ValueInfo>

A list of values defined in the block.

§insts: Vec<InstructionInfo>

A list of instructions in the block.

§imports: Vec<String>

A list of imports in the block.

§blocks: Vec<InstBlock>

A list of nested blocks in the block.

Trait Implementations§

Source§

impl Clone for InstBlock

Source§

fn clone(&self) -> InstBlock

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl InstBuilder for InstBlock

Source§

fn require_import(&mut self, name: String)

Adds a required import.
Source§

fn create_value(&mut self, value: ValueInfo) -> Value

Defines a value in the InstBuilder’s values table, then returning the value.
Source§

fn create_block(&mut self, block: InstBlock) -> Block

Creates a block and registers it in the InstBuilder’s block table, returning a reference to said block.
Source§

fn create_inst(&mut self, inst: InstructionInfo)

Pushes an instruction to the InstBuilder’s instruction list.
Source§

fn use_block(&mut self, block: Block) -> &mut InstBlock

Returns a pointer to the given block.
Source§

fn iconst_int(&mut self, value: u64) -> Value

Creates an unsigned 64-bit integer constant.
Source§

fn iconst_float(&mut self, value: f64) -> Value

Creates an unsigned 64-bit float constant.
Source§

fn iconst_double(&mut self, value: f64) -> Value

Creates an unsigned 64-bit double constant.
Source§

fn iconst_bool(&mut self, value: bool) -> Value

Creates a boolean constant.
Source§

fn iconst_str(&mut self, value: String) -> Value

Creates a string constant.
Source§

fn iconst_named(&mut self, name: String) -> Value

Creates a named reference constant.
Source§

fn iconst_named_props( &mut self, name: String, props: Vec<NamedProperty>, ) -> Value

Creates a named reference constant including the provided properties.
Source§

fn iconst_named_property(&self, name: String) -> NamedProperty

Returns a new basic NamedProperty.
Source§

fn iconst_named_static(&self, name: String) -> NamedProperty

Returns a new static NamedProperty.
Source§

fn iconst_named_pointer(&self, name: String) -> NamedProperty

Returns a new pointer NamedProperty.
Source§

fn iconst_named_index(&self, name: Value) -> NamedProperty

Returns a new index NamedProperty.
Source§

fn ctype_bool(&mut self) -> AbiType

Creates a C target specific boolean type. Requires the stdbool.h standard library to be provided by your C compiler.
Source§

fn ctype_uint8(&mut self) -> AbiType

Creates a C target specific 8 bit unsigned integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_uint16(&mut self) -> AbiType

Creates a C target specific 16 bit unsigned integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_uint32(&mut self) -> AbiType

Creates a C target specific 32 bit unsigned integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_uint64(&mut self) -> AbiType

Creates a C target specific 64 bit unsigned integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_usize(&mut self) -> AbiType

Creates a C target specific size that scales to the target’s architecture. For 32-bit processors, this is the same as a uint32 and for 64-bit architectures this is the same as a uint64.
Source§

fn ctype_int8(&mut self) -> AbiType

Creates a C target specific 8 bit integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_int16(&mut self) -> AbiType

Creates a C target specific 16 bit integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_int32(&mut self) -> AbiType

Creates a C target specific 32 bit integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_int64(&mut self) -> AbiType

Creates a C target specific 64 bit integer type. Requires the stdint.h standard library to be provided by your C compiler.
Source§

fn ctype_isize(&mut self) -> AbiType

Creates a C target specific size that scales to the target’s architecture. For 32-bit processors, this is the same as an int32 and for 64-bit architectures this is the same as an int64.
Source§

fn ctype_char(&mut self) -> AbiType

A C-specific character type.
Source§

fn iadd(&mut self, l: Value, r: Value) -> Value

Adds two values together and returns the sum of the expression.
Source§

fn isub(&mut self, l: Value, r: Value) -> Value

Subtracts two values together and returns the sum of the expression.
Source§

fn imul(&mut self, l: Value, r: Value) -> Value

Multiplies two values together and returns the sum of the expression.
Source§

fn idiv(&mut self, l: Value, r: Value) -> Value

Divides two values together and returns the sum of the expression.
Source§

fn imod(&mut self, l: Value, r: Value) -> Value

Divides two values together and returns the remainder of the expression. Equivalent to the % (modulus) operator.
Source§

fn ibit_and(&mut self, l: Value, r: Value) -> Value

Returns the results of the Bitwise AND operation.
Source§

fn ibit_or(&mut self, l: Value, r: Value) -> Value

Returns the results of the Bitwise OR operation.
Source§

fn ibit_xor(&mut self, l: Value, r: Value) -> Value

Returns the results of the Bitwise XOR operation.
Source§

fn ibit_not(&mut self, l: Value) -> Value

Returns the results of the Bitwise NOT operation.
Source§

fn ibit_left(&mut self, l: Value, r: Value) -> Value

Returns the results of the Bitwise left shift operation.
Source§

fn ibit_right(&mut self, l: Value, r: Value) -> Value

Returns the results of the Bitwise right shift operation.
Source§

fn itest_eq(&mut self, l: Value, r: Value) -> Value

Tests if two values are equal to eachother. Returns a boolean value with the result of the operation.
Source§

fn itest_neq(&mut self, l: Value, r: Value) -> Value

Tests if two values are not equal to eachother. Returns a boolean value with the result of the operation.
Source§

fn itest_gt(&mut self, l: Value, r: Value) -> Value

Tests if the first value is greater than the second. Returns a boolean value with the result of the operation.
Source§

fn itest_gt_eq(&mut self, l: Value, r: Value) -> Value

Tests if the first value is greater than or equal to the second. Returns a boolean value with the result of the operation.
Source§

fn itest_lt(&mut self, l: Value, r: Value) -> Value

Tests if the first value is less than the second. Returns a boolean value with the result of the operation.
Source§

fn itest_lt_eq(&mut self, l: Value, r: Value) -> Value

Tests if the first value is less than or equal to the second. Returns a boolean value with the result of the operation.
Source§

fn inot(&mut self, l: Value) -> Value

Negates a boolean value.
Source§

fn ior(&mut self, l: Value, r: Value) -> Value

Returns if either value is equal to true.
Source§

fn iand(&mut self, l: Value, r: Value) -> Value

Returns if both values are equal to true.
Source§

fn jmp(&mut self, block: Block)

Unconditionally jumps to a certain block.
Source§

fn iuse(&mut self, named: Named) -> Value

Uses a named reference as a value.
Source§

fn set(&mut self, k: Value, v: Value)

Sets a value, equivalent to the = assignment operator in most programming languages.
Source§

fn call(&mut self, k: Value, args: Vec<Value>)

Makes a function call with the specified function name and arguments.
Source§

fn icall(&mut self, k: Value, args: Vec<Value>) -> Value

Makes a function call and returns the value that the function call returns.
Source§

fn return_(&mut self, v: Value)

Returns a value from the function that this InstBuilder resides in.
Source§

fn return_none(&mut self)

Returns and exits the function, without returning a value. The function should have a return type of void.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.