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 block_deps ~info ~non_escaping ~ambiguous ~blocks pc =
7
9
let block = Addr.Map. find pc blocks in
8
10
List. iter block.body ~f: (fun i ->
@@ -39,6 +41,7 @@ let direct_calls_only info f =
39
41
Config.Flag. optcall () && Var.Hashtbl. mem info.unambiguous_non_escaping f
40
42
41
43
let f p info =
44
+ let t = Timer. make () in
42
45
let non_escaping = Var.Hashtbl. create 128 in
43
46
let ambiguous = Var.Hashtbl. create 128 in
44
47
fold_closures
@@ -56,4 +59,5 @@ let f p info =
56
59
Var.Hashtbl. iter (fun x () -> Var.Hashtbl. remove non_escaping x) ambiguous;
57
60
if debug ()
58
61
then Format. eprintf " unambiguous-non-escaping:%d@." (Var.Hashtbl. length non_escaping);
62
+ if times () then Format. eprintf " call graph analysis: %a@." Timer. print t;
59
63
{ 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