hydro_lang/builder/
compiled.rs

1use std::collections::BTreeMap;
2
3use dfir_lang::graph::DfirGraph;
4
5use crate::Location;
6use crate::staging_util::Invariant;
7
8pub struct CompiledFlow<'a, ID> {
9    pub(super) dfir: BTreeMap<usize, DfirGraph>,
10    pub(super) _phantom: Invariant<'a, ID>,
11}
12
13impl<'a, ID> CompiledFlow<'a, ID> {
14    pub fn dfir_for(&self, location: &impl Location<'a>) -> &DfirGraph {
15        self.dfir.get(&location.id().raw_id()).unwrap()
16    }
17
18    pub fn all_dfir(&self) -> &BTreeMap<usize, DfirGraph> {
19        &self.dfir
20    }
21}