Skip to main content

post_dominators_with_progress

Function post_dominators_with_progress 

Source
pub fn post_dominators_with_progress<F>(
    graph: &SqliteGraph,
    exit: i64,
    progress: &F,
) -> Result<PostDominatorResult, SqliteGraphError>
Expand description

Computes post-dominators with progress tracking.

Same algorithm as post_dominators but reports progress during execution. Useful for long-running operations on large graphs.

§Arguments

  • graph - The control flow graph to analyze
  • exit - The exit node ID (must exist in graph)
  • progress - Progress callback for reporting execution status

§Returns

PostDominatorResult containing post-dominance sets and immediate post-dominator tree.

§Progress Reporting

The callback receives:

  • current: Current iteration number
  • total: None (unknown iterations until convergence)
  • message: “Post-dominator iteration {current}: {nodes_processed} nodes processed”

Progress is reported after each iteration completes.

§Example

use sqlitegraph::{
    algo::post_dominators_with_progress,
    progress::ConsoleProgress
};

let progress = ConsoleProgress::new();
let result = post_dominators_with_progress(&graph, exit, &progress)?;
// Output: Post-dominator iteration 1: 50 nodes processed...
// Output: Post-dominator iteration 2: 50 nodes processed...