pub struct Lowered {
pub cases: usize,
pub clusters: usize,
pub tables: usize,
pub bits: usize,
pub searched: bool,
pub peeled: bool,
}Expand description
What one switch became, which is what -fopt-info says about it.
Fields§
§cases: usizeHow many case labels it had, not counting the default.
clusters: usizeHow many clusters those fell into, with a table or a bit test counting as one.
tables: usizeHow many of the clusters are jump tables.
bits: usizeHow many are bit tests.
searched: boolWhether the clusters are searched rather than tested one after another.
peeled: boolWhether a hot case was tested on its own ahead of the rest.
Implementations§
Source§impl Lowered
impl Lowered
Sourcepub fn shape(&self) -> &'static str
pub fn shape(&self) -> &'static str
One word for the shape, in gcc’s terms: a table when any part of it is one, then a bit test, then a tree or a walk.
A switch is a partition and can be several of these at once. The word names the part that
decides what it costs, which is what a comparison with gcc’s choice wants, and the counts
in Lowered::describe say the rest.
Trait Implementations§
impl Copy for Lowered
impl Eq for Lowered
impl StructuralPartialEq for Lowered
Auto Trait Implementations§
impl Freeze for Lowered
impl RefUnwindSafe for Lowered
impl Send for Lowered
impl Sync for Lowered
impl Unpin for Lowered
impl UnsafeUnpin for Lowered
impl UnwindSafe for Lowered
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