pub struct Function {
pub mem_pool: ObjPtr<IRBuilder>,
pub name: String,
pub entry: Option<BBPtr>,
pub exit: Option<BBPtr>,
pub return_type: ValueType,
pub params: Vec<ParaPtr>,
}Fields§
§mem_pool: ObjPtr<IRBuilder>§name: String§entry: Option<BBPtr>Entry of function, if it is a function that is not defined in this module, it will be None. Such as library function.
exit: Option<BBPtr>Exit of function, if it is a function that is not defined in this module, it will be None. Such as library function.
return_type: ValueType§params: Vec<ParaPtr>BasicBlock of function parameters
Implementations§
Source§impl Function
impl Function
Sourcepub fn is_lib(&self) -> bool
pub fn is_lib(&self) -> bool
Return true if it is a function that is not defined in this module.
Sourcepub fn dfs_iter(&self) -> DFSIterator ⓘ
pub fn dfs_iter(&self) -> DFSIterator ⓘ
Create a depth-first iterator to traverse the graph structure of basicblocks. Traverse in the direction of data flow with the function entry as the starting point. Do not change the graph structure during traversal, which may cause unknown errors
Sourcepub fn bfs_iter(&self) -> BFSIterator ⓘ
pub fn bfs_iter(&self) -> BFSIterator ⓘ
Create a breadth-first iterator to traverse the graph structure of basicblocks. Traverse in the direction of data flow with the function entry as the starting point. Do not change the graph structure during traversal, which may cause unknown errors
Sourcepub fn dfs_iter_rev(&self) -> DFSIteratorRev ⓘ
pub fn dfs_iter_rev(&self) -> DFSIteratorRev ⓘ
Create a depth-first iterator to traverse the graph structure of basicblocks. Traverse in the reverse direction of data flow with the function exit as the starting point. Do not change the graph structure during traversal, which may cause unknown errors
Sourcepub fn bfs_iter_rev(&self) -> BFSIteratorRev ⓘ
pub fn bfs_iter_rev(&self) -> BFSIteratorRev ⓘ
Create a breadth-first iterator to traverse the graph structure of basicblocks. Traverse in the reverse direction of data flow with the function exit as the starting point. Do not change the graph structure during traversal, which may cause unknown errors
Sourcepub fn po_iter(&self) -> POIterator ⓘ
pub fn po_iter(&self) -> POIterator ⓘ
Create a postorder iterator to traverse the graph structure of basicblocks.
Sourcepub fn rpo_iter(&self) -> RPOIterator ⓘ
pub fn rpo_iter(&self) -> RPOIterator ⓘ
Create a reverse postorder iterator to traverse the graph structure of basicblocks.
pub fn gen_llvm_ir(&self) -> String
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
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>
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>
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