pub trait WithStaticwhere
    Self: GetAttributes,{
    type Info;

    // Required method
    fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>;

    // Provided method
    fn update_static(&mut self, extra: &Self::Info) -> Option<u64> { ... }
}
Expand description

Trait to propagate and extra “static” attributes through ir::Control. Calling the update function ensures that the current program, as well as all sub-programs have a “static” attribute on them. Usage:

use calyx::analysis::compute_static::WithStatic;
let con: ir::Control = todo!(); // A complex control program
con.update(&HashMap::new());    // Compute the static information for the program

Required Associated Types§

source

type Info

Extra information needed to compute static information for this type.

Required Methods§

source

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Compute the static information for the type if possible and update all sub-programs.

Provided Methods§

source

fn update_static(&mut self, extra: &Self::Info) -> Option<u64>

Compute the static information for the type if possible and add it to its attribute. Implementors should instead implement WithStatic::compute_static and call this function on sub-programs. Ensures: All sub-programs of the type will also be updated.

Implementations on Foreign Types§

source§

impl WithStatic for Control

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for Invoke

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for While

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for If

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for Repeat

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for Seq

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for Enable

§

type Info = ()

source§

fn compute_static(&mut self, _: &Self::Info) -> Option<u64>

source§

impl WithStatic for Par

§

type Info = HashMap<Id, u64, RandomState>

source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

source§

impl WithStatic for StaticEnable

§

type Info = ()

source§

fn compute_static(&mut self, _: &Self::Info) -> Option<u64>

Implementors§