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§
Required Methods§
Sourcefn compute_static(&mut self, extra: &Self::Info) -> Option<u64>
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§
Sourcefn update_static(&mut self, extra: &Self::Info) -> Option<u64>
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.