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