diff --git a/infer/src/IR/Procdesc.re b/infer/src/IR/Procdesc.re
index e54ad2853..66ecf2b5f 100644
--- a/infer/src/IR/Procdesc.re
+++ b/infer/src/IR/Procdesc.re
@@ -47,20 +47,20 @@ let module Node = {
/** predecessor nodes in the cfg */
mutable preds: list t,
/** name of the procedure the node belongs to */
- pname: option Procname.t,
+ pname_opt: option Procname.t,
/** successor nodes in the cfg */
mutable succs: list t
};
let exn_handler_kind = Stmt_node "exception handler";
let exn_sink_kind = Stmt_node "exceptions sink";
let throw_kind = Stmt_node "throw";
- let dummy () => {
+ let dummy pname_opt => {
id: 0,
dist_exit: None,
instrs: [],
kind: Skip_node "dummy",
loc: Location.dummy,
- pname: None,
+ pname_opt,
succs: [],
preds: [],
exn: []
@@ -120,7 +120,7 @@ let module Node = {
/** Get the name of the procedure the node belongs to */
let get_proc_name node =>
- switch node.pname {
+ switch node.pname_opt {
| None =>
L.out "get_proc_name: at node %d@\n" node.id;
assert false
@@ -308,7 +308,10 @@ let from_proc_attributes called_from_cfg::called_from_cfg attributes => {
if (not called_from_cfg) {
assert false
};
- {attributes, nodes: [], nodes_num: 0, start_node: Node.dummy (), exit_node: Node.dummy ()}
+ let pname_opt = Some attributes.ProcAttributes.proc_name;
+ let start_node = Node.dummy pname_opt;
+ let exit_node = Node.dummy pname_opt;
+ {attributes, nodes: [], nodes_num: 0, start_node, exit_node}
};
@@ -498,7 +501,7 @@ let create_node pdesc loc kind instrs => {
kind,
loc,
preds: [],
- pname: Some pdesc.attributes.proc_name,
+ pname_opt: Some pdesc.attributes.proc_name,
succs: [],
exn: []
};
diff --git a/infer/src/IR/Procdesc.rei b/infer/src/IR/Procdesc.rei
index 4d7b87c87..11c435d59 100644
--- a/infer/src/IR/Procdesc.rei
+++ b/infer/src/IR/Procdesc.rei
@@ -51,7 +51,7 @@ let module Node: {
let d_instrs: sub_instrs::bool => option Sil.instr => t => unit;
/** Create a dummy node */
- let dummy: unit => t;
+ let dummy: option Procname.t => t;
/** Check if two nodes are equal */
let equal: t => t => bool;
diff --git a/infer/src/backend/InferAnalyze.re b/infer/src/backend/InferAnalyze.re
index b6b9b3fc6..0d4dc9485 100644
--- a/infer/src/backend/InferAnalyze.re
+++ b/infer/src/backend/InferAnalyze.re
@@ -23,7 +23,8 @@ let analyze_exe_env exe_env => {
if Config.checkers {
/* run the checkers only */
let call_graph = Exe_env.get_cg exe_env;
- Callbacks.iterate_callbacks Checkers.ST.store_summary call_graph exe_env
+ Callbacks.iterate_callbacks Checkers.ST.store_summary call_graph exe_env;
+ Printer.write_all_html_files exe_env
} else {
/* run the full analysis */
Interproc.do_analysis exe_env;
diff --git a/infer/src/backend/interproc.ml b/infer/src/backend/interproc.ml
index 56424d60e..0a1c25d94 100644
--- a/infer/src/backend/interproc.ml
+++ b/infer/src/backend/interproc.ml
@@ -333,12 +333,11 @@ let reset_prop_metrics () =
exception RE_EXE_ERROR
-let do_before_node pname source session node =
- let loc = Procdesc.Node.get_loc node in
+let do_before_node source session node =
State.set_node node;
State.set_session session;
L.reset_delayed_prints ();
- Printer.node_start_session node loc pname (session :> int) source
+ Printer.node_start_session node (session :> int) source
let do_after_node source node =
Printer.node_finish_session node source
@@ -605,7 +604,7 @@ let forward_tabulate tenv pdesc wl source =
let session =
incr summary.Specs.sessions;
!(summary.Specs.sessions) in
- do_before_node pname source session curr_node;
+ do_before_node source session curr_node;
do_node_and_handle curr_node session
done;
L.d_strln ".... Work list empty. Stop ...."; L.d_ln ()
@@ -908,7 +907,7 @@ let initial_prop_from_pre tenv curr_f pre =
let execute_filter_prop wl tenv pdesc init_node (precondition : Prop.normal Specs.Jprop.t) source
: Prop.normal Specs.spec option =
let pname = Procdesc.get_proc_name pdesc in
- do_before_node pname source 0 init_node;
+ do_before_node source 0 init_node;
L.d_strln ("#### Start: RE-execution for " ^ Procname.to_string pname ^ " ####");
L.d_indent 1;
L.d_strln "Precond:"; Specs.Jprop.d_shallow precondition;
@@ -925,7 +924,7 @@ let execute_filter_prop wl tenv pdesc init_node (precondition : Prop.normal Spec
Worklist.add wl init_node;
ignore (path_set_put_todo wl init_node init_edgeset);
forward_tabulate tenv pdesc wl source;
- do_before_node pname source 0 init_node;
+ do_before_node source 0 init_node;
L.d_strln_color Green
("#### Finished: RE-execution for " ^ Procname.to_string pname ^ " ####");
L.d_increase_indent 1;
@@ -948,7 +947,7 @@ let execute_filter_prop wl tenv pdesc init_node (precondition : Prop.normal Spec
do_after_node source init_node;
Some spec
with RE_EXE_ERROR ->
- do_before_node pname source 0 init_node;
+ do_before_node source 0 init_node;
Printer.force_delayed_prints ();
L.d_strln_color Red ("#### [FUNCTION " ^ Procname.to_string pname ^ "] ...ERROR");
L.d_increase_indent 1;
@@ -1379,7 +1378,7 @@ let perform_transition exe_env tenv proc_name source =
f start_node
| None -> ()
with exn when SymOp.exn_not_failure exn -> () in
- apply_start_node (do_before_node proc_name source 0);
+ apply_start_node (do_before_node source 0);
try
Config.allow_leak := true;
let res = collect_preconditions tenv proc_name in
@@ -1521,7 +1520,7 @@ let visited_and_total_nodes ~filter cfg =
if filter_node pdesc n then
begin
set := Procdesc.NodeSet.add n !set;
- if snd (Printer.node_is_visited (Procdesc.get_proc_name pdesc) n)
+ if snd (Printer.node_is_visited n)
then set_visited_re := Procdesc.NodeSet.add n !set_visited_re
end in
Cfg.iter_all_nodes add cfg;
diff --git a/infer/src/backend/paths.ml b/infer/src/backend/paths.ml
index fc6d0d4c5..58b4dfeb7 100644
--- a/infer/src/backend/paths.ml
+++ b/infer/src/backend/paths.ml
@@ -343,7 +343,7 @@ end = struct
| None ->
() in
iter_shortest_sequence (fun _ p _ _ -> add_node (curr_node p)) None path;
- let max_rep_node = ref (Procdesc.Node.dummy ()) in
+ let max_rep_node = ref (Procdesc.Node.dummy None) in
let max_rep_num = ref 0 in
Procdesc.NodeMap.iter
(fun node num -> if num > !max_rep_num then (max_rep_node := node; max_rep_num := num))
diff --git a/infer/src/backend/preanal.ml b/infer/src/backend/preanal.ml
index 9f56d1356..9acb3754a 100644
--- a/infer/src/backend/preanal.ml
+++ b/infer/src/backend/preanal.ml
@@ -124,7 +124,7 @@ module NullifyTransferFunctions = struct
(reaching_defs', to_nullify)
| None -> astate
- let cache_node = ref (Procdesc.Node.dummy ())
+ let cache_node = ref (Procdesc.Node.dummy None)
let cache_instr = ref Sil.skip_instr
let last_instr_in_node node =
diff --git a/infer/src/backend/printer.ml b/infer/src/backend/printer.ml
index 679f795da..ec29c996f 100644
--- a/infer/src/backend/printer.ml
+++ b/infer/src/backend/printer.ml
@@ -74,8 +74,8 @@ end
let curr_html_formatter = ref F.std_formatter
(** Return true if the node was visited during footprint and during re-execution*)
-let node_is_visited proc_name node =
- match Specs.get_summary proc_name with
+let node_is_visited node =
+ match Specs.get_summary (Procdesc.Node.get_proc_name node) with
| None ->
false, false
| Some summary ->
@@ -87,8 +87,8 @@ let node_is_visited proc_name node =
is_visited_fp, is_visited_re
(** Return true if the node was visited during analysis *)
-let is_visited proc_name node =
- let visited_fp, visited_re = node_is_visited proc_name node in
+let is_visited node =
+ let visited_fp, visited_re = node_is_visited node in
visited_fp || visited_re
(* =============== START of module NodesHtml =============== *)
@@ -134,7 +134,7 @@ end = struct
~preds:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_preds node) :> int list)
~succs:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_succs node) :> int list)
~exn:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_exn node) :> int list)
- ~isvisited:(is_visited proc_name node)
+ ~isvisited:(is_visited node)
~isproof:false
fmt (Procdesc.Node.get_id node :> int)) preds;
F.fprintf fmt "
SUCCS: @\n";
@@ -146,7 +146,7 @@ end = struct
~preds:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_preds node) :> int list)
~succs:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_succs node) :> int list)
~exn:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_exn node) :> int list)
- ~isvisited:(is_visited proc_name node)
+ ~isvisited:(is_visited node)
~isproof:false
fmt (Procdesc.Node.get_id node :> int)) succs;
F.fprintf fmt "
EXN: @\n";
@@ -158,7 +158,7 @@ end = struct
~preds:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_preds node) :> int list)
~succs:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_succs node) :> int list)
~exn:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_exn node) :> int list)
- ~isvisited:(is_visited proc_name node)
+ ~isvisited:(is_visited node)
~isproof:false
fmt (Procdesc.Node.get_id node :> int)) exns;
F.fprintf fmt "
@\n";
@@ -393,9 +393,11 @@ let start_session node (loc: Location.t) proc_name session source =
F.fprintf !curr_html_formatter "