twiggy_ir

Struct Items

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

The architecture- and target-independent internal representation of functions, sections, etc in a file that is being size profiled.

Constructed with ItemsBuilder.

Implementations§

Source§

impl Items

Source

pub fn iter(&self) -> Iter<'_>

Iterate over all of the IR items.

Source

pub fn neighbors(&self, id: Id) -> Neighbors<'_>

Iterate over an item’s neighbors.

Source

pub fn predecessors(&self, id: Id) -> Predecessors<'_>

Iterate over an item’s predecessors.

Source

pub fn size(&self) -> u32

The size of the total binary, containing all items.

Source

pub fn meta_root(&self) -> Id

Get the id of the “meta root” which is a single root item with edges to all of the real roots.

Source

pub fn compute_predecessors(&mut self)

Force computation of predecessors.

Source

pub fn compute_dominators(&mut self)

Compute dominators for each item.

Source

pub fn immediate_dominators(&self) -> &BTreeMap<Id, Id>

Get a refercence to immediate dominators

Source

pub fn compute_dominator_tree(&mut self)

Force computation of the dominator tree.

Source

pub fn dominator_tree(&self) -> &BTreeMap<Id, Vec<Id>>

Get a reference to the dominator tree.

Must have already called compute_dominator_tree.

Source

pub fn compute_retained_sizes(&mut self)

Force computation of the retained sizes of each IR item.

Source

pub fn retained_size(&self, id: Id) -> u32

Get the given item’s retained size.

Source

pub fn get_item_by_name(&self, name: &str) -> Option<&Item>

Get an item with the given name.

Trait Implementations§

Source§

impl Debug for Items

Source§

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

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

impl GraphBase for Items

Source§

type EdgeId = ()

edge identifier
Source§

type NodeId = Id

node identifier
Source§

impl Index<Id> for Items

Source§

type Output = Item

The returned type after indexing.
Source§

fn index(&self, id: Id) -> &Item

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IntoNeighbors for &'a Items

Source§

type Neighbors = Neighbors<'a>

Source§

fn neighbors(self, id: Id) -> Self::Neighbors

Return an iterator of the neighbors of node a.
Source§

impl NodeCount for Items

Source§

impl Visitable for Items

Source§

type Map = HashSet<Id>

The associated map type
Source§

fn visit_map(&self) -> Self::Map

Create a new visitor map
Source§

fn reset_map(&self, map: &mut Self::Map)

Reset the visitor map (and resize to new size of graph if needed)

Auto Trait Implementations§

§

impl Freeze for Items

§

impl RefUnwindSafe for Items

§

impl Send for Items

§

impl Sync for Items

§

impl Unpin for Items

§

impl UnwindSafe for Items

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.