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
3
3
4
4
let debug = Debug. find " call-graph"
5
5
6
+ let times = Debug. find " times"
7
+
6
8
let get_approx info x =
7
9
(* Specialization can add some variables *)
8
10
if Var. idx x < Var.Tbl. length info.Global_flow. info_approximation
@@ -41,6 +43,7 @@ let direct_calls_only info f =
41
43
Config.Flag. optcall () && Var.Hashtbl. mem info.unambiguous_non_escaping f
42
44
43
45
let f p info =
46
+ let t = Timer. make () in
44
47
let non_escaping = Var.Hashtbl. create 128 in
45
48
let ambiguous = Var.Hashtbl. create 128 in
46
49
fold_closures
@@ -58,4 +61,5 @@ let f p info =
58
61
Var.Hashtbl. iter (fun x () -> Var.Hashtbl. remove non_escaping x) ambiguous;
59
62
if debug ()
60
63
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;
61
65
{ unambiguous_non_escaping = non_escaping }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ open Global_flow
4
4
5
5
let debug = Debug. find " typing"
6
6
7
+ let times = Debug. find " times"
8
+
7
9
module Integer = struct
8
10
type kind =
9
11
| Ref
@@ -420,10 +422,12 @@ let solver st =
420
422
Solver. f () g (propagate st)
421
423
422
424
let f ~state ~info ~deadcode_sentinal p =
425
+ let t = Timer. make () in
423
426
update_deps state p;
424
427
let function_parameters = mark_function_parameters p in
425
428
let typ = solver { state; info; function_parameters } in
426
429
Var.Tbl. set typ deadcode_sentinal (Int Normalized );
430
+ if times () then Format. eprintf " type analysis: %a@." Timer. print t;
427
431
if debug ()
428
432
then (
429
433
Var.ISet. iter
You can’t perform that action at this time.
0 commit comments