let build_dot filename kf =
let stmts = match kf.Db_types.fundec with
| Db_types.Definition (fct, _) -> fct.sallstmts
| Db_types.Declaration _ ->
Kernel.abort "cannot compute for a function without body"
in
let graph = Kinstr.Hashtbl.create (List.length stmts) in
let _ = build_reduced_graph kf graph stmts in
let name = Kernel_function.get_name kf in
let title = "Postdominators for function " ^ name in
let file = open_out filename in
PostdomGraph.output_graph file (title, graph);
close_out file