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 InstBuilder for InstBlock
impl InstBuilder for InstBlock
Source§fn require_import(&mut self, name: String)
fn require_import(&mut self, name: String)
Adds a required import.
Source§fn create_value(&mut self, value: ValueInfo) -> Value
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
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)
fn create_inst(&mut self, inst: InstructionInfo)
Pushes an instruction to the InstBuilder’s instruction list.
Source§fn iconst_int(&mut self, value: u64) -> Value
fn iconst_int(&mut self, value: u64) -> Value
Creates an unsigned 64-bit integer constant.
Source§fn iconst_float(&mut self, value: f64) -> Value
fn iconst_float(&mut self, value: f64) -> Value
Creates an unsigned 64-bit float constant.
Source§fn iconst_double(&mut self, value: f64) -> Value
fn iconst_double(&mut self, value: f64) -> Value
Creates an unsigned 64-bit double constant.
Source§fn iconst_bool(&mut self, value: bool) -> Value
fn iconst_bool(&mut self, value: bool) -> Value
Creates a boolean constant.
Source§fn iconst_str(&mut self, value: String) -> Value
fn iconst_str(&mut self, value: String) -> Value
Creates a string constant.
Source§fn iconst_named(&mut self, name: String) -> Value
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
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
fn iconst_named_property(&self, name: String) -> NamedProperty
Returns a new basic NamedProperty.
Source§fn iconst_named_static(&self, name: String) -> NamedProperty
fn iconst_named_static(&self, name: String) -> NamedProperty
Returns a new static NamedProperty.
Source§fn iconst_named_pointer(&self, name: String) -> NamedProperty
fn iconst_named_pointer(&self, name: String) -> NamedProperty
Returns a new pointer NamedProperty.
Source§fn iconst_named_index(&self, name: Value) -> NamedProperty
fn iconst_named_index(&self, name: Value) -> NamedProperty
Returns a new index NamedProperty.
Source§fn ctype_bool(&mut self) -> AbiType
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
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
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
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
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
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
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
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
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
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
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
fn ctype_char(&mut self) -> AbiType
A C-specific character type.
Source§fn iadd(&mut self, l: Value, r: Value) -> Value
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
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
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
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
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
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
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
fn ibit_xor(&mut self, l: Value, r: Value) -> Value
Returns the results of the Bitwise XOR operation.
Source§fn ibit_left(&mut self, l: Value, r: Value) -> Value
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
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
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
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
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
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
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
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 set(&mut self, k: Value, v: Value)
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>)
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
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)
fn return_(&mut self, v: Value)
Returns a value from the function that this InstBuilder resides in.
Source§fn return_none(&mut self)
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§
impl Freeze for InstBlock
impl RefUnwindSafe for InstBlock
impl Send for InstBlock
impl Sync for InstBlock
impl Unpin for InstBlock
impl UnwindSafe for InstBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more