use super::{CsrGraph, FixedPointBatch};
impl<'a, F> FixedPointBatch<'a, F>
where
F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>, &mut Vec<Vec<u8>>) -> Result<(), String>,
{
pub fn points_to_subset(
&mut self,
graph: CsrGraph<'_>,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::points_to::subset_closure_borrowed_into_with_scratch_via(
self.dispatch,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn points_to_subset_into(
&mut self,
graph: CsrGraph<'_>,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::points_to::subset_closure_borrowed_into_result_with_scratch_via(
self.dispatch,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
pub fn prepare_points_to_subset(
&self,
graph: CsrGraph<'_>,
) -> Result<crate::fixed_point_graph::FixedPointForwardGraph, String> {
crate::points_to::prepare_points_to_subset_graph(
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn prepare_points_to_subset_into(
&self,
graph: CsrGraph<'_>,
prepared: &mut crate::fixed_point_graph::FixedPointForwardGraph,
) -> Result<(), String> {
crate::points_to::prepare_points_to_subset_graph_into(
prepared,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn prepare_points_to_subset_plan(
&self,
graph: CsrGraph<'_>,
) -> Result<crate::fixed_point_graph::FixedPointAnalysisPlan, String> {
crate::points_to::prepare_points_to_subset_plan(
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn prepare_points_to_subset_plan_into(
&self,
graph: CsrGraph<'_>,
plan: &mut crate::fixed_point_graph::FixedPointAnalysisPlan,
) -> Result<(), String> {
crate::points_to::prepare_points_to_subset_plan_into(
plan,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn points_to_subset_prepared(
&mut self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::points_to::subset_closure_prepared_borrowed_into_with_scratch_via(
self.dispatch,
graph,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn points_to_subset_prepared_into(
&mut self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::points_to::subset_closure_prepared_borrowed_into_result_with_scratch_via(
self.dispatch,
graph,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
pub fn points_to_subset_plan(
&mut self,
plan: &crate::fixed_point_graph::FixedPointAnalysisPlan,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::points_to::subset_closure_plan_borrowed_into_with_scratch_via(
self.dispatch,
plan,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn points_to_subset_plan_into(
&mut self,
plan: &crate::fixed_point_graph::FixedPointAnalysisPlan,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::points_to::subset_closure_plan_borrowed_into_result_with_scratch_via(
self.dispatch,
plan,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
}