diff --git a/infer/src/IR/Annot.re b/infer/src/IR/Annot.re
index c067437ff..03e51344d 100644
--- a/infer/src/IR/Annot.re
+++ b/infer/src/IR/Annot.re
@@ -83,5 +83,5 @@ let module Method = {
let empty = ([], []);
/** Check if the method annodation is empty. */
- let is_empty (ia, ial) => IList.for_all Item.is_empty [ia, ...ial];
+ let is_empty (ia, ial) => List.for_all f::Item.is_empty [ia, ...ial];
};
diff --git a/infer/src/IR/Cfg.re b/infer/src/IR/Cfg.re
index cf30feec2..cabdafb6e 100644
--- a/infer/src/IR/Cfg.re
+++ b/infer/src/IR/Cfg.re
@@ -44,7 +44,7 @@ let create_proc_desc cfg (proc_attributes: ProcAttributes.t) => {
/** Iterate over all the nodes in the cfg */
let iter_all_nodes sorted::sorted=false f cfg => {
let do_proc_desc _ (pdesc: Procdesc.t) =>
- IList.iter (fun node => f pdesc node) (Procdesc.get_nodes pdesc);
+ List.iter f::(fun node => f pdesc node) (Procdesc.get_nodes pdesc);
if (not sorted) {
iter_proc_desc cfg do_proc_desc
} else {
@@ -59,7 +59,7 @@ let iter_all_nodes sorted::sorted=false f cfg => {
cfg.proc_desc_table
[] |>
IList.sort [%compare : (Procdesc.t, Procdesc.Node.t)] |>
- IList.iter (fun (d, n) => f d n)
+ List.iter f::(fun (d, n) => f d n)
}
};
@@ -115,7 +115,7 @@ let check_cfg_connectedness cfg => {
}
};
let pdescs = get_all_procs cfg;
- IList.iter do_pdesc pdescs
+ List.iter f::do_pdesc pdescs
};
@@ -144,7 +144,7 @@ let save_attributes source_file cfg => {
};
AttributesTable.store_attributes attributes'
};
- IList.iter save_proc (get_all_procs cfg)
+ List.iter f::save_proc (get_all_procs cfg)
};
@@ -295,7 +295,7 @@ let mark_unchanged_pdescs cfg_new cfg_old => {
equal::Procdesc.Node.equal (Procdesc.Node.get_preds n1) (Procdesc.Node.get_preds n2) &&
instrs_eq (Procdesc.Node.get_instrs n1) (Procdesc.Node.get_instrs n2)
};
- try (IList.for_all2 node_eq n1s n2s) {
+ try (List.for_all2_exn f::node_eq n1s n2s) {
| Invalid_argument _ => false
}
};
diff --git a/infer/src/IR/Cg.re b/infer/src/IR/Cg.re
index 603721db4..a1c8759db 100644
--- a/infer/src/IR/Cg.re
+++ b/infer/src/IR/Cg.re
@@ -190,7 +190,7 @@ let node_map_iter f g => {
let table = ref [];
Procname.Hash.iter (fun node info => table := [(node, info), ...!table]) g.node_map;
let cmp (n1: Procname.t, _) (n2: Procname.t, _) => Procname.compare n1 n2;
- IList.iter (fun (n, info) => f n info) (IList.sort cmp !table)
+ List.iter f::(fun (n, info) => f n info) (IList.sort cmp !table)
};
let get_nodes (g: t) => {
@@ -344,8 +344,8 @@ let get_source (g: t) => g.source;
undefined nodes become defined if at least one side is. */
let extend cg_old cg_new => {
let (nodes, edges) = get_nodes_and_edges cg_new;
- IList.iter (fun (node, defined) => add_node cg_old node defined::defined) nodes;
- IList.iter (fun (nfrom, nto) => add_edge cg_old nfrom nto) edges
+ List.iter f::(fun (node, defined) => add_node cg_old node defined::defined) nodes;
+ List.iter f::(fun (nfrom, nto) => add_edge cg_old nfrom nto) edges
};
@@ -359,15 +359,15 @@ let load_from_file (filename: DB.filename) :option t =>
| None => None
| Some (source, (nodes, edges)) =>
let g = create (Some source);
- IList.iter
- (
+ List.iter
+ f::(
fun (node, defined) =>
if defined {
add_defined_node g node
}
)
nodes;
- IList.iter (fun (nfrom, nto) => add_edge g nfrom nto) edges;
+ List.iter f::(fun (nfrom, nto) => add_edge g nfrom nto) edges;
Some g
};
@@ -406,8 +406,8 @@ let pp_graph_dotty get_specs (g: t) fmt => {
calls.out_calls
(num_specs n);
F.fprintf fmt "digraph {@\n";
- IList.iter
- (
+ List.iter
+ f::(
fun nc =>
F.fprintf
fmt
@@ -420,7 +420,7 @@ let pp_graph_dotty get_specs (g: t) fmt => {
(get_shape nc)
)
nodes_with_calls;
- IList.iter (fun (s, d) => F.fprintf fmt "%a -> %a@\n" pp_node s pp_node d) (get_edges g);
+ List.iter f::(fun (s, d) => F.fprintf fmt "%a -> %a@\n" pp_node s pp_node d) (get_edges g);
F.fprintf fmt "}@."
};
diff --git a/infer/src/IR/Errlog.ml b/infer/src/IR/Errlog.ml
index 3b079f648..dceb34d33 100644
--- a/infer/src/IR/Errlog.ml
+++ b/infer/src/IR/Errlog.ml
@@ -287,7 +287,7 @@ module Err_table = struct
ErrLogHash.iter f err_table;
let pp ekind (nodeidkey, _, loc, ml_loc_opt, _, _, _) fmt err_names =
- IList.iter (fun (err_name, desc) ->
+ List.iter ~f:(fun (err_name, desc) ->
Exceptions.pp_err nodeidkey loc ekind err_name desc ml_loc_opt fmt ()) err_names in
F.fprintf fmt "@.Detailed errors during footprint phase:@.";
LocMap.iter (fun nslm err_names ->
diff --git a/infer/src/IR/Ident.re b/infer/src/IR/Ident.re
index 451924afb..f78b5c704 100644
--- a/infer/src/IR/Ident.re
+++ b/infer/src/IR/Ident.re
@@ -323,7 +323,7 @@ let make_unprimed id =>
/** Update the name generator so that the given id's are not generated again */
let update_name_generator ids => {
let upd id => ignore (create_with_stamp id.kind id.name id.stamp);
- IList.iter upd ids
+ List.iter f::upd ids
};
diff --git a/infer/src/IR/Io_infer.ml b/infer/src/IR/Io_infer.ml
index 024a03e09..140087230 100644
--- a/infer/src/IR/Io_infer.ml
+++ b/infer/src/IR/Io_infer.ml
@@ -333,7 +333,7 @@ struct
| String s ->
F.fprintf fmt "%s%s%s" indent s newline
and pp_forest newline indent fmt forest =
- IList.iter (pp_node newline indent fmt) forest
+ List.iter ~f:(pp_node newline indent fmt) forest
let pp_prelude fmt = pp fmt "%s" "\n"
diff --git a/infer/src/IR/Localise.ml b/infer/src/IR/Localise.ml
index f1cf14871..aa9bbcd9c 100644
--- a/infer/src/IR/Localise.ml
+++ b/infer/src/IR/Localise.ml
@@ -783,7 +783,7 @@ let desc_retain_cycle cycle loc cycle_dotty =
str_cycle := !str_cycle ^ step;
ct:=!ct +1
| _ -> () in
- IList.iter do_edge cycle;
+ List.iter ~f:do_edge cycle;
let desc = Format.sprintf "Retain cycle involving the following objects: %s %s"
!str_cycle (at_line tags loc) in
{ no_desc with descriptions = [desc]; tags = !tags; dotty = cycle_dotty }
diff --git a/infer/src/IR/Procdesc.re b/infer/src/IR/Procdesc.re
index 1d9ce2efd..0ecc30d3e 100644
--- a/infer/src/IR/Procdesc.re
+++ b/infer/src/IR/Procdesc.re
@@ -324,7 +324,7 @@ let compute_distance_to_exit_node pdesc => {
node.dist_exit = Some dist;
next_nodes := node.preds @ !next_nodes
};
- IList.iter do_node nodes;
+ List.iter f::do_node nodes;
if (!next_nodes != []) {
mark_distance (dist + 1) !next_nodes
}
@@ -395,7 +395,7 @@ let is_body_empty pdesc => List.is_empty (Node.get_succs (get_start_node pdesc))
let is_java_synchronized pdesc => pdesc.attributes.is_java_synchronized_method;
-let iter_nodes f pdesc => IList.iter f (IList.rev (get_nodes pdesc));
+let iter_nodes f pdesc => List.iter f::f (IList.rev (get_nodes pdesc));
let fold_calls f acc pdesc => {
let do_node a node =>
@@ -411,7 +411,7 @@ let fold_calls f acc pdesc => {
let iter_calls f pdesc => fold_calls (fun _ call => f call) () pdesc;
let iter_instrs f pdesc => {
- let do_node node => IList.iter (fun i => f node i) (Node.get_instrs node);
+ let do_node node => List.iter f::(fun i => f node i) (Node.get_instrs node);
iter_nodes do_node pdesc
};
@@ -440,7 +440,7 @@ let iter_slope f pdesc => {
};
let iter_slope_calls f pdesc => {
- let do_node node => IList.iter (fun callee_pname => f callee_pname) (Node.get_callees node);
+ let do_node node => List.iter f::(fun callee_pname => f callee_pname) (Node.get_callees node);
iter_slope do_node pdesc
};
@@ -485,7 +485,7 @@ let append_locals pdesc new_locals =>
let set_succs_exn_base (node: Node.t) succs exn => {
node.succs = succs;
node.exn = exn;
- IList.iter (fun (n: Node.t) => n.preds = [node, ...n.preds]) succs
+ List.iter f::(fun (n: Node.t) => n.preds = [node, ...n.preds]) succs
};
diff --git a/infer/src/IR/Pvar.re b/infer/src/IR/Pvar.re
index c96334b85..269e90ada 100644
--- a/infer/src/IR/Pvar.re
+++ b/infer/src/IR/Pvar.re
@@ -157,8 +157,8 @@ let pp_list pe f pvl => F.fprintf f "%a" (Pp.seq (fun f e => F.fprintf f "%a" (p
/** Dump a list of program variables. */
let d_list pvl =>
- IList.iter
- (
+ List.iter
+ f::(
fun pv => {
d pv;
L.d_str " "
diff --git a/infer/src/IR/Sil.re b/infer/src/IR/Sil.re
index c61fa4259..219adc751 100644
--- a/infer/src/IR/Sil.re
+++ b/infer/src/IR/Sil.re
@@ -660,19 +660,19 @@ let module Predicates: {
let rec process_sexp env =>
fun
| Eexp _ => ()
- | Earray _ esel _ => IList.iter (fun (_, se) => process_sexp env se) esel
- | Estruct fsel _ => IList.iter (fun (_, se) => process_sexp env se) fsel;
+ | Earray _ esel _ => List.iter f::(fun (_, se) => process_sexp env se) esel
+ | Estruct fsel _ => List.iter f::(fun (_, se) => process_sexp env se) fsel;
/** Process one hpred, updating env */
let rec process_hpred env =>
fun
| Hpointsto _ se _ => process_sexp env se
| Hlseg _ hpara _ _ _ => {
- IList.iter (process_hpred env) hpara.body;
+ List.iter f::(process_hpred env) hpara.body;
process_hpara env hpara
}
| Hdllseg _ hpara_dll _ _ _ _ _ => {
- IList.iter (process_hpred env) hpara_dll.body_dll;
+ List.iter f::(process_hpred env) hpara_dll.body_dll;
process_hpara_dll env hpara_dll
};
@@ -1324,7 +1324,7 @@ let fav_is_empty fav =>
/** Check whether a predicate holds for all elements. */
-let fav_for_all fav predicate => IList.for_all predicate !fav;
+let fav_for_all fav predicate => List.for_all f::predicate !fav;
/** Check whether a predicate holds for some elements. */
@@ -1344,7 +1344,7 @@ let (++) fav id =>
/** extend [fav] with ident list [idl] */
-let (+++) fav idl => IList.iter (fun id => fav ++ id) idl;
+let (+++) fav idl => List.iter f::(fun id => fav ++ id) idl;
/** add identity lists to fav */
@@ -1354,7 +1354,7 @@ let ident_list_fav_add idl fav => fav +++ idl;
/** Convert a list to a fav. */
let fav_from_list l => {
let fav = fav_new ();
- let _ = IList.iter (fun id => fav ++ id) l;
+ let _ = List.iter f::(fun id => fav ++ id) l;
fav
};
@@ -1426,7 +1426,7 @@ let rec exp_fav_add fav e =>
switch (e: Exp.t) {
| Var id => fav ++ id
| Exn e => exp_fav_add fav e
- | Closure {captured_vars} => IList.iter (fun (e, _, _) => exp_fav_add fav e) captured_vars
+ | Closure {captured_vars} => List.iter f::(fun (e, _, _) => exp_fav_add fav e) captured_vars
| Const (Cint _ | Cfun _ | Cstr _ | Cfloat _ | Cclass _ | Cptr_to_fld _) => ()
| Cast _ e
| UnOp _ e _ => exp_fav_add fav e
@@ -1462,7 +1462,7 @@ let atom_fav_add fav =>
exp_fav_add fav e2
}
| Apred _ es
- | Anpred _ es => IList.iter (fun e => exp_fav_add fav e) es;
+ | Anpred _ es => List.iter f::(fun e => exp_fav_add fav e) es;
let atom_fav = fav_imperative_to_functional atom_fav_add;
@@ -1473,11 +1473,11 @@ let atom_av_add = atom_fav_add;
let rec strexp_fav_add fav =>
fun
| Eexp e _ => exp_fav_add fav e
- | Estruct fld_se_list _ => IList.iter (fun (_, se) => strexp_fav_add fav se) fld_se_list
+ | Estruct fld_se_list _ => List.iter f::(fun (_, se) => strexp_fav_add fav se) fld_se_list
| Earray len idx_se_list _ => {
exp_fav_add fav len;
- IList.iter
- (
+ List.iter
+ f::(
fun (e, se) => {
exp_fav_add fav e;
strexp_fav_add fav se
@@ -1496,14 +1496,14 @@ let hpred_fav_add fav =>
| Hlseg _ _ e1 e2 elist => {
exp_fav_add fav e1;
exp_fav_add fav e2;
- IList.iter (exp_fav_add fav) elist
+ List.iter f::(exp_fav_add fav) elist
}
| Hdllseg _ _ e1 e2 e3 e4 elist => {
exp_fav_add fav e1;
exp_fav_add fav e2;
exp_fav_add fav e3;
exp_fav_add fav e4;
- IList.iter (exp_fav_add fav) elist
+ List.iter f::(exp_fav_add fav) elist
};
let hpred_fav = fav_imperative_to_functional hpred_fav_add;
@@ -1539,14 +1539,14 @@ let exp_av_add = exp_fav_add; /** Expressions do not bind variables */
let strexp_av_add = strexp_fav_add; /** Structured expressions do not bind variables */
let rec hpara_av_add fav para => {
- IList.iter (hpred_av_add fav) para.body;
+ List.iter f::(hpred_av_add fav) para.body;
fav ++ para.root;
fav ++ para.next;
fav +++ para.svars;
fav +++ para.evars
}
and hpara_dll_av_add fav para => {
- IList.iter (hpred_av_add fav) para.body_dll;
+ List.iter f::(hpred_av_add fav) para.body_dll;
fav ++ para.cell;
fav ++ para.blink;
fav ++ para.flink;
@@ -1564,7 +1564,7 @@ and hpred_av_add fav =>
hpara_av_add fav para;
exp_av_add fav e1;
exp_av_add fav e2;
- IList.iter (exp_av_add fav) elist
+ List.iter f::(exp_av_add fav) elist
}
| Hdllseg _ para e1 e2 e3 e4 elist => {
hpara_dll_av_add fav para;
@@ -1572,11 +1572,11 @@ and hpred_av_add fav =>
exp_av_add fav e2;
exp_av_add fav e3;
exp_av_add fav e4;
- IList.iter (exp_av_add fav) elist
+ List.iter f::(exp_av_add fav) elist
};
let hpara_shallow_av_add fav para => {
- IList.iter (hpred_fav_add fav) para.body;
+ List.iter f::(hpred_fav_add fav) para.body;
fav ++ para.root;
fav ++ para.next;
fav +++ para.svars;
@@ -1584,7 +1584,7 @@ let hpara_shallow_av_add fav para => {
};
let hpara_dll_shallow_av_add fav para => {
- IList.iter (hpred_fav_add fav) para.body_dll;
+ List.iter f::(hpred_fav_add fav) para.body_dll;
fav ++ para.cell;
fav ++ para.blink;
fav ++ para.flink;
@@ -1787,8 +1787,8 @@ let extend_sub sub id exp :option subst => {
/** Free auxilary variables in the domain and range of the
substitution. */
let sub_fav_add fav (sub: subst) =>
- IList.iter
- (
+ List.iter
+ f::(
fun (id, e) => {
fav ++ id;
exp_fav_add fav e
diff --git a/infer/src/backend/Attribute.ml b/infer/src/backend/Attribute.ml
index 9a441e176..48993224c 100644
--- a/infer/src/backend/Attribute.ml
+++ b/infer/src/backend/Attribute.ml
@@ -64,7 +64,7 @@ let add_or_replace tenv prop atom =
let get_all (prop: 'a Prop.t) =
let res = ref [] in
let do_atom a = if is_pred a then res := a :: !res in
- IList.iter do_atom prop.pi;
+ List.iter ~f:do_atom prop.pi;
IList.rev !res
(** Get all the attributes of the prop *)
@@ -289,7 +289,7 @@ let deallocate_stack_vars tenv (p: 'a Prop.t) pvars =
let pred = Sil.Apred (Adangling DAaddr_stack_var, [Exp.Var freshv]) in
res := add_or_replace tenv !res pred
end in
- IList.iter do_var !fresh_address_vars;
+ List.iter ~f:do_var !fresh_address_vars;
!res in
!stack_vars_address_in_post, List.fold ~f:(Prop.prop_atom_and tenv) ~init:p'' pi
diff --git a/infer/src/backend/BuiltinDefn.ml b/infer/src/backend/BuiltinDefn.ml
index 076c8f9d8..126f4c03d 100644
--- a/infer/src/backend/BuiltinDefn.ml
+++ b/infer/src/backend/BuiltinDefn.ml
@@ -134,7 +134,7 @@ let execute___print_value { Builtin.tenv; pdesc; prop_; path; args; }
let do_arg (lexp, _) =
let n_lexp, _ = check_arith_norm_exp tenv pname lexp prop_ in
L.err "%a " Exp.pp n_lexp in
- IList.iter do_arg args;
+ List.iter ~f:do_arg args;
L.err "@.";
[(prop_, path)]
diff --git a/infer/src/backend/InferAnalyze.re b/infer/src/backend/InferAnalyze.re
index d3c400163..1919b439d 100644
--- a/infer/src/backend/InferAnalyze.re
+++ b/infer/src/backend/InferAnalyze.re
@@ -115,7 +115,7 @@ let main makefile => {
if (makefile != "") {
ClusterMakefile.create_cluster_makefile clusters makefile
} else {
- IList.iteri (fun i cluster => analyze_cluster i cluster) clusters;
+ List.iteri f::(fun i cluster => analyze_cluster i cluster) clusters;
L.stdout "@\nAnalysis finished in %as@." Pp.elapsed_time ()
};
output_json_makefile_stats clusters
diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re
index dfe71a104..32d23bff2 100644
--- a/infer/src/backend/InferPrint.re
+++ b/infer/src/backend/InferPrint.re
@@ -156,10 +156,10 @@ let summary_values summary => {
let (nr_nodes_visited, lines_visited) = {
let visited = ref Specs.Visitedset.empty;
let do_spec spec => visited := Specs.Visitedset.union spec.Specs.visited !visited;
- IList.iter do_spec specs;
+ List.iter f::do_spec specs;
let visited_lines = ref Int.Set.empty;
Specs.Visitedset.iter
- (fun (_, ls) => IList.iter (fun l => visited_lines := Int.Set.add !visited_lines l) ls)
+ (fun (_, ls) => List.iter f::(fun l => visited_lines := Int.Set.add !visited_lines l) ls)
!visited;
(Specs.Visitedset.cardinal !visited, Int.Set.elements !visited_lines)
};
@@ -552,7 +552,7 @@ let pp_tests_of_report fmt report => {
jsonbug.bug_type
pp_trace
jsonbug.bug_trace;
- IList.iter pp_row report
+ List.iter f::pp_row report
};
let tests_jsonbug_compare bug1 bug2 =>
@@ -592,7 +592,7 @@ let pp_text_of_report fmt report => {
jsonbug.bug_type
jsonbug.qualifier
);
- IList.iter pp_row report
+ List.iter f::pp_row report
};
let module IssuesXml = {
@@ -770,7 +770,7 @@ let module Stats = {
};
res := [line, "", ...!res]
};
- IList.iter loc_to_string ltr;
+ List.iter f::loc_to_string ltr;
IList.rev !res
};
let process_err_log error_filter linereader err_log stats => {
@@ -844,7 +844,7 @@ let module Stats = {
F.fprintf fmt "Infos: %d@\n" stats.ninfos;
F.fprintf fmt "@\n -------------------@\n";
F.fprintf fmt "@\nDetailed Errors@\n@\n";
- IList.iter (fun s => F.fprintf fmt "%s@\n" s) (IList.rev stats.saved_errors)
+ List.iter f::(fun s => F.fprintf fmt "%s@\n" s) (IList.rev stats.saved_errors)
};
};
@@ -1041,7 +1041,7 @@ let pp_summary_in_format (format_kind, outf: Utils.outfile) =>
let pp_issues_of_error_log error_filter linereader proc_loc_opt procname err_log bug_format_list => {
let pp_issues_in_format format =>
pp_issues_in_format format error_filter linereader proc_loc_opt procname err_log;
- IList.iter pp_issues_in_format bug_format_list
+ List.iter f::pp_issues_in_format bug_format_list
};
let pp_issues error_filter linereader summary bug_format_list => {
@@ -1056,7 +1056,7 @@ let pp_procs summary procs_format_list => {
let pp_procs = pp_procs_in_format format;
pp_procs summary
};
- IList.iter pp_procs_in_format procs_format_list
+ List.iter f::pp_procs_in_format procs_format_list
};
let pp_calls summary calls_format_list => {
@@ -1064,7 +1064,7 @@ let pp_calls summary calls_format_list => {
let pp_calls = pp_calls_in_format format;
pp_calls summary
};
- IList.iter pp_calls_in_format calls_format_list
+ List.iter f::pp_calls_in_format calls_format_list
};
let pp_stats error_filter linereader summary stats stats_format_list => {
@@ -1072,7 +1072,7 @@ let pp_stats error_filter linereader summary stats stats_format_list => {
let pp_stats = pp_stats_in_format format;
pp_stats error_filter summary linereader stats
};
- IList.iter pp_stats_in_format stats_format_list
+ List.iter f::pp_stats_in_format stats_format_list
};
let pp_summary summary fname summary_format_list => {
@@ -1080,7 +1080,7 @@ let pp_summary summary fname summary_format_list => {
let pp_summary = pp_summary_in_format format;
pp_summary summary
};
- IList.iter pp_summary_in_format summary_format_list;
+ List.iter f::pp_summary_in_format summary_format_list;
Summary.pp_summary_out summary;
Summary.pp_summary_xml summary fname;
Summary.print_summary_dot_svg summary fname
@@ -1103,7 +1103,7 @@ let pp_summary_by_report_kind
| (Summary, _) => pp_summary summary fname format_list
| _ => ()
};
- IList.iter pp_summary_by_report_kind formats_by_report_kind
+ List.iter f::pp_summary_by_report_kind formats_by_report_kind
};
let pp_json_report_by_report_kind formats_by_report_kind fname =>
@@ -1119,7 +1119,7 @@ let pp_json_report_by_report_kind formats_by_report_kind fname =>
| Xml => failwith "Printing issues from json does not support xml output"
| Latex => failwith "Printing issues from json does not support latex output"
};
- IList.iter pp_json_issue format_list
+ List.iter f::pp_json_issue format_list
};
let sorted_report = {
let report = Jsonbug_j.report_of_string (String.concat sep::"\n" report_lines);
@@ -1130,7 +1130,7 @@ let pp_json_report_by_report_kind formats_by_report_kind fname =>
| (Issues, [_, ..._]) => pp_json_issues format_list sorted_report
| _ => ()
};
- IList.iter pp_report_by_report_kind formats_by_report_kind
+ List.iter f::pp_report_by_report_kind formats_by_report_kind
| None => failwithf "Error reading %s. Does the file exist?" fname
};
@@ -1141,7 +1141,7 @@ let pp_lint_issues_by_report_kind formats_by_report_kind error_filter linereader
pp_issues_of_error_log error_filter linereader None procname error_log format_list
| _ => ()
};
- IList.iter pp_summary_by_report_kind formats_by_report_kind
+ List.iter f::pp_summary_by_report_kind formats_by_report_kind
};
@@ -1173,8 +1173,8 @@ let module AnalysisResults = {
if CLOpt.is_originator {
/* Find spec files specified by command-line arguments. Not run at init time since the specs
files may be generated between init and report time. */
- IList.iter
- (
+ List.iter
+ f::(
fun arg =>
if (not (Filename.check_suffix arg Config.specs_files_suffix) && arg != ".") {
print_usage_exit ("file " ^ arg ^ ": arguments must be .specs files")
@@ -1214,7 +1214,7 @@ let module AnalysisResults = {
exit 0
| Some summary => summaries := [(fname, summary), ...!summaries]
};
- apply_without_gc (IList.iter load_file) (spec_files_from_cmdline ());
+ apply_without_gc (List.iter f::load_file) (spec_files_from_cmdline ());
let summ_cmp (_, summ1) (_, summ2) => {
let n =
SourceFile.compare
@@ -1241,7 +1241,7 @@ let module AnalysisResults = {
exit 0
| Some summary => f (fname, summary)
};
- let iterate f => IList.iter (do_spec f) sorted_spec_files;
+ let iterate f => List.iter f::(do_spec f) sorted_spec_files;
iterate
};
@@ -1260,7 +1260,7 @@ let module AnalysisResults = {
If options - load_results or - save_results are used,
all the summaries are loaded in memory */
let get_summary_iterator () => {
- let iterator_of_summary_list r f => IList.iter f r;
+ let iterator_of_summary_list r f => List.iter f::f r;
switch Config.load_analysis_results {
| None =>
switch Config.save_analysis_results {
@@ -1334,9 +1334,9 @@ let init_files format_list_by_kind => {
| (Latex, Summary) => begin_latex_file outfile.fmt
| (Csv | Json | Latex | Tests | Text | Xml, _) => ()
};
- IList.iter init_files_of_format format_list
+ List.iter f::init_files_of_format format_list
};
- IList.iter init_files_of_report_kind format_list_by_kind
+ List.iter f::init_files_of_report_kind format_list_by_kind
};
let finalize_and_close_files format_list_by_kind stats pdflatex => {
@@ -1361,10 +1361,10 @@ let finalize_and_close_files format_list_by_kind stats pdflatex => {
ignore (Sys.command ("open " ^ pdf_name))
}
};
- IList.iter close_files_of_format format_list;
+ List.iter f::close_files_of_format format_list;
()
};
- IList.iter close_files_of_report_kind format_list_by_kind
+ List.iter f::close_files_of_report_kind format_list_by_kind
};
let pp_summary_and_issues formats_by_report_kind => {
diff --git a/infer/src/backend/abs.ml b/infer/src/backend/abs.ml
index 8f3b62374..626ecbbe0 100644
--- a/infer/src/backend/abs.ml
+++ b/infer/src/backend/abs.ml
@@ -478,7 +478,7 @@ let discover_para_candidates tenv p =
match nextse with
| Sil.Eexp (next, _) -> add_edge (root, next)
| _ -> assert false in
- IList.iter process fsel' in
+ List.iter ~f:process fsel' in
let rec get_edges_sigma = function
| [] -> ()
| Sil.Hlseg _ :: sigma_rest | Sil.Hdllseg _ :: sigma_rest ->
@@ -517,7 +517,7 @@ let discover_para_dll_candidates tenv p =
let links = IList.rev (List.fold ~f:convert_to_exp ~init:[] fsel') in
let rec iter_pairs = function
| [] -> ()
- | x:: l -> (IList.iter (fun y -> add_edge (root, x, y)) l; iter_pairs l) in
+ | x:: l -> (List.iter ~f:(fun y -> add_edge (root, x, y)) l; iter_pairs l) in
iter_pairs links in
let rec get_edges_sigma = function
| [] -> ()
@@ -852,8 +852,8 @@ let sigma_reachable root_fav sigma =
let do_hpred hpred =
let hp_fav_set = fav_to_set (Sil.hpred_fav hpred) in
let add_entry e = edges := (e, hp_fav_set) :: !edges in
- IList.iter add_entry (hpred_entries hpred) in
- IList.iter do_hpred sigma;
+ List.iter ~f:add_entry (hpred_entries hpred) in
+ List.iter ~f:do_hpred sigma;
let edge_fires (e, _) = match e with
| Exp.Var id ->
if (Ident.is_primed id || Ident.is_footprint id) then Ident.IdentSet.mem id !reach_set
@@ -890,7 +890,7 @@ let get_cycle root prop =
| _ -> None in
let print_cycle cyc =
(L.d_str "Cycle= ";
- IList.iter (fun ((e, t), f, e') ->
+ List.iter ~f:(fun ((e, t), f, e') ->
match e, e' with
| Sil.Eexp (e, _), Sil.Eexp (e', _) ->
L.d_str ("("^(Exp.to_string e)^": "^(Typ.to_string t)^", "
@@ -1063,7 +1063,7 @@ let check_junk ?original_prop pname tenv prop =
(Ident.is_primed id || Ident.is_footprint id)
&& not (Sil.fav_mem fav_root id) && not (id_considered_reachable id)
| _ -> false in
- IList.for_all predicate entries in
+ List.for_all ~f:predicate entries in
let hpred_in_cycle hpred = (* check if the predicate belongs to a cycle in the heap *)
let id_in_cycle id =
let set1 = sigma_reachable (Sil.fav_from_list [id]) sigma in
@@ -1111,7 +1111,7 @@ let check_junk ?original_prop pname tenv prop =
| Some (Apred (Aundef _ as a, _)) ->
res := Some a
| _ -> ()) in
- IList.iter do_entry entries;
+ List.iter ~f:do_entry entries;
!res in
L.d_decrease_indent 1;
let is_undefined =
diff --git a/infer/src/backend/absarray.ml b/infer/src/backend/absarray.ml
index 825ff4f73..9d09d28c6 100644
--- a/infer/src/backend/absarray.ml
+++ b/infer/src/backend/absarray.ml
@@ -542,11 +542,13 @@ let check_after_array_abstraction tenv prop =
| Sil.Earray (_, esel, _) -> (* check that no more than 2 elements are in the array *)
let typ_elem = Typ.array_elem (Some Typ.Tvoid) typ in
if IList.length esel > 2 && array_typ_can_abstract typ then
- if IList.for_all (check_index root offs) esel then ()
+ if List.for_all ~f:(check_index root offs) esel then ()
else report_error prop
- else IList.iter (fun (ind, se) -> check_se root (offs @ [Sil.Off_index ind]) typ_elem se) esel
+ else List.iter
+ ~f:(fun (ind, se) -> check_se root (offs @ [Sil.Off_index ind]) typ_elem se)
+ esel
| Sil.Estruct (fsel, _) ->
- IList.iter (fun (f, se) ->
+ List.iter ~f:(fun (f, se) ->
let typ_f = StructTyp.fld_typ ~lookup ~default:Tvoid f typ in
check_se root (offs @ [Sil.Off_fld (f, typ)]) typ_f se) fsel in
let check_hpred = function
@@ -554,7 +556,7 @@ let check_after_array_abstraction tenv prop =
let typ = Exp.texp_to_typ (Some Typ.Tvoid) texp in
check_se root [] typ se
| Sil.Hlseg _ | Sil.Hdllseg _ -> () in
- let check_sigma sigma = IList.iter check_hpred sigma in
+ let check_sigma sigma = List.iter ~f:check_hpred sigma in
(* check_footprint_pure prop; *)
check_sigma prop.Prop.sigma;
check_sigma prop.Prop.sigma_fp
@@ -580,8 +582,6 @@ let remove_redundant_elements tenv prop =
let favl_curr = Sil.fav_to_list fav_curr in
let favl_foot = Sil.fav_to_list fav_foot in
Sil.fav_duplicates := false;
- (* L.d_str "favl_curr "; IList.iter (fun id -> Sil.d_exp (Exp.Var id)) favl_curr; L.d_ln();
- L.d_str "favl_foot "; IList.iter (fun id -> Sil.d_exp (Exp.Var id)) favl_foot; L.d_ln(); *)
let num_occur l id = IList.length (List.filter ~f:(fun id' -> Ident.equal id id') l) in
let at_most_once v =
num_occur favl_curr v <= 1 && num_occur favl_foot v <= 1 in
diff --git a/infer/src/backend/buckets.ml b/infer/src/backend/buckets.ml
index 69c3ec076..ebb5dd1f5 100644
--- a/infer/src/backend/buckets.ml
+++ b/infer/src/backend/buckets.ml
@@ -70,7 +70,7 @@ let check_access access_opt de_opt =
Config.curr_language_is Config.Java && Pvar.is_this pvar in
if not is_java_this && is_formal pvar then formal_ids := id :: !formal_ids
| _ -> () in
- IList.iter process_formal_letref node_instrs;
+ List.iter ~f:process_formal_letref node_instrs;
!formal_ids in
let formal_param_used_in_call = ref false in
let has_call_or_sets_null node =
diff --git a/infer/src/backend/builtin.ml b/infer/src/backend/builtin.ml
index c42187a15..df770783d 100644
--- a/infer/src/backend/builtin.ml
+++ b/infer/src/backend/builtin.ml
@@ -58,7 +58,7 @@ let pp_registered fmt () =
builtin_names := IList.sort Procname.compare !builtin_names;
let pp pname = Format.fprintf fmt "%a@\n" Procname.pp pname in
Format.fprintf fmt "Registered builtins:@\n @[";
- IList.iter pp !builtin_names;
+ List.iter ~f:pp !builtin_names;
Format.fprintf fmt "@]@."
(** print the builtin functions and exit *)
diff --git a/infer/src/backend/callbacks.ml b/infer/src/backend/callbacks.ml
index 8380afa09..7348514a9 100644
--- a/infer/src/backend/callbacks.ml
+++ b/infer/src/backend/callbacks.ml
@@ -83,26 +83,26 @@ let iterate_procedure_callbacks exe_env caller_pname =
Option.iter
~f:(fun (idenv, tenv, proc_name, proc_desc, _) ->
- IList.iter
- (fun (language_opt, proc_callback) ->
- let language_matches = match language_opt with
- | Some language -> Config.equal_language language procedure_language
- | None -> true in
- if language_matches then
- begin
- let init_time = Unix.gettimeofday () in
- proc_callback
- {
- get_proc_desc;
- get_procs_in_file;
- idenv;
- tenv;
- proc_name;
- proc_desc;
- };
- let elapsed = Unix.gettimeofday () -. init_time in
- update_time proc_name elapsed
- end)
+ List.iter
+ ~f:(fun (language_opt, proc_callback) ->
+ let language_matches = match language_opt with
+ | Some language -> Config.equal_language language procedure_language
+ | None -> true in
+ if language_matches then
+ begin
+ let init_time = Unix.gettimeofday () in
+ proc_callback
+ {
+ get_proc_desc;
+ get_procs_in_file;
+ idenv;
+ tenv;
+ proc_name;
+ proc_desc;
+ };
+ let elapsed = Unix.gettimeofday () -. init_time in
+ update_time proc_name elapsed
+ end)
!procedure_callbacks)
(get_procedure_definition exe_env caller_pname)
@@ -126,11 +126,11 @@ let iterate_cluster_callbacks all_procs exe_env proc_names =
~default:proc_names
language_opt in
- IList.iter
- (fun (language_opt, cluster_callback) ->
- let proc_names = relevant_procedures language_opt in
- if IList.length proc_names > 0 then
- cluster_callback exe_env all_procs get_procdesc environment)
+ List.iter
+ ~f:(fun (language_opt, cluster_callback) ->
+ let proc_names = relevant_procedures language_opt in
+ if IList.length proc_names > 0 then
+ cluster_callback exe_env all_procs get_procdesc environment)
!cluster_callbacks
(** Invoke all procedure and cluster callbacks on a given environment. *)
@@ -168,17 +168,17 @@ let iterate_callbacks store_summary call_graph exe_env =
then Specs.reset_summary call_graph proc_name attributes_opt None in
(* Make sure summaries exists. *)
- IList.iter reset_summary procs_to_analyze;
+ List.iter ~f:reset_summary procs_to_analyze;
(* Invoke callbacks. *)
- IList.iter
- (iterate_procedure_callbacks exe_env)
+ List.iter
+ ~f:(iterate_procedure_callbacks exe_env)
procs_to_analyze;
- IList.iter
- (iterate_cluster_callbacks originally_defined_procs exe_env)
+ List.iter
+ ~f:(iterate_cluster_callbacks originally_defined_procs exe_env)
(cluster procs_to_analyze);
- IList.iter store_summary procs_to_analyze;
+ List.iter ~f:store_summary procs_to_analyze;
Config.curr_language := saved_language
diff --git a/infer/src/backend/clusterMakefile.ml b/infer/src/backend/clusterMakefile.ml
index 6583e27fb..929bffd6d 100644
--- a/infer/src/backend/clusterMakefile.ml
+++ b/infer/src/backend/clusterMakefile.ml
@@ -51,10 +51,10 @@ let pp_prolog fmt clusters =
compilation_dbs_cmd;
F.fprintf fmt "CLUSTERS=";
- IList.iteri
- (fun i cl ->
- if cluster_should_be_analyzed cl
- then F.fprintf fmt "%a " Cluster.pp_cluster_name (i+1))
+ List.iteri
+ ~f:(fun i cl ->
+ if cluster_should_be_analyzed cl
+ then F.fprintf fmt "%a " Cluster.pp_cluster_name (i+1))
clusters;
F.fprintf fmt "@.@.default: test@.@.all: test@.@.";
@@ -71,6 +71,6 @@ let create_cluster_makefile (clusters: Cluster.t list) (fname: string) =
F.fprintf fmt "#%s@\n" (DB.source_dir_to_string cluster);
Cluster.pp_cluster fmt (cluster_nr + 1, cluster) in
pp_prolog fmt clusters;
- IList.iteri do_cluster clusters;
+ List.iteri ~f:do_cluster clusters;
pp_epilog fmt () ;
Out_channel.close outc
diff --git a/infer/src/backend/crashcontext.ml b/infer/src/backend/crashcontext.ml
index 88b166dc8..49fe838bf 100644
--- a/infer/src/backend/crashcontext.ml
+++ b/infer/src/backend/crashcontext.ml
@@ -111,7 +111,7 @@ let collect_all_summaries root_summaries_dir stacktrace_file stacktraces_dir =
| Some pair -> pair :: pairs_for_stactrace_dir in
let process_stacktrace (stacktrace_file, out_file) =
stitch_summaries stacktrace_file method_summaries out_file in
- IList.iter process_stacktrace input_output_file_pairs
+ List.iter ~f:process_stacktrace input_output_file_pairs
let crashcontext_epilogue ~in_buck_mode =
(* if we are the top-level process, then find the output directory and
diff --git a/infer/src/backend/dom.ml b/infer/src/backend/dom.ml
index 6fee41360..3bf514942 100644
--- a/infer/src/backend/dom.ml
+++ b/infer/src/backend/dom.ml
@@ -185,8 +185,8 @@ end = struct
| v:: vars', _ ->
let r = find' tbl v in
let set = lookup_const' const_tbl r in
- (IList.for_all (fun v' -> Exp.equal (find' tbl v') r) vars') &&
- (IList.for_all (fun c -> Exp.Set.mem c set) nonvars)
+ (List.for_all ~f:(fun v' -> Exp.equal (find' tbl v') r) vars') &&
+ (List.for_all ~f:(fun c -> Exp.Set.mem c set) nonvars)
end
@@ -578,7 +578,7 @@ end = struct
lost_little side e assoc_es in
let lhs_es = IList.map (fun (e1, _, _) -> e1) !tbl in
let rhs_es = IList.map (fun (_, e2, _) -> e2) !tbl in
- (IList.for_all (f Rhs) rhs_es) && (IList.for_all (f Lhs) lhs_es)
+ (List.for_all ~f:(f Rhs) rhs_es) && (List.for_all ~f:(f Lhs) lhs_es)
let lookup_side' side e =
let f (e1, e2, _) = Exp.equal e (select side e1 e2) in
@@ -599,7 +599,7 @@ end = struct
res := v'::!res
| _ -> () in
begin
- IList.iter f !tbl;
+ List.iter ~f:f !tbl;
IList.rev !res
end
@@ -715,11 +715,11 @@ end = struct
build_other_atoms (fun e0 -> Prop.mk_neq tenv e0 e') side e
| Sil.Apred (a, (Var id as e) :: es)
- when not (Ident.is_normal id) && IList.for_all exp_contains_only_normal_ids es ->
+ when not (Ident.is_normal id) && List.for_all ~f:exp_contains_only_normal_ids es ->
build_other_atoms (fun e0 -> Prop.mk_pred tenv a (e0 :: es)) side e
| Sil.Anpred (a, (Var id as e) :: es)
- when not (Ident.is_normal id) && IList.for_all exp_contains_only_normal_ids es ->
+ when not (Ident.is_normal id) && List.for_all ~f:exp_contains_only_normal_ids es ->
build_other_atoms (fun e0 -> Prop.mk_npred tenv a (e0 :: es)) side e
| Sil.Aeq((Exp.Var id as e), e') | Sil.Aeq(e', (Exp.Var id as e))
@@ -1571,7 +1571,7 @@ let pi_partial_join tenv mode
| Sil.Hpointsto (_, Sil.Earray (Exp.Const (Const.Cint n), _, _), _) ->
(if IntLit.geq n IntLit.one then len_list := n :: !len_list)
| _ -> () in
- IList.iter do_hpred prop.Prop.sigma;
+ List.iter ~f:do_hpred prop.Prop.sigma;
!len_list in
let bounds =
let bounds1 = get_array_len ep1 in
@@ -1686,7 +1686,7 @@ let pi_partial_meet tenv (p: Prop.normal Prop.t) (ep1: 'a Prop.t) (ep2: 'b Prop.
let handle_atom sub dom atom =
let fav_list = Sil.fav_to_list (Sil.atom_fav atom) in
- if IList.for_all (fun id -> Ident.IdentSet.mem id dom) fav_list then
+ if List.for_all ~f:(fun id -> Ident.IdentSet.mem id dom) fav_list then
Sil.atom_sub sub atom
else (L.d_str "handle_atom failed on "; Sil.d_atom atom; L.d_ln (); raise IList.Fail) in
let f1 p' atom =
@@ -1719,13 +1719,13 @@ let eprop_partial_meet tenv (ep1: 'a Prop.t) (ep2: 'b Prop.t) : 'c Prop.t =
let sub2 = ep2.Prop.sub in
let range1 = Sil.sub_range sub1 in
let f e = Sil.fav_for_all (Sil.exp_fav e) Ident.is_normal in
- Sil.equal_subst sub1 sub2 && IList.for_all f range1 in
+ Sil.equal_subst sub1 sub2 && List.for_all ~f:f range1 in
if not (sub_check ()) then
(L.d_strln "sub_check() failed"; raise IList.Fail)
else begin
let todos = IList.map (fun x -> (x, x, x)) es in
- IList.iter Todo.push todos;
+ List.iter ~f:Todo.push todos;
let sigma_new = sigma_partial_meet tenv sigma1 sigma2 in
let ep = Prop.set ep1 ~sigma:sigma_new in
let ep' = Prop.set ep ~pi:[] in
@@ -1785,7 +1785,7 @@ let eprop_partial_join' tenv mode (ep1: Prop.exposed Prop.t) (ep2: Prop.exposed
raise IList.Fail
end;
let todos = IList.map (fun x -> (x, x, x)) es1 in
- IList.iter Todo.push todos;
+ List.iter ~f:Todo.push todos;
match sigma_partial_join tenv mode sigma1 sigma2 with
| sigma_new, [], [] ->
L.d_strln "sigma_partial_join succeeded";
diff --git a/infer/src/backend/dotty.ml b/infer/src/backend/dotty.ml
index 6019889e8..21ee8f79f 100644
--- a/infer/src/backend/dotty.ml
+++ b/infer/src/backend/dotty.ml
@@ -335,7 +335,7 @@ let set_exps_neq_zero pi =
exps_neq_zero := e :: !exps_neq_zero
| _ -> () in
exps_neq_zero := [];
- IList.iter f pi
+ List.iter ~f:f pi
let box_dangling e =
let entry_e = List.filter ~f:(fun b -> match b with
@@ -357,8 +357,8 @@ let compute_fields_struct sigma =
let rec do_strexp se in_struct =
match se with
| Sil.Eexp (e, _) -> if in_struct then fields_structs:= e ::!fields_structs else ()
- | Sil.Estruct (l, _) -> IList.iter (fun e -> do_strexp e true) (snd (List.unzip l))
- | Sil.Earray (_, l, _) -> IList.iter (fun e -> do_strexp e false) (snd (List.unzip l)) in
+ | Sil.Estruct (l, _) -> List.iter ~f:(fun e -> do_strexp e true) (snd (List.unzip l))
+ | Sil.Earray (_, l, _) -> List.iter ~f:(fun e -> do_strexp e false) (snd (List.unzip l)) in
let rec fs s =
match s with
| [] -> ()
@@ -512,7 +512,7 @@ let rec dotty_mk_set_links dotnodes sigma p f cycle =
(match src with
| [] -> assert false
| nl ->
- (* L.out "@\n@\n List of nl= "; IList.iter (L.out " %i ") nl; L.out "@.@.@."; *)
+ (* L.out "@\n@\n List of nl= "; List.iter ~f:(L.out " %i ") nl; L.out "@.@.@."; *)
let target_list = compute_target_struct_fields dotnodes lfld p f lambda cycle in
let ff n = IList.map (fun (k, lab_src, m, lab_trg) ->
mk_link k (mk_coordinate n lambda) lab_src (mk_coordinate m lambda) lab_trg
@@ -679,7 +679,7 @@ let filter_useless_spec_dollar_box (nodes: dotty_node list) (links: link list) =
end
end
| _ -> () in
- IList.iter handle_one_node nodes;
+ List.iter ~f:handle_one_node nodes;
(!tmp_nodes,!tmp_links)
(* print a struct node *)
@@ -793,10 +793,10 @@ and build_visual_graph f pe p cycle =
compute_fields_struct sigma;
compute_struct_exp_nodes sigma;
(* L.out "@\n@\n Computed fields structs: ";
- IList.iter (fun e -> L.out " %a " (Sil.pp_exp_printenv pe) e) !fields_structs;
+ List.iter ~f:(fun e -> L.out " %a " (Sil.pp_exp_printenv pe) e) !fields_structs;
L.out "@\n@.";
L.out "@\n@\n Computed exp structs nodes: ";
- IList.iter (fun e -> L.out " %a " (Sil.pp_exp_printenv pe) e) !struct_exp_nodes;
+ List.iter ~f:(fun e -> L.out " %a " (Sil.pp_exp_printenv pe) e) !struct_exp_nodes;
L.out "@\n@."; *)
let sigma_lambda = IList.map (fun hp -> (hp,!lambda_counter)) sigma in
let nodes = (dotty_mk_node pe) sigma_lambda in
@@ -853,11 +853,11 @@ and pp_dotty f kind (_prop: Prop.normal Prop.t) cycle =
let (nodes, links) = build_visual_graph f pe prop cycle in
let all_nodes = (nodes @ !dangling_dotboxes @ !nil_dotboxes) in
if !print_full_prop then
- IList.iter ((dotty_pp_state f pe) cycle) all_nodes
+ List.iter ~f:((dotty_pp_state f pe) cycle) all_nodes
else
- IList.iter (fun node ->
+ List.iter ~f:(fun node ->
if node_in_cycle cycle node then (dotty_pp_state f pe) cycle node) all_nodes;
- IList.iter (dotty_pp_link f) links;
+ List.iter ~f:(dotty_pp_link f) links;
(* F.fprintf f "\n } \n"; *)
F.fprintf f "\n } \n"
@@ -873,16 +873,16 @@ let pp_dotty_one_spec f pre posts =
invisible_arrows:= true;
pp_dotty f Spec_precondition pre None;
invisible_arrows:= false;
- IList.iter (fun (po, _) -> incr post_counter ; pp_dotty f (Spec_postcondition pre) po None;
- for j = 1 to 4 do
- F.fprintf f " inv_%i%i%i%i -> state_pi_%i [style=invis]\n"
- !spec_counter
- j
- j
- j
- !target_invisible_arrow_pre;
- done
- ) posts;
+ List.iter ~f:(fun (po, _) -> incr post_counter ; pp_dotty f (Spec_postcondition pre) po None;
+ for j = 1 to 4 do
+ F.fprintf f " inv_%i%i%i%i -> state_pi_%i [style=invis]\n"
+ !spec_counter
+ j
+ j
+ j
+ !target_invisible_arrow_pre;
+ done
+ ) posts;
F.fprintf f "\n } \n"
(* this is used to print a list of proposition when considered in a path of nodes *)
@@ -893,8 +893,8 @@ let pp_dotty_prop_list_in_path f plist prev_n curr_n =
F.fprintf f "\n subgraph cluster_%i { color=blue \n" !dotty_state_count;
incr dotty_state_count;
F.fprintf f "\n state%iN [label=\"NODE %i \", style=filled, color= lightblue]\n" curr_n curr_n;
- IList.iter (fun po -> incr proposition_counter ;
- pp_dotty f Generic_proposition po None) plist;
+ List.iter ~f:(fun po -> incr proposition_counter ;
+ pp_dotty f Generic_proposition po None) plist;
if prev_n <> - 1 then F.fprintf f "\n state%iN ->state%iN\n" prev_n curr_n;
F.fprintf f "\n } \n"
with exn when SymOp.exn_not_failure exn ->
@@ -947,11 +947,11 @@ let pp_cfgnodename pname fmt (n : Procdesc.Node.t) =
F.fprintf fmt "\"%s_%d\"" (Procname.to_filename pname) (Procdesc.Node.get_id n :> int)
let pp_etlist fmt etl =
- IList.iter (fun (id, ty) ->
+ List.iter ~f:(fun (id, ty) ->
Format.fprintf fmt " %a:%a" Mangled.pp id (Typ.pp_full Pp.text) ty) etl
let pp_local_list fmt etl =
- IList.iter (fun (id, ty) ->
+ List.iter ~f:(fun (id, ty) ->
Format.fprintf fmt " %a:%a" Mangled.pp id (Typ.pp_full Pp.text) ty) etl
let pp_cfgnodelabel pdesc fmt (n : Procdesc.Node.t) =
@@ -983,7 +983,7 @@ let pp_cfgnodelabel pdesc fmt (n : Procdesc.Node.t) =
let str = F.asprintf "%t" pp in
Escape.escape_dotty str in
let pp_instrs fmt instrs =
- IList.iter (fun i -> F.fprintf fmt " %s\\n " (instr_string i)) instrs in
+ List.iter ~f:(fun i -> F.fprintf fmt " %s\\n " (instr_string i)) instrs in
let instrs = Procdesc.Node.get_instrs n in
F.fprintf fmt "%d: %a \\n %a" (Procdesc.Node.get_id n :> int) pp_label n pp_instrs instrs
@@ -1013,8 +1013,8 @@ let pp_cfgnode pdesc fmt (n: Procdesc.Node.t) =
(pp_cfgnodename pname) n1
(pp_cfgnodename pname) n2
color in
- IList.iter (fun n' -> print_edge n n' false) (Procdesc.Node.get_succs n);
- IList.iter (fun n' -> print_edge n n' true) (Procdesc.Node.get_exn n)
+ List.iter ~f:(fun n' -> print_edge n n' false) (Procdesc.Node.get_succs n);
+ List.iter ~f:(fun n' -> print_edge n n' true) (Procdesc.Node.get_exn n)
(* * print control flow graph (in dot form) for fundec to channel let *)
(* print_cfg_channel (chan : out_channel) (fd : fundec) = let pnode (s: *)
@@ -1066,7 +1066,9 @@ let pp_speclist_dotty f (splist: Prop.normal Specs.spec list) =
F.fprintf f "@\n@\n\ndigraph main { \nnode [shape=box]; @\n";
F.fprintf f "@\n compound = true; @\n";
(* F.fprintf f "\n size=\"12,7\"; ratio=fill; \n"; *)
- IList.iter (fun s -> pp_dotty_one_spec f (Specs.Jprop.to_prop s.Specs.pre) s.Specs.posts) splist;
+ List.iter
+ ~f:(fun s -> pp_dotty_one_spec f (Specs.Jprop.to_prop s.Specs.pre) s.Specs.posts)
+ splist;
F.fprintf f "@\n}";
Config.pp_simple := pp_simple_saved
diff --git a/infer/src/backend/errdesc.ml b/infer/src/backend/errdesc.ml
index 5a825d407..88d7b0822 100644
--- a/infer/src/backend/errdesc.ml
+++ b/infer/src/backend/errdesc.ml
@@ -20,7 +20,7 @@ let vector_class = ["std"; "vector"]
let is_one_of_classes class_name classes =
List.exists ~f:(fun wrapper_class ->
- IList.for_all (fun wrapper_class_substring ->
+ List.for_all ~f:(fun wrapper_class_substring ->
String.is_substring ~substring:wrapper_class_substring class_name) wrapper_class)
classes
@@ -447,9 +447,9 @@ let leak_from_list_abstraction hpred prop =
| Some texp' when Exp.equal texp texp' -> found := true
| _ -> () in
let check_hpara texp _ hpara =
- IList.iter (check_hpred texp) hpara.Sil.body in
+ List.iter ~f:(check_hpred texp) hpara.Sil.body in
let check_hpara_dll texp _ hpara =
- IList.iter (check_hpred texp) hpara.Sil.body_dll in
+ List.iter ~f:(check_hpred texp) hpara.Sil.body_dll in
match hpred_type hpred with
| Some texp ->
let env = Prop.prop_pred_env prop in
@@ -473,7 +473,7 @@ let find_typ_without_ptr prop pvar =
| Sil.Hpointsto (e, _, te) when Exp.equal e (Exp.Lvar pvar) ->
res := Some te
| _ -> () in
- IList.iter do_hpred prop.Prop.sigma;
+ List.iter ~f:do_hpred prop.Prop.sigma;
!res
(** Produce a description of a leak by looking at the current state.
@@ -620,7 +620,7 @@ let vpath_find tenv prop _exp : DExp.t option * Typ.t option =
None, None)
| Sil.Estruct (fsel, _) ->
let res = ref (None, None) in
- IList.iter (do_fse res sigma_acc' sigma_todo' lexp texp) fsel;
+ List.iter ~f:(do_fse res sigma_acc' sigma_todo' lexp texp) fsel;
!res
| _ ->
None, None in
@@ -673,7 +673,7 @@ let explain_dexp_access prop dexp is_nullable =
| Sil.Hpointsto (e', se, _) when Exp.equal e e' ->
res := Some se
| _ -> () in
- IList.iter do_hpred sigma;
+ List.iter ~f:do_hpred sigma;
!res in
let rec lookup_fld fsel f = match fsel with
| [] ->
@@ -986,7 +986,7 @@ let find_with_exp prop exp =
| Sil.Eexp (e, _) ->
if Exp.equal e exp then found_in_struct pv fld_lst
| Sil.Estruct (fsel, _) ->
- IList.iter (fun (f, se) -> search_struct pv (f:: fld_lst) se) fsel
+ List.iter ~f:(fun (f, se) -> search_struct pv (f:: fld_lst) se) fsel
| _ -> () in
let do_hpred_pointed_by_pvar pv e = function
| Sil.Hpointsto(e1, se, _) ->
@@ -995,9 +995,9 @@ let find_with_exp prop exp =
let do_hpred = function
| Sil.Hpointsto(Exp.Lvar pv, Sil.Eexp (e, _), _) ->
if Exp.equal e exp then found_in_pvar pv
- else IList.iter (do_hpred_pointed_by_pvar pv e) prop.Prop.sigma
+ else List.iter ~f:(do_hpred_pointed_by_pvar pv e) prop.Prop.sigma
| _ -> () in
- IList.iter do_hpred prop.Prop.sigma;
+ List.iter ~f:do_hpred prop.Prop.sigma;
!res
(** return a description explaining value [exp] in [prop] in terms of a source expression
diff --git a/infer/src/backend/exe_env.ml b/infer/src/backend/exe_env.ml
index e7148477a..bc380e3b5 100644
--- a/infer/src/backend/exe_env.ml
+++ b/infer/src/backend/exe_env.ml
@@ -95,8 +95,8 @@ let add_cg (exe_env: t) (source_dir : DB.source_dir) =
exe_env.source_files <- SourceFile.Set.add source exe_env.source_files;
let defined_procs = Cg.get_defined_nodes cg in
- IList.iter
- (fun pname ->
+ List.iter
+ ~f:(fun pname ->
(match AttributesTable.find_file_capturing_procedure pname with
| None ->
()
diff --git a/infer/src/backend/interproc.ml b/infer/src/backend/interproc.ml
index 797f037f0..9ae2b9949 100644
--- a/infer/src/backend/interproc.ml
+++ b/infer/src/backend/interproc.ml
@@ -291,8 +291,8 @@ let propagate_nodes_divergence
Propgraph.d_proplist Prop.prop_emp (Paths.PathSet.to_proplist prop_incons); L.d_ln ();
propagate wl pname ~is_exception:false prop_incons exit_node
end;
- IList.iter (propagate wl pname ~is_exception:false pset_ok) succ_nodes;
- IList.iter (propagate wl pname ~is_exception:true pset_exn) exn_nodes
+ List.iter ~f:(propagate wl pname ~is_exception:false pset_ok) succ_nodes;
+ List.iter ~f:(propagate wl pname ~is_exception:true pset_exn) exn_nodes
(* ===================== END of symbolic execution ===================== *)
@@ -306,7 +306,7 @@ let do_symexec_join pname tenv wl curr_node (edgeset_todo : Paths.PathSet.t) =
let old_dset = Join_table.find wl.Worklist.join_table curr_node_id in
let old_dset', new_dset' = Dom.pathset_join pname tenv old_dset new_dset in
Join_table.add wl.Worklist.join_table curr_node_id (Paths.PathSet.union old_dset' new_dset');
- IList.iter (fun node ->
+ List.iter ~f:(fun node ->
Paths.PathSet.iter (fun prop path ->
State.set_path path None;
propagate wl pname ~is_exception:false
@@ -350,8 +350,8 @@ let instrs_get_normal_vars instrs =
let do_instr instr =
let do_e e = Sil.exp_fav_add fav e in
let exps = Sil.instr_get_exps instr in
- IList.iter do_e exps in
- IList.iter do_instr instrs;
+ List.iter ~f:do_e exps in
+ List.iter ~f:do_instr instrs;
Sil.fav_filter_ident fav Ident.is_normal;
Sil.fav_to_list fav
@@ -407,17 +407,17 @@ let check_assignement_guard pdesc node =
[e']
| _ -> [] in
let prune_vars = List.concat(IList.map (fun n -> prune_var n) succs) in
- IList.for_all (fun e' -> Exp.equal e' e) prune_vars in
+ List.for_all ~f:(fun e' -> Exp.equal e' e) prune_vars in
let succs_loc = IList.map (fun n -> Procdesc.Node.get_loc n) succs in
let succs_are_all_prune_nodes () =
- IList.for_all (fun n -> match Procdesc.Node.get_kind n with
+ List.for_all ~f:(fun n -> match Procdesc.Node.get_kind n with
| Procdesc.Node.Prune_node(_) -> true
| _ -> false) succs in
let succs_same_loc_as_node () =
if verbose then
(L.d_str ("LOCATION NODE: line: " ^ (string_of_int l_node.Location.line));
L.d_strln " ");
- IList.for_all (fun l ->
+ List.for_all ~f:(fun l ->
if verbose then
(L.d_str ("LOCATION l: line: " ^ (string_of_int l.Location.line));
L.d_strln " ");
@@ -430,8 +430,8 @@ let check_assignement_guard pdesc node =
| Sil.Prune _ -> false
| _ -> true in
let check_guard n =
- IList.for_all check_instr (Procdesc.Node.get_instrs n) in
- IList.for_all check_guard succs in
+ List.for_all ~f:check_instr (Procdesc.Node.get_instrs n) in
+ List.for_all ~f:check_guard succs in
if Config.curr_language_is Config.Clang &&
succs_are_all_prune_nodes () &&
succs_same_loc_as_node () &&
@@ -654,17 +654,17 @@ let report_context_leaks pname sigma tenv =
let reachable_hpreds, reachable_exps =
Prop.compute_reachable_hpreds sigma fld_exps in
(* raise an error if any Context expression is in [reachable_exps] *)
- IList.iter
- (fun (context_exp, name) ->
- if Exp.Set.mem context_exp reachable_exps then
- let leak_path =
- match get_fld_typ_path_opt fld_exps context_exp reachable_hpreds with
- | Some path -> path
- | None -> assert false (* a path must exist in order for a leak to be reported *) in
- let err_desc =
- Errdesc.explain_context_leak pname (Typ.Tstruct name) fld_name leak_path in
- let exn = Exceptions.Context_leak (err_desc, __POS__) in
- Reporting.log_error pname exn)
+ List.iter
+ ~f:(fun (context_exp, name) ->
+ if Exp.Set.mem context_exp reachable_exps then
+ let leak_path =
+ match get_fld_typ_path_opt fld_exps context_exp reachable_hpreds with
+ | Some path -> path
+ | None -> assert false (* a path must exist in order for a leak to be reported *) in
+ let err_desc =
+ Errdesc.explain_context_leak pname (Typ.Tstruct name) fld_name leak_path in
+ let exn = Exceptions.Context_leak (err_desc, __POS__) in
+ Reporting.log_error pname exn)
context_exps in
(* get the set of pointed-to expressions of type T <: Context *)
let context_exps =
@@ -678,15 +678,15 @@ let report_context_leaks pname sigma tenv =
| _ -> exps)
~init:[]
sigma in
- IList.iter
- (function
- | Sil.Hpointsto (Exp.Lvar pv, Sil.Estruct (static_flds, _), _)
- when Pvar.is_global pv ->
- IList.iter
- (fun (f_name, f_strexp) ->
- check_reachable_context_from_fld (f_name, f_strexp) context_exps)
- static_flds
- | _ -> ())
+ List.iter
+ ~f:(function
+ | Sil.Hpointsto (Exp.Lvar pv, Sil.Estruct (static_flds, _), _)
+ when Pvar.is_global pv ->
+ List.iter
+ ~f:(fun (f_name, f_strexp) ->
+ check_reachable_context_from_fld (f_name, f_strexp) context_exps)
+ static_flds
+ | _ -> ())
sigma
(** Remove locals and formals,
@@ -700,7 +700,7 @@ let remove_locals_formals_and_check tenv pdesc p =
let desc = Errdesc.explain_stack_variable_address_escape loc pvar dexp_opt in
let exn = Exceptions.Stack_variable_address_escape (desc, __POS__) in
Reporting.log_warning pname exn in
- IList.iter check_pvar pvars;
+ List.iter ~f:check_pvar pvars;
p'
(** Collect the analysis results for the exit node. *)
@@ -970,12 +970,12 @@ let get_procs_and_defined_children call_graph =
let pp_intra_stats wl proc_desc fmt _ =
let nstates = ref 0 in
let nodes = Procdesc.get_nodes proc_desc in
- IList.iter
- (fun node ->
- nstates :=
- !nstates +
- Paths.PathSet.size
- (htable_retrieve wl.Worklist.path_set_visited (Procdesc.Node.get_id node)))
+ List.iter
+ ~f:(fun node ->
+ nstates :=
+ !nstates +
+ Paths.PathSet.size
+ (htable_retrieve wl.Worklist.path_set_visited (Procdesc.Node.get_id node)))
nodes;
F.fprintf fmt "(%d nodes containing %d states)" (IList.length nodes) !nstates
@@ -1199,7 +1199,7 @@ let report_runtime_exceptions tenv pdesc summary =
let exn_desc = Localise.java_unchecked_exn_desc pname runtime_exception pre_str in
let exn = Exceptions.Java_runtime_exception (runtime_exception, pre_str, exn_desc) in
Reporting.log_error pname exn in
- IList.iter report exn_preconditions
+ List.iter ~f:report exn_preconditions
let report_custom_errors tenv summary =
@@ -1212,7 +1212,7 @@ let report_custom_errors tenv summary =
let err_desc = Localise.desc_custom_error loc in
let exn = Exceptions.Custom_error (custom_error, err_desc) in
Reporting.log_error pname exn in
- IList.iter report error_preconditions
+ List.iter ~f:report error_preconditions
module SpecMap = Caml.Map.Make (struct
type t = Prop.normal Specs.Jprop.t
@@ -1277,8 +1277,8 @@ let update_specs tenv proc_name phase (new_specs : Specs.NormSpec.t list)
{ Specs.pre = pre;
Specs.posts = Paths.PathSet.elements post_set;
Specs.visited = visited }:: !res in
- IList.iter re_exe_filter old_specs; (* filter out pre's which failed re-exe *)
- IList.iter add_spec new_specs; (* add new specs *)
+ List.iter ~f:re_exe_filter old_specs; (* filter out pre's which failed re-exe *)
+ List.iter ~f:add_spec new_specs; (* add new specs *)
SpecMap.iter convert !current_specs;
!res,!changed
@@ -1444,13 +1444,13 @@ let do_analysis exe_env =
else None in
Specs.init_summary (nodes, proc_flags, calls, None, attributes, proc_desc_option) in
- IList.iter
- (fun (pn, _) ->
- let should_init () =
- Config.models_mode ||
- is_none (Specs.get_summary pn) in
- if should_init ()
- then init_proc pn)
+ List.iter
+ ~f:(fun (pn, _) ->
+ let should_init () =
+ Config.models_mode ||
+ is_none (Specs.get_summary pn) in
+ if should_init ()
+ then init_proc pn)
procs_and_defined_children;
let callbacks =
@@ -1592,7 +1592,7 @@ let print_stats_cfg proc_shadowed source cfg =
print_file_stats fmt ();
Out_channel.close outc
with Sys_error _ -> () in
- IList.iter compute_stats_proc (Cfg.get_defined_procs cfg);
+ List.iter ~f:compute_stats_proc (Cfg.get_defined_procs cfg);
L.out "%a" print_file_stats ();
save_file_stats ()
diff --git a/infer/src/backend/mergeCapture.ml b/infer/src/backend/mergeCapture.ml
index dcdae3ee5..a2b22dfa1 100644
--- a/infer/src/backend/mergeCapture.ml
+++ b/infer/src/backend/mergeCapture.ml
@@ -142,11 +142,11 @@ let should_link ~target ~target_results_dir ~stats infer_out_src infer_out_dst =
let symlinks_up_to_date captured_file =
if Sys.is_directory captured_file = `Yes then
let contents = Array.to_list (Sys.readdir captured_file) in
- IList.for_all
- (fun file ->
- let file_path = Filename.concat captured_file file in
- Sys.file_exists file_path = `Yes &&
- (not check_timestamp_of_symlinks || symlink_up_to_date file_path))
+ List.for_all
+ ~f:(fun file ->
+ let file_path = Filename.concat captured_file file in
+ Sys.file_exists file_path = `Yes &&
+ (not check_timestamp_of_symlinks || symlink_up_to_date file_path))
contents
else true in
let check_file captured_file =
@@ -161,9 +161,9 @@ let should_link ~target ~target_results_dir ~stats infer_out_src infer_out_dst =
begin
let captured_files = Array.to_list (Sys.readdir captured_src) in
num_captured_files := IList.length captured_files;
- IList.for_all
- (fun file ->
- check_file (Filename.concat captured_dst file))
+ List.for_all
+ ~f:(fun file ->
+ check_file (Filename.concat captured_dst file))
captured_files
end
else
@@ -199,7 +199,7 @@ let process_merge_file deps_file =
| _ ->
() in
Option.iter
- ~f:(fun lines -> IList.iter process_line lines)
+ ~f:(fun lines -> List.iter ~f:process_line lines)
(Utils.read_file deps_file);
create_multilinks ();
L.stdout "Captured results merged.@.";
diff --git a/infer/src/backend/paths.ml b/infer/src/backend/paths.ml
index 392454d87..55ad32b16 100644
--- a/infer/src/backend/paths.ml
+++ b/infer/src/backend/paths.ml
@@ -324,8 +324,8 @@ end = struct
| [] -> [] in
remove_until_seen inverse_sequence
else IList.rev inverse_sequence in
- IList.iter
- (fun (level, p, session, exn_opt) -> f level p session exn_opt)
+ List.iter
+ ~f:(fun (level, p, session, exn_opt) -> f level p session exn_opt)
sequence_up_to_last_seen
(** return the node visited most, and number of visits, in the shortest linear sequence *)
@@ -595,14 +595,16 @@ end = struct
PropMap.iter (fun p _ -> elements := p :: !elements) ps;
elements := List.filter ~f:(fun p -> not (f p)) !elements;
let filtered_map = ref ps in
- IList.iter (fun p -> filtered_map := PropMap.remove p !filtered_map) !elements;
+ List.iter ~f:(fun p -> filtered_map := PropMap.remove p !filtered_map) !elements;
!filtered_map
let partition f ps =
let elements = ref [] in
PropMap.iter (fun p _ -> elements := p :: !elements) ps;
let el1, el2 = ref ps, ref ps in
- IList.iter (fun p -> if f p then el2 := PropMap.remove p !el2 else el1 := PropMap.remove p !el1) !elements;
+ List.iter
+ ~f:(fun p -> if f p then el2 := PropMap.remove p !el2 else el1 := PropMap.remove p !el1)
+ !elements;
!el1, !el2
(** It's the caller's resposibility to ensure that Prop.prop_rename_primed_footprint_vars was called on the prop *)
diff --git a/infer/src/backend/preanal.ml b/infer/src/backend/preanal.ml
index 2dda0cabf..f530d0015 100644
--- a/infer/src/backend/preanal.ml
+++ b/infer/src/backend/preanal.ml
@@ -47,8 +47,8 @@ let add_dispatch_calls pdesc cg tenv =
(* if sound dispatch is turned off, consider only the first target. we do this
because choosing all targets is too expensive for everyday use *)
[target_pname] in
- IList.iter
- (fun target_pname -> Cg.add_edge cg caller_pname target_pname)
+ List.iter
+ ~f:(fun target_pname -> Cg.add_edge cg caller_pname target_pname)
targets_to_add;
let call_flags' = { call_flags with CallFlags.cf_targets = targets_to_add; } in
Sil.Call (ret_id, call_exp, args, loc, call_flags')
@@ -222,24 +222,24 @@ let add_nullify_instrs pdesc tenv liveness_inv_map =
let loc = Procdesc.Node.get_last_loc node in
Procdesc.Node.append_instrs node [Sil.Remove_temps (IList.rev ids, loc)] in
- IList.iter
- (fun node ->
- match NullifyAnalysis.extract_post (ProcCfg.Exceptional.id node) nullify_inv_map with
- | Some (_, to_nullify) ->
- let pvars_to_nullify, ids_to_remove =
- Var.Set.fold
- (fun var (pvars_acc, ids_acc) -> match Var.to_exp var with
- (* we nullify all address taken variables at the end of the procedure *)
- | Exp.Lvar pvar when not (AddressTaken.Domain.mem pvar address_taken_vars) ->
- pvar :: pvars_acc, ids_acc
- | Exp.Var id ->
- pvars_acc, id :: ids_acc
- | _ -> pvars_acc, ids_acc)
- to_nullify
- ([], []) in
- node_add_removetmps_instructions node ids_to_remove;
- node_add_nullify_instructions node pvars_to_nullify
- | None -> ())
+ List.iter
+ ~f:(fun node ->
+ match NullifyAnalysis.extract_post (ProcCfg.Exceptional.id node) nullify_inv_map with
+ | Some (_, to_nullify) ->
+ let pvars_to_nullify, ids_to_remove =
+ Var.Set.fold
+ (fun var (pvars_acc, ids_acc) -> match Var.to_exp var with
+ (* we nullify all address taken variables at the end of the procedure *)
+ | Exp.Lvar pvar when not (AddressTaken.Domain.mem pvar address_taken_vars) ->
+ pvar :: pvars_acc, ids_acc
+ | Exp.Var id ->
+ pvars_acc, id :: ids_acc
+ | _ -> pvars_acc, ids_acc)
+ to_nullify
+ ([], []) in
+ node_add_removetmps_instructions node ids_to_remove;
+ node_add_nullify_instructions node pvars_to_nullify
+ | None -> ())
(ProcCfg.Exceptional.nodes nullify_proc_cfg);
(* nullify all address taken variables *)
if not (AddressTaken.Domain.is_empty address_taken_vars)
@@ -290,11 +290,11 @@ let do_copy_propagation pdesc tenv =
~init:([], false)
(ExceptionalOneInstrPerNodeCfg.instr_ids node) in
- IList.iter
- (fun node ->
- let instrs, changed = rev_transform_node_instrs node in
- if changed
- then Procdesc.Node.replace_instrs node (IList.rev instrs))
+ List.iter
+ ~f:(fun node ->
+ let instrs, changed = rev_transform_node_instrs node in
+ if changed
+ then Procdesc.Node.replace_instrs node (IList.rev instrs))
(Procdesc.get_nodes pdesc)
let do_liveness pdesc tenv =
diff --git a/infer/src/backend/printer.ml b/infer/src/backend/printer.ml
index b1b798f68..bf2437e6a 100644
--- a/infer/src/backend/printer.ml
+++ b/infer/src/backend/printer.ml
@@ -126,7 +126,7 @@ end = struct
(Escape.escape_xml (Procname.to_string proc_name))
(Io_infer.Html.pp_line_link source [".."]) loc.Location.line;
F.fprintf fmt "
PREDS:@\n";
- IList.iter (fun node ->
+ List.iter ~f:(fun node ->
Io_infer.Html.pp_node_link
[".."]
(Procdesc.Node.get_proc_name node)
@@ -138,7 +138,7 @@ end = struct
~isproof:false
fmt (Procdesc.Node.get_id node :> int)) preds;
F.fprintf fmt "
SUCCS: @\n";
- IList.iter (fun node ->
+ List.iter ~f:(fun node ->
Io_infer.Html.pp_node_link
[".."]
(Procdesc.Node.get_proc_name node)
@@ -150,7 +150,7 @@ end = struct
~isproof:false
fmt (Procdesc.Node.get_id node :> int)) succs;
F.fprintf fmt "
EXN: @\n";
- IList.iter (fun node ->
+ List.iter ~f:(fun node ->
Io_infer.Html.pp_node_link
[".."]
(Procdesc.Node.get_proc_name node)
@@ -365,8 +365,8 @@ let () = L.printer_hook := force_delayed_print
let force_delayed_prints () =
Config.forcing_delayed_prints := true;
F.fprintf !curr_html_formatter "@?"; (* flush html stream *)
- IList.iter
- (force_delayed_print !curr_html_formatter)
+ List.iter
+ ~f:(force_delayed_print !curr_html_formatter)
(IList.rev (L.get_delayed_prints ()));
F.fprintf !curr_html_formatter "@?";
L.reset_delayed_prints ();
@@ -429,18 +429,18 @@ let write_proc_html source whole_seconds pdesc =
~text: (Some (Escape.escape_xml (Procname.to_string pname)))
[])
linenum;
- IList.iter
- (fun n ->
- Io_infer.Html.pp_node_link
- []
- (Procdesc.Node.get_proc_name n)
- ~description:(Procdesc.Node.get_description (Pp.html Black) n)
- ~preds:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_preds n) :> int list)
- ~succs:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_succs n) :> int list)
- ~exn:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_exn n) :> int list)
- ~isvisited:(is_visited n)
- ~isproof:false
- fmt (Procdesc.Node.get_id n :> int))
+ List.iter
+ ~f:(fun n ->
+ Io_infer.Html.pp_node_link
+ []
+ (Procdesc.Node.get_proc_name n)
+ ~description:(Procdesc.Node.get_description (Pp.html Black) n)
+ ~preds:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_preds n) :> int list)
+ ~succs:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_succs n) :> int list)
+ ~exn:(IList.map Procdesc.Node.get_id (Procdesc.Node.get_exn n) :> int list)
+ ~isvisited:(is_visited n)
+ ~isproof:false
+ fmt (Procdesc.Node.get_id n :> int))
nodes;
(match Specs.get_summary pname with
| None ->
@@ -488,14 +488,14 @@ let write_html_proc source proof_cover table_nodes_at_linenum global_err_log pro
SourceFile.equal source_captured (Procdesc.get_loc proc_desc).file in
if process_proc then
begin
- IList.iter process_node (Procdesc.get_nodes proc_desc);
+ List.iter ~f:process_node (Procdesc.get_nodes proc_desc);
match Specs.get_summary proc_name with
| None ->
()
| Some summary ->
- IList.iter
- (fun sp ->
- proof_cover := Specs.Visitedset.union sp.Specs.visited !proof_cover)
+ List.iter
+ ~f:(fun sp ->
+ proof_cover := Specs.Visitedset.union sp.Specs.visited !proof_cover)
(Specs.get_specs_from_payload summary);
Errlog.update global_err_log summary.Specs.attributes.ProcAttributes.err_log
end
@@ -535,38 +535,38 @@ let write_html_file linereader filename procs =
"