Struct naga::compact::expressions::ExpressionTracer

source ·
pub struct ExpressionTracer<'tracer> {
    pub constants: &'tracer Arena<Constant>,
    pub expressions: &'tracer Arena<Expression>,
    pub types_used: &'tracer mut HandleSet<Type>,
    pub constants_used: &'tracer mut HandleSet<Constant>,
    pub expressions_used: &'tracer mut HandleSet<Expression>,
    pub global_expressions_used: Option<&'tracer mut HandleSet<Expression>>,
}

Fields§

§constants: &'tracer Arena<Constant>§expressions: &'tracer Arena<Expression>

The arena in which we are currently tracing expressions.

§types_used: &'tracer mut HandleSet<Type>

The used map for types.

§constants_used: &'tracer mut HandleSet<Constant>

The used map for constants.

§expressions_used: &'tracer mut HandleSet<Expression>

The used set for arena.

This points to whatever arena holds the expressions we are currently tracing: either a function’s expression arena, or the module’s constant expression arena.

§global_expressions_used: Option<&'tracer mut HandleSet<Expression>>

The used set for the module’s global_expressions arena.

If None, we are already tracing the constant expressions, and expressions_used already refers to their handle set.

Implementations§

source§

impl<'tracer> ExpressionTracer<'tracer>

source

pub fn trace_expressions(&mut self)

Propagate usage through self.expressions, starting with self.expressions_used.

Treat self.expressions_used as the initial set of “known live” expressions, and follow through to identify all transitively used expressions.

Mark types, constants, and constant expressions used directly by self.expressions as used. Items used indirectly are not marked.

Auto Trait Implementations§

§

impl<'tracer> Freeze for ExpressionTracer<'tracer>

§

impl<'tracer> RefUnwindSafe for ExpressionTracer<'tracer>

§

impl<'tracer> Send for ExpressionTracer<'tracer>

§

impl<'tracer> Sync for ExpressionTracer<'tracer>

§

impl<'tracer> Unpin for ExpressionTracer<'tracer>

§

impl<'tracer> !UnwindSafe for ExpressionTracer<'tracer>

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>,

§

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>,

§

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.