pub struct BlockBuilder<'a> {
pub block_id: BlockId,
/* private fields */
}Fields§
§block_id: BlockIdImplementations§
Source§impl<'a> BlockBuilder<'a>
impl<'a> BlockBuilder<'a>
pub fn new( block_id: BlockId, function_name: String, context: &'a mut IRContext, registry: &'a mut IRRegistry, ) -> Self
pub fn set_source_location(&mut self, location: SourceLocation)
pub fn clear_source_location(&mut self)
pub fn block_id(&self) -> BlockId
pub fn add(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn sub(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn mul(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn div(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn mod_(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn pow(&mut self, base: Value, exp: Value) -> Value
pub fn checked_add(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn checked_sub(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn checked_mul(&mut self, left: Value, right: Value, ty: Type) -> Value
pub fn and(&mut self, left: Value, right: Value) -> Value
pub fn or(&mut self, left: Value, right: Value) -> Value
pub fn xor(&mut self, left: Value, right: Value) -> Value
pub fn not(&mut self, operand: Value) -> Value
pub fn shl(&mut self, value: Value, shift: Value) -> Value
pub fn shr(&mut self, value: Value, shift: Value) -> Value
pub fn sar(&mut self, value: Value, shift: Value) -> Value
pub fn eq(&mut self, left: Value, right: Value) -> Value
pub fn ne(&mut self, left: Value, right: Value) -> Value
pub fn lt(&mut self, left: Value, right: Value) -> Value
pub fn gt(&mut self, left: Value, right: Value) -> Value
pub fn le(&mut self, left: Value, right: Value) -> Value
pub fn ge(&mut self, left: Value, right: Value) -> Value
pub fn select( &mut self, condition: Value, then_val: Value, else_val: Value, ) -> Value
pub fn allocate(&mut self, ty: Type, size: Size) -> Value
pub fn storage_load(&mut self, slot: BigUint) -> Value
pub fn storage_store(&mut self, slot: BigUint, value: Value)
pub fn mapping_load(&mut self, mapping: Value, key: Value) -> Value
pub fn mapping_store(&mut self, mapping: Value, key: Value, value: Value)
pub fn array_load(&mut self, array: Value, index: Value) -> Value
pub fn array_store(&mut self, array: Value, index: Value, value: Value)
pub fn array_length(&mut self, array: Value) -> Value
pub fn array_push(&mut self, array: Value, value: Value)
pub fn array_pop(&mut self, array: Value) -> Value
pub fn msg_sender(&mut self) -> Value
pub fn msg_value(&mut self) -> Value
pub fn block_number(&mut self) -> Value
pub fn block_timestamp(&mut self) -> Value
pub fn call_internal(&mut self, name: &str, args: Vec<Value>) -> Value
pub fn call_external( &mut self, target: Value, selector: Value, args: Vec<Value>, value: Option<Value>, ) -> Value
pub fn keccak256(&mut self, data: Value, len: Value) -> Value
pub fn sha256(&mut self, data: Value, len: Value) -> Value
pub fn emit_event( &mut self, event_id: EventId, topics: Vec<Value>, data: Vec<Value>, )
pub fn cast(&mut self, value: Value, to: Type) -> Value
pub fn assert(&mut self, condition: Value, message: &str)
pub fn require(&mut self, condition: Value, message: &str)
pub fn assign(&mut self, result: Value, value: Value)
pub fn phi(&mut self, values: Vec<(BlockId, Value)>) -> Value
pub fn jump(&mut self, target: BlockId) -> Result<()>
pub fn branch( &mut self, condition: Value, then_block: BlockId, else_block: BlockId, ) -> Result<()>
pub fn return_value(&mut self, value: Value) -> Result<()>
pub fn return_void(&mut self) -> Result<()>
pub fn revert(&mut self, message: &str) -> Result<()>
pub fn is_sealed(&self) -> bool
pub fn seal_with_terminator(&mut self, terminator: Terminator) -> Result<()>
pub fn new_temp(&mut self) -> Value
pub fn constant_uint(&self, value: u64, bits: u16) -> Value
pub fn constant_int(&self, value: i64, bits: u16) -> Value
pub fn constant_bool(&self, value: bool) -> Value
pub fn constant_address(&self, bytes: [u8; 20]) -> Value
Source§impl<'a> BlockBuilder<'a>
impl<'a> BlockBuilder<'a>
pub fn cursor_at_end(&mut self) -> CursorPosition
pub fn cursor_at_start(&mut self) -> CursorPosition
Trait Implementations§
Source§impl<'a> InstBuilder<'a> for BlockBuilder<'a>
impl<'a> InstBuilder<'a> for BlockBuilder<'a>
fn add(&mut self, left: Value, right: Value, ty: Type) -> Value
fn sub(&mut self, left: Value, right: Value, ty: Type) -> Value
fn mul(&mut self, left: Value, right: Value, ty: Type) -> Value
fn div(&mut self, left: Value, right: Value, ty: Type) -> Value
fn mod_(&mut self, left: Value, right: Value, ty: Type) -> Value
fn pow(&mut self, base: Value, exp: Value) -> Value
fn and(&mut self, left: Value, right: Value) -> Value
fn or(&mut self, left: Value, right: Value) -> Value
fn xor(&mut self, left: Value, right: Value) -> Value
fn not(&mut self, operand: Value) -> Value
fn shl(&mut self, value: Value, shift: Value) -> Value
fn shr(&mut self, value: Value, shift: Value) -> Value
fn sar(&mut self, value: Value, shift: Value) -> Value
fn eq(&mut self, left: Value, right: Value) -> Value
fn ne(&mut self, left: Value, right: Value) -> Value
fn lt(&mut self, left: Value, right: Value) -> Value
fn gt(&mut self, left: Value, right: Value) -> Value
fn le(&mut self, left: Value, right: Value) -> Value
fn ge(&mut self, left: Value, right: Value) -> Value
fn jump(&mut self, target: BlockId, args: Vec<Value>)
fn branch( &mut self, condition: Value, then_block: BlockId, else_block: BlockId, then_args: Vec<Value>, else_args: Vec<Value>, )
fn return_value(&mut self, value: Option<Value>)
fn assign(&mut self, dest: Value, src: Value)
fn phi(&mut self, values: Vec<(BlockId, Value)>) -> Value
Source§impl<'a> InstBuilderBase<'a> for BlockBuilder<'a>
impl<'a> InstBuilderBase<'a> for BlockBuilder<'a>
Source§impl<'a> InstBuilderExt<'a> for BlockBuilder<'a>
impl<'a> InstBuilderExt<'a> for BlockBuilder<'a>
fn storage_load(&mut self, slot: BigUint) -> Value
fn storage_store(&mut self, slot: BigUint, value: Value)
fn storage_load_dynamic(&mut self, slot: Value) -> Value
fn storage_store_dynamic(&mut self, slot: Value, value: Value)
fn mapping_load(&mut self, mapping: Value, key: Value) -> Value
fn mapping_store(&mut self, mapping: Value, key: Value, value: Value)
fn array_load(&mut self, array: Value, index: Value) -> Value
fn array_store(&mut self, array: Value, index: Value, value: Value)
fn array_length(&mut self, array: Value) -> Value
fn array_push(&mut self, array: Value, value: Value)
fn array_pop(&mut self, array: Value) -> Value
fn msg_sender(&mut self) -> Value
fn msg_value(&mut self) -> Value
fn msg_data(&mut self) -> Value
fn block_number(&mut self) -> Value
fn block_timestamp(&mut self) -> Value
fn block_difficulty(&mut self) -> Value
fn block_gaslimit(&mut self) -> Value
fn block_coinbase(&mut self) -> Value
fn tx_origin(&mut self) -> Value
fn tx_gasprice(&mut self) -> Value
fn gas_left(&mut self) -> Value
fn msg_sig(&mut self) -> Value
fn block_chainid(&mut self) -> Value
fn block_basefee(&mut self) -> Value
fn call_internal(&mut self, name: &str, args: Vec<Value>) -> Value
fn call_external( &mut self, target: Value, selector: Value, args: Vec<Value>, value: Option<Value>, ) -> Value
fn delegate_call( &mut self, target: Value, selector: Value, args: Vec<Value>, ) -> Value
fn static_call( &mut self, target: Value, selector: Value, args: Vec<Value>, ) -> Value
fn emit_event(&mut self, event: EventId, topics: Vec<Value>, data: Vec<Value>)
fn keccak256(&mut self, data: Value, len: Value) -> Value
fn sha256(&mut self, data: Value, len: Value) -> Value
fn ripemd160(&mut self, data: Value, len: Value) -> Value
fn ecrecover(&mut self, hash: Value, v: Value, r: Value, s: Value) -> Value
fn checked_add(&mut self, left: Value, right: Value, ty: Type) -> Value
fn checked_sub(&mut self, left: Value, right: Value, ty: Type) -> Value
fn checked_mul(&mut self, left: Value, right: Value, ty: Type) -> Value
fn checked_div(&mut self, left: Value, right: Value, ty: Type) -> Value
fn require(&mut self, condition: Value, message: &str)
fn assert(&mut self, condition: Value, message: &str)
fn revert(&mut self, message: &str)
fn memory_alloc(&mut self, size: Value) -> Value
fn memory_copy(&mut self, dest: Value, src: Value, size: Value)
fn memory_size(&mut self) -> Value
fn cast(&mut self, value: Value, to: Type) -> Value
fn zext(&mut self, value: Value, to: Type) -> Value
fn sext(&mut self, value: Value, to: Type) -> Value
fn trunc(&mut self, value: Value, to: Type) -> Value
Auto Trait Implementations§
impl<'a> !UnwindSafe for BlockBuilder<'a>
impl<'a> Freeze for BlockBuilder<'a>
impl<'a> RefUnwindSafe for BlockBuilder<'a>
impl<'a> Send for BlockBuilder<'a>
impl<'a> Sync for BlockBuilder<'a>
impl<'a> Unpin for BlockBuilder<'a>
impl<'a> UnsafeUnpin for BlockBuilder<'a>
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