Struct debris_llir::opt::global_opt::GlobalOptimizer
source · pub struct GlobalOptimizer<'a> {
pub config: &'a Config,
pub runtime: &'a Runtime,
pub functions: FxHashMap<BlockId, Function>,
}
Expand description
Does optimization on the whole program.
This allows (along others) for removing unused commands
Fields§
§config: &'a Config
§runtime: &'a Runtime
§functions: FxHashMap<BlockId, Function>
Implementations§
source§impl<'a> GlobalOptimizer<'a>
impl<'a> GlobalOptimizer<'a>
source§impl GlobalOptimizer<'_>
impl GlobalOptimizer<'_>
fn optimize(&mut self) -> CodeStats
pub fn get_function(&self, id: BlockId) -> &Function
pub fn get_function_mut(&mut self, id: BlockId) -> &mut Function
sourcepub fn iter_functions(
&self
) -> impl Iterator<Item = impl Iterator<Item = ((BlockId, usize), &Node)>>
pub fn iter_functions( &self ) -> impl Iterator<Item = impl Iterator<Item = ((BlockId, usize), &Node)>>
Iterates over all functions
sourcepub fn iter_nodes(&self) -> impl Iterator<Item = ((BlockId, usize), &Node)> + '_
pub fn iter_nodes(&self) -> impl Iterator<Item = ((BlockId, usize), &Node)> + '_
Iterates over all nodes.
sourcepub fn iter_at(
&self,
item: &(BlockId, usize)
) -> impl Iterator<Item = ((BlockId, usize), &Node)> + '_
pub fn iter_at( &self, item: &(BlockId, usize) ) -> impl Iterator<Item = ((BlockId, usize), &Node)> + '_
Iterates all subsequent nodes of this function
pub fn previous_node( &self, node_id: &(BlockId, usize) ) -> Option<((BlockId, usize), &Node)>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for GlobalOptimizer<'a>
impl<'a> !Send for GlobalOptimizer<'a>
impl<'a> !Sync for GlobalOptimizer<'a>
impl<'a> Unpin for GlobalOptimizer<'a>
impl<'a> !UnwindSafe for GlobalOptimizer<'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