midenc_hir_analysis/dense/lattice.rs
1use crate::{AnalysisState, ChangeResult};
2
3/// A [DenseLattice] represents some program state at a specific program point.
4///
5/// It is propagated through the IR by dense data-flow analysis.
6#[allow(unused_variables)]
7pub trait DenseLattice: AnalysisState + core::fmt::Debug {
8 type Lattice;
9
10 fn lattice(&self) -> &Self::Lattice;
11 fn lattice_mut(&mut self) -> &mut Self::Lattice;
12
13 fn join(&mut self, rhs: &Self::Lattice) -> ChangeResult {
14 ChangeResult::Unchanged
15 }
16 fn meet(&mut self, rhs: &Self::Lattice) -> ChangeResult {
17 ChangeResult::Unchanged
18 }
19}