Trait ConstructVisitor

Source
pub trait ConstructVisitor {
    // Required methods
    fn from(_ctx: &Context) -> CalyxResult<Self>
       where Self: Sized;
    fn clear_data(&mut self);

    // Provided method
    fn get_opts(ctx: &Context) -> LinkedHashMap<&'static str, ParseVal>
       where Self: Named { ... }
}
Expand description

Trait defining method that can be used to construct a Visitor from an ir::Context. This is useful when a pass needs to construct information using the context before visiting the components.

For passes that don’t need to use the context, this trait can be automatically be derived from Default.

Required Methods§

Source

fn from(_ctx: &Context) -> CalyxResult<Self>
where Self: Sized,

Construct the visitor using information from the Context

Source

fn clear_data(&mut self)

Clear the data stored in the visitor. Called before traversing the next component by [ir::traversal::Visitor].

Provided Methods§

Source

fn get_opts(ctx: &Context) -> LinkedHashMap<&'static str, ParseVal>
where Self: Named,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ConstructVisitor for Canonicalize

Source§

impl ConstructVisitor for CellShare

Source§

impl ConstructVisitor for CombProp

Source§

impl ConstructVisitor for CompileInvoke

Source§

impl ConstructVisitor for CompileStatic

Source§

impl ConstructVisitor for ComponentInliner

Source§

impl ConstructVisitor for DefaultAssigns

Source§

impl ConstructVisitor for Externalize

Source§

impl ConstructVisitor for GroupToInvoke

Source§

impl ConstructVisitor for InferShare

Source§

impl ConstructVisitor for Papercut

Source§

impl ConstructVisitor for ProfilerInstrumentation

Source§

impl ConstructVisitor for StaticFSMAllocation

Source§

impl ConstructVisitor for StaticFSMOpts

Source§

impl ConstructVisitor for StaticInference

Source§

impl ConstructVisitor for StaticInliner

Source§

impl ConstructVisitor for StaticPromotion

Source§

impl ConstructVisitor for StaticRepeatFSMAllocation

Source§

impl ConstructVisitor for SynthesisPapercut

Source§

impl ConstructVisitor for TopDownCompileControl

Source§

impl ConstructVisitor for UniquefyEnables

Source§

impl ConstructVisitor for WellFormed

Source§

impl ConstructVisitor for DiscoverExternal

Source§

impl ConstructVisitor for ExternalToRef

Source§

impl ConstructVisitor for FSMAnnotator

Source§

impl ConstructVisitor for FSMBuilder

Source§

impl ConstructVisitor for Metadata

Source§

impl ConstructVisitor for ParToSeq

Source§

impl ConstructVisitor for SimplifyIfComb

Source§

impl<T: Default + Sized + Visitor> ConstructVisitor for T

Derive ConstructVisitor when Default is provided for a visitor.