Skip to main content

Lowerings

Struct Lowerings 

Source
pub struct Lowerings { /* private fields */ }
Expand description

What the group did to every function a run lowered, in the order they came through.

The same shape crate::pressure::Pressure has and for the same reason: a caller collects one of these over a whole command line and asks for the listing once at the end.

Implementations§

Source§

impl Lowerings

Source

pub fn new() -> Self

Nothing recorded, and nothing counted either.

Source

pub fn asked(wanted: bool) -> Self

The same, told whether to count, which is what -Zlowering=FILE decides.

Source

pub fn wanted(&self) -> bool

Whether the counting is worth doing, which is what group is passed.

This is a question and not an assumption for a reason that showed up as soon as the numbers were measured on something large. Counting is a walk of the function per step, and a function’s instructions are a linked list, so on the SQLite amalgamation the walks cost about two seconds on top of nine, which is more than several of the passes they are measuring. A debugging aid nobody asked for should cost nothing, so a run without the flag runs the group and records no numbers at all.

Source

pub fn record(&mut self, name: &str, ran: Ran)

Writes down what the group did to one function.

Source

pub fn merge(&mut self, other: &Self)

Takes in everything another one recorded, which is how one file’s answer joins a run’s.

Source

pub fn functions(&self) -> usize

How many functions went through the group.

Source

pub fn listing(&self) -> String

What -Zlowering=FILE writes.

A comment holding the count and then one block per function. Whoever reads one of these is looking for which step changed a function they are surprised by, so the file is the same text in the same order as the group ran, and every step is there whether it did anything or not. A dump listing only the steps that fired could not tell a step that found nothing from a step somebody forgot to put in the group, which is half of what this is read for.

Trait Implementations§

Source§

impl Clone for Lowerings

Source§

fn clone(&self) -> Lowerings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Lowerings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Lowerings

Source§

fn default() -> Lowerings

Returns the “default value” for a type. Read more
Source§

impl Eq for Lowerings

Source§

impl PartialEq for Lowerings

Source§

fn eq(&self, other: &Lowerings) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Lowerings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.