let export ~file ?pp_edge_fun cfg =
Kernel.Unicode.without_unicode
(fun () ->
let edge_txt = match pp_edge_fun with
| None ->
(fun e -> match (edge_type e) with
| Ecase (_::_) -> Pretty_utils.sfprintf "%a" EL.pretty (edge_type e)
| _ -> ""
)
| Some pp -> (fun e -> Pretty_utils.sfprintf "%a" pp e)
in
let module P = Printer (struct let edge_txt = edge_txt end) in
let module GPrint = Graph.Graphviz.Dot(P) in
let oc = open_out file in
GPrint.output_graph oc (cfg_graph cfg, edge_txt);
close_out oc
) ()