use fallow_types::discover::EntryPoint;
use fixedbitset::FixedBitSet;
use rustc_hash::FxHashSet;
use super::ModuleGraph;
impl ModuleGraph {
pub fn set_support_entry_points(&mut self, entry_points: &[EntryPoint]) {
let paths: FxHashSet<&std::path::Path> =
entry_points.iter().map(|ep| ep.path.as_path()).collect();
self.support_entry_points = self
.modules
.iter()
.filter(|module| paths.contains(module.path.as_path()))
.map(|module| module.file_id)
.collect();
}
#[must_use]
pub fn support_reachable(&self) -> FixedBitSet {
self.collect_reachable(&self.support_entry_points, self.modules.len())
}
}