pub struct OptimizationConfig {
pub moveable_functions: Vec<String>,
pub inline_small_functions_threshold: usize,
}
Expand description
A configuration struct that controls the behavior of the optimization passes.
Fields§
§moveable_functions: Vec<String>
A list of functions that can be moved during the reorder_statements optimization.
inline_small_functions_threshold: usize
The size of functions (in lowering statements) below which they are marked as
should_inline
.
Implementations§
source§impl OptimizationConfig
impl OptimizationConfig
sourcepub fn with_moveable_functions(self, moveable_functions: Vec<String>) -> Self
pub fn with_moveable_functions(self, moveable_functions: Vec<String>) -> Self
Sets the list of moveable functions.
sourcepub fn with_minimal_movable_functions(self) -> Self
pub fn with_minimal_movable_functions(self) -> Self
Sets the list of moveable functions to a minimal set, useful for testing.
sourcepub fn with_inline_small_functions_threshold(
self,
inline_small_functions_threshold: usize
) -> Self
pub fn with_inline_small_functions_threshold( self, inline_small_functions_threshold: usize ) -> Self
Sets the threshold for inlining small functions.
Trait Implementations§
source§impl Clone for OptimizationConfig
impl Clone for OptimizationConfig
source§fn clone(&self) -> OptimizationConfig
fn clone(&self) -> OptimizationConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OptimizationConfig
impl Debug for OptimizationConfig
source§impl Default for OptimizationConfig
impl Default for OptimizationConfig
source§impl PartialEq for OptimizationConfig
impl PartialEq for OptimizationConfig
source§fn eq(&self, other: &OptimizationConfig) -> bool
fn eq(&self, other: &OptimizationConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for OptimizationConfig
impl StructuralPartialEq for OptimizationConfig
Auto Trait Implementations§
impl RefUnwindSafe for OptimizationConfig
impl Send for OptimizationConfig
impl Sync for OptimizationConfig
impl Unpin for OptimizationConfig
impl UnwindSafe for OptimizationConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.