Skip to content

Commit 5e86a31

Browse files
committed
Prevent timings from failing when compiling the same file multiple times
Frama-c does that with ocamldep.
1 parent 6847d94 commit 5e86a31

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

utils/timings.ml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ let timings : (part, float * float option) Hashtbl.t = Hashtbl.create 20
2727
let reset () = Hashtbl.clear timings
2828

2929
let start part =
30-
begin match Hashtbl.find timings part with
31-
| exception Not_found -> ()
32-
| (_, Some _) -> ()
33-
| (_, None) -> assert false end;
30+
(* Cannot assert it is not here: a source file can be compiled
31+
multiple times on the same command line *)
32+
(* assert(not (Hashtbl.mem timings part)); *)
3433
let time = Sys.time () in
35-
Hashtbl.replace timings part (time, None)
34+
Hashtbl.add timings part (time, None)
3635

3736
let start_id part x =
3837
start part; x

0 commit comments

Comments
 (0)