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§
Sourcefn from(_ctx: &Context) -> CalyxResult<Self>where
Self: Sized,
fn from(_ctx: &Context) -> CalyxResult<Self>where
Self: Sized,
Construct the visitor using information from the Context
Sourcefn clear_data(&mut self)
fn clear_data(&mut self)
Clear the data stored in the visitor. Called before traversing the next component by [ir::traversal::Visitor].
Provided Methods§
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§
impl ConstructVisitor for Canonicalize
impl ConstructVisitor for CombProp
impl ConstructVisitor for CompileInvoke
impl ConstructVisitor for CompileStatic
impl ConstructVisitor for ComponentInliner
impl ConstructVisitor for DefaultAssigns
impl ConstructVisitor for Externalize
impl ConstructVisitor for GroupToInvoke
impl ConstructVisitor for Papercut
impl ConstructVisitor for ProfilerInstrumentation
impl ConstructVisitor for StaticFSMOpts
impl ConstructVisitor for StaticInference
impl ConstructVisitor for StaticInliner
impl ConstructVisitor for StaticPromotion
impl ConstructVisitor for SynthesisPapercut
impl ConstructVisitor for TopDownCompileControl
impl ConstructVisitor for WellFormed
impl ConstructVisitor for DiscoverExternal
impl ConstructVisitor for ExternalToRef
impl ConstructVisitor for ParToSeq
impl<T: Default + Sized + Visitor> ConstructVisitor for T
Derive ConstructVisitor when Default is provided for a visitor.