pub struct Planner { /* private fields */ }Expand description
The planning pass: collects a PcodePlan from statements fed one at a
time.
This is plan_instruction with the statement loop handed to the
producer, so the plan can be built from the same on-the-fly resolution the
Emitter then lowers. Local widths are either supplied up front, when
the producer resolved them from its source bodies, or inferred first with a
SizeInference over the same statements.
Implementations§
Source§impl Planner
impl Planner
Sourcepub fn statement<E: ExprNode>(&mut self, statement: StmtKind<'_, E>)
pub fn statement<E: ExprNode>(&mut self, statement: StmtKind<'_, E>)
Records the facts of the next statement that do not depend on local widths: the labels, and the addresses this instruction reaches directly.
Sourcepub fn opaque_statement(&mut self)
pub fn opaque_statement(&mut self)
Records a statement whose shape the planner cannot see.
It contributes no labels or targets, but it is not a label, so it ends the run of terminal labels.
Sourcepub fn finish(self, local_sizes: LocalSizes) -> PcodePlan
pub fn finish(self, local_sizes: LocalSizes) -> PcodePlan
The finished plan, with local_sizes as the widths of the
instruction’s locals.
The caller guarantees local_sizes covers every local the instruction
uses; a missing width is an UnknownSize error at emission. The widths
come last because a producer that resolves them from its source bodies
only knows them all once it has walked every statement.