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>
impl<'tracer> ExpressionTracer<'tracer>
sourcepub fn trace_expressions(&mut self)
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.