pub struct Function {
pub name: String,
pub kind: FunctionKind,
pub parameters: Vec<ValueType>,
pub returns: Vec<ValueType>,
pub basic_blocks: Vec<BasicBlock>,
pub local_count: u16,
}Expand description
IR function representation
Fields§
§name: String§kind: FunctionKind§parameters: Vec<ValueType>§returns: Vec<ValueType>§basic_blocks: Vec<BasicBlock>§local_count: u16Implementations§
Source§impl Function
impl Function
Sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Check if this is a constructor
Sourcepub fn instruction_count(&self) -> usize
pub fn instruction_count(&self) -> usize
Get total instruction count
§impl Function
impl Function
fn from_metadata( metadata: &FunctionMetadata, state_variables: &[StateVariableMetadata], state_index_map: &HashMap<String, usize>, state_types: &[ValueType], defined_struct_types: &[ValueType], event_index_map: &HashMap<String, usize>, event_signature_map: &HashMap<String, Vec<ManifestType>>, enum_variant_map: &HashMap<String, HashMap<String, u64>>, contract_types: &HashSet<String>, selector_registry: &SelectorRegistry, function_names: &HashSet<String>, function_overloads: &HashMap<(String, usize), String>, function_param_names: &HashMap<(String, usize), Vec<String>>, void_functions: &HashSet<String>, super_method_map: &HashMap<String, String>, ) -> Result<Self, Vec<IrDiagnostic>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more