fallow_graph/graph/
support_reach.rs1use fallow_types::discover::EntryPoint;
6use fixedbitset::FixedBitSet;
7use rustc_hash::FxHashSet;
8
9use super::ModuleGraph;
10
11impl ModuleGraph {
12 pub fn set_support_entry_points(&mut self, entry_points: &[EntryPoint]) {
15 let paths: FxHashSet<&std::path::Path> =
16 entry_points.iter().map(|ep| ep.path.as_path()).collect();
17 self.support_entry_points = self
18 .modules
19 .iter()
20 .filter(|module| paths.contains(module.path.as_path()))
21 .map(|module| module.file_id)
22 .collect();
23 }
24
25 #[must_use]
28 pub fn support_reachable(&self) -> FixedBitSet {
29 self.collect_reachable(&self.support_entry_points, self.modules.len())
30 }
31}