[summary] change `int ref` field in record to `mutable`

Summary:
It's a bit more annoying to `incr` but is more uniform with the other
`mutable` field.

Reviewed By: ngorogiannis

Differential Revision: D16359027

fbshipit-source-id: 817cd94a0
master
Jules Villard 5 years ago committed by Facebook Github Bot
parent 4fde351565
commit daf38c6d54

@ -18,8 +18,8 @@ let new_session node =
0 0
| Some summary -> | Some summary ->
Summary.Stats.add_visited summary.stats node_id ; Summary.Stats.add_visited summary.stats node_id ;
incr summary.Summary.sessions ; summary.Summary.sessions <- summary.Summary.sessions + 1 ;
!(summary.Summary.sessions) summary.Summary.sessions
let kind_to_string = function let kind_to_string = function

@ -66,7 +66,7 @@ include struct
type t = type t =
{ payloads: Payloads.t { payloads: Payloads.t
; sessions: int ref ; mutable sessions: int
; stats: Stats.t ; stats: Stats.t
; status: Status.t ; status: Status.t
; proc_desc: Procdesc.t ; proc_desc: Procdesc.t
@ -256,7 +256,7 @@ module OnDisk = struct
let reset proc_desc = let reset proc_desc =
let summary = let summary =
{ sessions= ref 0 { sessions= 0
; payloads= Payloads.empty ; payloads= Payloads.empty
; stats= Stats.empty ; stats= Stats.empty
; status= Status.Pending ; status= Status.Pending

@ -42,7 +42,7 @@ end
(** summary of a procedure name *) (** summary of a procedure name *)
type t = type t =
{ payloads: Payloads.t { payloads: Payloads.t
; sessions: int ref (** Session number: how many nodes went through symbolic execution *) ; mutable sessions: int (** Session number: how many nodes went through symbolic execution *)
; stats: Stats.t ; stats: Stats.t
; status: Status.t ; status: Status.t
; proc_desc: Procdesc.t ; proc_desc: Procdesc.t

@ -502,7 +502,10 @@ let forward_tabulate summary exe_env tenv proc_cfg wl =
let curr_node = Worklist.remove wl in let curr_node = Worklist.remove wl in
mark_visited summary curr_node ; mark_visited summary curr_node ;
(* mark nodes visited in fp and re phases *) (* mark nodes visited in fp and re phases *)
let session = incr summary.Summary.sessions ; !(summary.Summary.sessions) in let session =
summary.Summary.sessions <- summary.Summary.sessions + 1 ;
summary.Summary.sessions
in
do_before_node session curr_node ; do_before_node session curr_node ;
do_node_and_handle curr_node session do_node_and_handle curr_node session
done ; done ;

Loading…
Cancel
Save