From daf38c6d54a090f1475dd5bebd6bf6115d7ea902 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Mon, 22 Jul 2019 09:01:40 -0700 Subject: [PATCH] [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 --- infer/src/absint/NodePrinter.ml | 4 ++-- infer/src/backend/Summary.ml | 4 ++-- infer/src/backend/Summary.mli | 2 +- infer/src/biabduction/interproc.ml | 5 ++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/infer/src/absint/NodePrinter.ml b/infer/src/absint/NodePrinter.ml index 3855ae962..89d6dff66 100644 --- a/infer/src/absint/NodePrinter.ml +++ b/infer/src/absint/NodePrinter.ml @@ -18,8 +18,8 @@ let new_session node = 0 | Some summary -> Summary.Stats.add_visited summary.stats node_id ; - incr summary.Summary.sessions ; - !(summary.Summary.sessions) + summary.Summary.sessions <- summary.Summary.sessions + 1 ; + summary.Summary.sessions let kind_to_string = function diff --git a/infer/src/backend/Summary.ml b/infer/src/backend/Summary.ml index bed8b68a9..f1470679d 100644 --- a/infer/src/backend/Summary.ml +++ b/infer/src/backend/Summary.ml @@ -66,7 +66,7 @@ include struct type t = { payloads: Payloads.t - ; sessions: int ref + ; mutable sessions: int ; stats: Stats.t ; status: Status.t ; proc_desc: Procdesc.t @@ -256,7 +256,7 @@ module OnDisk = struct let reset proc_desc = let summary = - { sessions= ref 0 + { sessions= 0 ; payloads= Payloads.empty ; stats= Stats.empty ; status= Status.Pending diff --git a/infer/src/backend/Summary.mli b/infer/src/backend/Summary.mli index e33e3c3b0..64407a521 100644 --- a/infer/src/backend/Summary.mli +++ b/infer/src/backend/Summary.mli @@ -42,7 +42,7 @@ end (** summary of a procedure name *) type 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 ; status: Status.t ; proc_desc: Procdesc.t diff --git a/infer/src/biabduction/interproc.ml b/infer/src/biabduction/interproc.ml index 5b6e8df96..b476909ce 100644 --- a/infer/src/biabduction/interproc.ml +++ b/infer/src/biabduction/interproc.ml @@ -502,7 +502,10 @@ let forward_tabulate summary exe_env tenv proc_cfg wl = let curr_node = Worklist.remove wl in mark_visited summary curr_node ; (* 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_node_and_handle curr_node session done ;