File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ open Code
33
44let debug = Debug. find " call-graph"
55
6+ let times = Debug. find " times"
7+
68let get_approx info x =
79 (* Specialization can add some variables *)
810 if Var. idx x < Var.Tbl. length info.Global_flow. info_approximation
@@ -41,6 +43,7 @@ let direct_calls_only info f =
4143 Config.Flag. optcall () && Var.Hashtbl. mem info.unambiguous_non_escaping f
4244
4345let f p info =
46+ let t = Timer. make () in
4447 let non_escaping = Var.Hashtbl. create 128 in
4548 let ambiguous = Var.Hashtbl. create 128 in
4649 fold_closures
@@ -58,4 +61,5 @@ let f p info =
5861 Var.Hashtbl. iter (fun x () -> Var.Hashtbl. remove non_escaping x) ambiguous;
5962 if debug ()
6063 then Format. eprintf " unambiguous-non-escaping:%d@." (Var.Hashtbl. length non_escaping);
64+ if times () then Format. eprintf " call graph analysis: %a@." Timer. print t;
6165 { unambiguous_non_escaping = non_escaping }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ open Global_flow
44
55let debug = Debug. find " typing"
66
7+ let times = Debug. find " times"
8+
79module Integer = struct
810 type kind =
911 | Ref
@@ -420,10 +422,12 @@ let solver st =
420422 Solver. f () g (propagate st)
421423
422424let f ~state ~info ~deadcode_sentinal p =
425+ let t = Timer. make () in
423426 update_deps state p;
424427 let function_parameters = mark_function_parameters p in
425428 let typ = solver { state; info; function_parameters } in
426429 Var.Tbl. set typ deadcode_sentinal (Int Normalized );
430+ if times () then Format. eprintf " type analysis: %a@." Timer. print t;
427431 if debug ()
428432 then (
429433 Var.ISet. iter
You can’t perform that action at this time.
0 commit comments