Open Core.Std by default, still use Caml Hashtbl, Map, Set

Reviewed By: cristianoc

Differential Revision: D4232458

fbshipit-source-id: 3d73c69
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent e438314776
commit 2e66dcfac4

@ -8,6 +8,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
let module F = Format; let module F = Format;
let module L = Logging; let module L = Logging;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** List of all builtins that are interpreted specially by the backend *) (** List of all builtins that are interpreted specially by the backend *)
module type S = sig module type S = sig
type t type t

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type t = Procname.t type t = Procname.t
let builtin_decls = ref Procname.Set.empty let builtin_decls = ref Procname.Set.empty

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
type t = type t =

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
type t [@@deriving compare] type t [@@deriving compare]

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** Module for call graphs */ /** Module for call graphs */
let module L = Logging; let module L = Logging;

@ -8,6 +8,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
module L = Logging module L = Logging
module F = Format module F = Format
@ -37,7 +38,7 @@ let compare_err_data
Location.compare loc1 loc2 Location.compare loc1 loc2
module ErrDataSet = (* set err_data with no repeated loc *) module ErrDataSet = (* set err_data with no repeated loc *)
Set.Make(struct Caml.Set.Make(struct
type t = err_data type t = err_data
let compare = compare_err_data let compare = compare_err_data
end) end)
@ -251,7 +252,7 @@ module Err_table = struct
String.Map.iteri ~f:pp !err_name_map String.Map.iteri ~f:pp !err_name_map
module LocMap = module LocMap =
Map.Make(struct Caml.Map.Make(struct
type t = ErrDataSet.elt type t = ErrDataSet.elt
let compare = compare_err_data let compare = compare_err_data
end) end)

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** The Smallfoot Intermediate Language: Expressions */ /** The Smallfoot Intermediate Language: Expressions */
let module L = Logging; let module L = Logging;
@ -59,12 +61,12 @@ let equal e1 e2 => compare e1 e2 == 0;
let hash = Hashtbl.hash; let hash = Hashtbl.hash;
let module Set = Set.Make { let module Set = Caml.Set.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };
let module Map = Map.Make { let module Map = Caml.Map.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };

@ -61,15 +61,15 @@ let hash: t => int;
/** Set of expressions. */ /** Set of expressions. */
let module Set: Set.S with type elt = t; let module Set: Caml.Set.S with type elt = t;
/** Map with expression keys. */ /** Map with expression keys. */
let module Map: Map.S with type key = t; let module Map: Caml.Map.S with type key = t;
/** Hashtable with expression keys. */ /** Hashtable with expression keys. */
let module Hash: Hashtbl.S with type key = t; let module Hash: Caml.Hashtbl.S with type key = t;
/** returns true is index is an array index of arr. */ /** returns true is index is an array index of arr. */

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** Module for Names and Identifiers */ /** Module for Names and Identifiers */
let module L = Logging; let module L = Logging;
@ -80,12 +82,12 @@ let equal i1 i2 => i1.stamp === i2.stamp && i1.kind === i2.kind && equal_name i1
/** {2 Set for identifiers} */ /** {2 Set for identifiers} */
let module IdentSet = Set.Make { let module IdentSet = Caml.Set.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };
let module IdentMap = Map.Make { let module IdentMap = Caml.Map.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };
@ -96,11 +98,11 @@ let module IdentHash = Hashtbl.Make {
let hash (id: t) => Hashtbl.hash id; let hash (id: t) => Hashtbl.hash id;
}; };
let module FieldSet = Set.Make { let module FieldSet = Caml.Set.Make {
type t = fieldname [@@deriving compare]; type t = fieldname [@@deriving compare];
}; };
let module FieldMap = Map.Make { let module FieldMap = Caml.Map.Make {
type t = fieldname [@@deriving compare]; type t = fieldname [@@deriving compare];
}; };

@ -48,23 +48,23 @@ let equal_kind: kind => kind => bool;
/** Set for identifiers. */ /** Set for identifiers. */
let module IdentSet: Set.S with type elt = t; let module IdentSet: Caml.Set.S with type elt = t;
/** Hash table with ident as key. */ /** Hash table with ident as key. */
let module IdentHash: Hashtbl.S with type key = t; let module IdentHash: Caml.Hashtbl.S with type key = t;
/** Map with ident as key. */ /** Map with ident as key. */
let module IdentMap: Map.S with type key = t; let module IdentMap: Caml.Map.S with type key = t;
/** Set for fieldnames */ /** Set for fieldnames */
let module FieldSet: Set.S with type elt = fieldname; let module FieldSet: Caml.Set.S with type elt = fieldname;
/** Map for fieldnames */ /** Map for fieldnames */
let module FieldMap: Map.S with type key = fieldname; let module FieldMap: Caml.Map.S with type key = fieldname;
let module NameGenerator: { let module NameGenerator: {
type t; type t;
@ -91,7 +91,7 @@ let kfootprint: kind;
/** hash table with names as keys */ /** hash table with names as keys */
let module NameHash: Hashtbl.S with type key = name; let module NameHash: Caml.Hashtbl.S with type key = name;
/** Name used for primed tmp variables */ /** Name used for primed tmp variables */

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Module to store a set of issues per procedure *) (** Module to store a set of issues per procedure *)
val errLogMap : Errlog.t Procname.Map.t ref val errLogMap : Errlog.t Procname.Map.t ref

@ -64,7 +64,7 @@ let from_package_class package_name class_name =>
/** Pretty print a mangled name */ /** Pretty print a mangled name */
let pp f pn => F.fprintf f "%s" (to_string pn); let pp f pn => F.fprintf f "%s" (to_string pn);
let module MangledSet = Set.Make { let module MangledSet = Caml.Set.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };

@ -52,4 +52,4 @@ let pp: Format.formatter => t => unit;
/** Set of Mangled. */ /** Set of Mangled. */
let module MangledSet: Set.S with type elt = t; let module MangledSet: Caml.Set.S with type elt = t;

@ -8,6 +8,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** Attributes of a procedure. */ /** Attributes of a procedure. */
let module L = Logging; let module L = Logging;

@ -12,7 +12,7 @@ open! IStd;
/** Attributes of a procedure. */ /** Attributes of a procedure. */
/** flags for a procedure */ /** flags for a procedure */
type proc_flags = Hashtbl.t string string [@@deriving compare]; type proc_flags = Caml.Hashtbl.t string string [@@deriving compare];
/** keys for proc_flags */ /** keys for proc_flags */

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
let module L = Logging; let module L = Logging;
let module F = Format; let module F = Format;
@ -74,11 +76,11 @@ let module Node = {
let compare_id = Int.compare; let compare_id = Int.compare;
let get_succs node => node.succs; let get_succs node => node.succs;
type node = t; type node = t;
let module NodeSet = Set.Make { let module NodeSet = Caml.Set.Make {
type t = node; type t = node;
let compare = compare; let compare = compare;
}; };
let module IdMap = Map.Make { let module IdMap = Caml.Map.Make {
type t = id; type t = id;
let compare = compare_id; let compare = compare_id;
}; };
@ -275,7 +277,7 @@ let module Node = {
/* =============== END of module Node =============== */ /* =============== END of module Node =============== */
/** Map over nodes */ /** Map over nodes */
let module NodeMap = Map.Make Node; let module NodeMap = Caml.Map.Make Node;
/** Hash table with nodes as keys. */ /** Hash table with nodes as keys. */

@ -121,19 +121,19 @@ let module Node: {
/** Map with node id keys. */ /** Map with node id keys. */
let module IdMap: Map.S with type key = Node.id; let module IdMap: Caml.Map.S with type key = Node.id;
/** Hash table with nodes as keys. */ /** Hash table with nodes as keys. */
let module NodeHash: Hashtbl.S with type key = Node.t; let module NodeHash: Caml.Hashtbl.S with type key = Node.t;
/** Map over nodes. */ /** Map over nodes. */
let module NodeMap: Map.S with type key = Node.t; let module NodeMap: Caml.Map.S with type key = Node.t;
/** Set of nodes. */ /** Set of nodes. */
let module NodeSet: Set.S with type elt = Node.t; let module NodeSet: Caml.Set.S with type elt = Node.t;
/** procedure descriptions */ /** procedure descriptions */

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** Module for Procedure Names */ /** Module for Procedure Names */
let module L = Logging; let module L = Logging;
@ -557,12 +559,12 @@ let module Hash = Hashtbl.Make {
let hash = hash_pname; let hash = hash_pname;
}; };
let module Map = Map.Make { let module Map = Caml.Map.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };
let module Set = Set.Make { let module Set = Caml.Set.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };

@ -59,15 +59,15 @@ type objc_cpp_method_kind =
/** Hash tables with proc names as keys. */ /** Hash tables with proc names as keys. */
let module Hash: Hashtbl.S with type key = t; let module Hash: Caml.Hashtbl.S with type key = t;
/** Maps from proc names. */ /** Maps from proc names. */
let module Map: Map.S with type key = t; let module Map: Caml.Map.S with type key = t;
/** Sets of proc names. */ /** Sets of proc names. */
let module Set: Set.S with type elt = t; let module Set: Caml.Set.S with type elt = t;
/** Create a C procedure name from plain and mangled name. */ /** Create a C procedure name from plain and mangled name. */

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** The Smallfoot Intermediate Language */ /** The Smallfoot Intermediate Language */
let module L = Logging; let module L = Logging;
@ -299,7 +301,7 @@ let elist_to_eset es => IList.fold_left (fun set e => Exp.Set.add e set) Exp.Set
/** {2 Sets of heap predicates} */ /** {2 Sets of heap predicates} */
let module HpredSet = Set.Make { let module HpredSet = Caml.Set.Make {
type t = hpred; type t = hpred;
let compare = compare_hpred inst::false; let compare = compare_hpred inst::false;
}; };

@ -268,7 +268,7 @@ let equal_hpred: inst::bool? => hpred => hpred => bool;
/** Sets of heap predicates */ /** Sets of heap predicates */
let module HpredSet: Set.S with type elt = hpred; let module HpredSet: Caml.Set.S with type elt = hpred;
/** {2 Compaction} */ /** {2 Compaction} */

@ -58,7 +58,7 @@ let module SubtypesPair = {
type t = (Typename.t, Typename.t) [@@deriving compare]; type t = (Typename.t, Typename.t) [@@deriving compare];
}; };
let module SubtypesMap = Map.Make SubtypesPair; let module SubtypesMap = Caml.Map.Make SubtypesPair;
type subtMap = SubtypesMap.t bool; type subtMap = SubtypesMap.t bool;

@ -8,6 +8,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** Module for Type Environments. */ /** Module for Type Environments. */

@ -12,6 +12,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** The Smallfoot Intermediate Language: Types */ /** The Smallfoot Intermediate Language: Types */
let module L = Logging; let module L = Logging;
@ -190,12 +192,12 @@ let d_list (tl: list t) => L.add_print_action (L.PTtyp_list, Obj.repr tl);
/** {2 Sets and maps of types} */ /** {2 Sets and maps of types} */
let module Set = Set.Make { let module Set = Caml.Set.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };
let module Map = Map.Make { let module Map = Caml.Map.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };

@ -110,13 +110,13 @@ let d_list: list t => unit;
/** Sets of types. */ /** Sets of types. */
let module Set: Set.S with type elt = t; let module Set: Caml.Set.S with type elt = t;
/** Maps with type keys. */ /** Maps with type keys. */
let module Map: Map.S with type key = t; let module Map: Caml.Map.S with type key = t;
let module Tbl: Hashtbl.S with type key = t; let module Tbl: Caml.Hashtbl.S with type key = t;
/** The name of a type */ /** The name of a type */

@ -40,7 +40,7 @@ let module Java = {
let java_lang_cloneable = from_string "java.lang.Cloneable"; let java_lang_cloneable = from_string "java.lang.Cloneable";
}; };
let module Set = Set.Make { let module Set = Caml.Set.Make {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
}; };

@ -40,4 +40,4 @@ let module Java: {
let java_lang_cloneable: t; let java_lang_cloneable: t;
}; };
let module Set: Set.S with type elt = t; let module Set: Caml.Set.S with type elt = t;

@ -33,7 +33,7 @@ OCAMLBUILD_OPTIONS = \
-cflags -principal \ -cflags -principal \
-cflags -strict-formats \ -cflags -strict-formats \
-cflags -strict-sequence \ -cflags -strict-sequence \
-cflags -w,$(OCAML_FATAL_WARNINGS)-4-9-32-40-41-42-45-48 \ -cflags -w,$(OCAML_FATAL_WARNINGS)-3-4-9-32-40-41-42-45-48 \
-tag-line "<*{clang/clang_ast_*,backend/jsonbug_*,checkers/stacktree_*}>: warn(-27-32-35-39)" \ -tag-line "<*{clang/clang_ast_*,backend/jsonbug_*,checkers/stacktree_*}>: warn(-27-32-35-39)" \
-tag-line "<*/{,*/}*.{ml,re}{,i}>: package(ppx_compare)" \ -tag-line "<*/{,*/}*.{ml,re}{,i}>: package(ppx_compare)" \
-tag thread \ -tag thread \

@ -9,6 +9,8 @@
*/ */
open! IStd; open! IStd;
let module Hashtbl = Caml.Hashtbl;
let module L = Logging; let module L = Logging;
let module F = Format; let module F = Format;

@ -831,10 +831,10 @@ let abstract_gc tenv p =
| None -> prop | None -> prop
| Some iter -> Prop.prop_iter_to_prop tenv (Prop.prop_iter_gc_fields iter) | Some iter -> Prop.prop_iter_to_prop tenv (Prop.prop_iter_gc_fields iter)
module IdMap = Map.Make (Ident) (** maps from identifiers *) module IdMap = Caml.Map.Make (Ident) (** maps from identifiers *)
module HpredSet = module HpredSet =
Set.Make(struct Caml.Set.Make(struct
type t = Sil.hpred type t = Sil.hpred
let compare = Sil.compare_hpred ~inst:false let compare = Sil.compare_hpred ~inst:false
end) end)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** (**
CRASHCONTEXT Intro [experimental]: CRASHCONTEXT Intro [experimental]:

@ -9,6 +9,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Operators for the abstract domain. In particular, join and meet. *) (** Operators for the abstract domain. In particular, join and meet. *)
@ -65,7 +66,7 @@ let do_side side f e1 e2 =
(** {2 Sets for expression pairs} *) (** {2 Sets for expression pairs} *)
module EPset = Set.Make module EPset = Caml.Set.Make
(struct (struct
type t = Exp.t * Exp.t [@@deriving compare] type t = Exp.t * Exp.t [@@deriving compare]
end) end)

@ -9,6 +9,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Support for Execution environments *) (** Support for Execution environments *)

@ -125,7 +125,6 @@ let touch_start_file () =
let run_command ~prog ~args after_wait = let run_command ~prog ~args after_wait =
let open! Core.Std in
let status = Unix.waitpid (Unix.fork_exec ~prog ~args:(prog :: args) ()) in let status = Unix.waitpid (Unix.fork_exec ~prog ~args:(prog :: args) ()) in
after_wait status ; after_wait status ;
match status with match status with
@ -251,7 +250,6 @@ let execute_analyze () =
run_parallel_analysis () run_parallel_analysis ()
let report () = let report () =
let open! Core.Std in
let report_csv = Some (Config.results_dir ^/ "report.csv") in let report_csv = Some (Config.results_dir ^/ "report.csv") in
let report_json = Some (Config.results_dir ^/ "report.json") in let report_json = Some (Config.results_dir ^/ "report.json") in
InferPrint.main ~report_csv ~report_json ; InferPrint.main ~report_csv ~report_json ;

@ -9,6 +9,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Interprocedural Analysis *) (** Interprocedural Analysis *)
@ -24,7 +25,7 @@ type visitednode =
(** Set of nodes with number of visits *) (** Set of nodes with number of visits *)
module NodeVisitSet = module NodeVisitSet =
Set.Make(struct Caml.Set.Make(struct
type t = visitednode type t = visitednode
let compare_ids n1 n2 = let compare_ids n1 n2 =
(* higher id is better *) (* higher id is better *)
@ -708,7 +709,7 @@ let collect_analysis_result tenv wl pdesc : Paths.PathSet.t =
let pathset = htable_retrieve wl.Worklist.path_set_visited exit_node_id in let pathset = htable_retrieve wl.Worklist.path_set_visited exit_node_id in
Paths.PathSet.map (remove_locals_formals_and_check tenv pdesc) pathset Paths.PathSet.map (remove_locals_formals_and_check tenv pdesc) pathset
module Pmap = Map.Make module Pmap = Caml.Map.Make
(struct (struct
type t = Prop.normal Prop.t type t = Prop.normal Prop.t
let compare = Prop.compare_prop let compare = Prop.compare_prop
@ -1215,7 +1216,7 @@ let report_custom_errors tenv summary =
Reporting.log_error pname exn in Reporting.log_error pname exn in
IList.iter report error_preconditions IList.iter report error_preconditions
module SpecMap = Map.Make (struct module SpecMap = Caml.Map.Make (struct
type t = Prop.normal Specs.Jprop.t type t = Prop.normal Specs.Jprop.t
let compare = Specs.Jprop.compare let compare = Specs.Jprop.compare
end) end)

@ -367,7 +367,7 @@ end = struct
let d_stats path = let d_stats path =
L.d_str (stats_string path) L.d_str (stats_string path)
module PathMap = Map.Make (struct module PathMap = Caml.Map.Make (struct
type nonrec t = t type nonrec t = t
let compare = compare let compare = compare
end) end)
@ -503,7 +503,7 @@ end = struct
end end
(* =============== END of the Path module ===============*) (* =============== END of the Path module ===============*)
module PropMap = Map.Make (struct module PropMap = Caml.Map.Make (struct
type t = Prop.normal Prop.t type t = Prop.normal Prop.t
let compare = Prop.compare_prop let compare = Prop.compare_prop
end) end)

@ -9,6 +9,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Printers for the analysis results *) (** Printers for the analysis results *)

@ -18,7 +18,7 @@ module F = Format
(** {2 Sets of Propositions} *) (** {2 Sets of Propositions} *)
module PropSet = module PropSet =
Set.Make(struct Caml.Set.Make(struct
type t = Prop.normal Prop.t type t = Prop.normal Prop.t
let compare = Prop.compare_prop let compare = Prop.compare_prop
end) end)

@ -9,6 +9,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Specifications and spec table *) (** Specifications and spec table *)
@ -137,7 +138,7 @@ end
(***** End of module Jprop *****) (***** End of module Jprop *****)
module Visitedset = module Visitedset =
Set.Make (struct Caml.Set.Make (struct
type t = Procdesc.Node.id * int list type t = Procdesc.Node.id * int list
let compare (node_id1, _) (node_id2, _) = Procdesc.Node.compare_id node_id1 node_id2 let compare (node_id1, _) (node_id2, _) = Procdesc.Node.compare_id node_id1 node_id2
end) end)

@ -61,7 +61,7 @@ module Jprop : sig
end end
(** set of visited nodes: node id and list of lines of all the instructions *) (** set of visited nodes: node id and list of lines of all the instructions *)
module Visitedset : Set.S with type elt = Procdesc.Node.id * int list module Visitedset : Caml.Set.S with type elt = Procdesc.Node.id * int list
(** convert a Visitedset to a string *) (** convert a Visitedset to a string *)
val visited_str : Visitedset.t -> string val visited_str : Visitedset.t -> string

@ -163,12 +163,12 @@ let instrs_normalize instrs =
and normalized (w.r.t. renaming of let - bound ids) list of instructions. *) and normalized (w.r.t. renaming of let - bound ids) list of instructions. *)
let mk_find_duplicate_nodes proc_desc : (Procdesc.Node.t -> Procdesc.NodeSet.t) = let mk_find_duplicate_nodes proc_desc : (Procdesc.Node.t -> Procdesc.NodeSet.t) =
let module M = (* map from (loc,kind) *) let module M = (* map from (loc,kind) *)
Map.Make(struct Caml.Map.Make(struct
type t = Location.t * Procdesc.Node.nodekind [@@deriving compare] type t = Location.t * Procdesc.Node.nodekind [@@deriving compare]
end) in end) in
let module S = (* set of nodes with normalized insructions *) let module S = (* set of nodes with normalized insructions *)
Set.Make(struct Caml.Set.Make(struct
type t = Procdesc.Node.t * Sil.instr list type t = Procdesc.Node.t * Sil.instr list
let compare (n1, _) (n2, _) = let compare (n1, _) (n2, _) =
Procdesc.Node.compare n1 n2 Procdesc.Node.compare n1 n2

@ -71,12 +71,12 @@ let file_exists path = Sys.file_exists path = `Yes
let file_remove = Sys.remove let file_remove = Sys.remove
module FilenameSet = Set.Make( module FilenameSet = Caml.Set.Make(
struct struct
type t = filename [@@deriving compare] type t = filename [@@deriving compare]
end) end)
module FilenameMap = Map.Make( module FilenameMap = Caml.Map.Make(
struct struct
type t = filename [@@deriving compare] type t = filename [@@deriving compare]
end) end)

@ -17,8 +17,8 @@ open! IStd
(** generic file name *) (** generic file name *)
type filename [@@deriving compare] type filename [@@deriving compare]
module FilenameSet : Set.S with type elt = filename module FilenameSet : Caml.Set.S with type elt = filename
module FilenameMap : Map.S with type key = filename module FilenameMap : Caml.Map.S with type key = filename
val filename_from_string : string -> filename val filename_from_string : string -> filename
val filename_to_string : filename -> string val filename_to_string : filename -> string

@ -7,32 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
module Arg = Core.Std.Arg
module Array = Core.Std.Array
module Bool = Core.Std.Bool
module Bytes = Core.Std.Bytes
module Caml = Core.Std.Caml
module Char = Core.Std.Char
module Exn = Core.Std.Exn
module Filename = Core.Std.Filename
module Fn = Core.Std.Fn
module Gc = Core.Std.Gc
module In_channel = Core.Std.In_channel
module Int = Core.Std.Int
module Int32 = Core.Std.Int32
module Int63 = Core.Std.Int63
module Int64 = Core.Std.Int64
module Lazy = Core.Std.Lazy
module Nativeint = Core.Std.Nativeint
module Option = Core.Std.Option
module Pid = Core.Std.Pid
module Printexc = Core.Std.Printexc
module Printf = Core.Std.Printf
module Queue = Core.Std.Queue
module Random = Core.Std.Random
module Signal = Core.Std.Signal
module Stack = Core.Std.Stack
module String = Core.Std.String
module Sys = struct module Sys = struct
include Core.Std.Sys include Core.Std.Sys
@ -50,28 +24,20 @@ module Sys = struct
try is_file ?follow_symlinks path try is_file ?follow_symlinks path
with Unix.Unix_error _ -> `Unknown with Unix.Unix_error _ -> `Unknown
end end
module Unix = Core.Std.Unix
module IntSet = Caml.Set.Make(Int)
include (Core.Std : module type of Core.Std with module Sys := Sys)
(** List police: don't use the list module to avoid non-tail recursive let ( @ ) = Caml.List.append
functions and builtin equality. Use IList instead. *)
module List = struct end
(** Compare police: generic compare disabled. *)
let compare = ()
(* Use Caml.Set since they are serialized using Marshal, and Core.Std.Set includes the comparison
function in its representation, which Marshal cannot (de)serialize. *)
module IntSet = Caml.Set.Make(Int)
(** {2 Generic Utility Functions} *)
type ('a, 'b) result = (** Compare police: generic compare mostly disabled. *)
| Ok of 'a let compare = No_polymorphic_compare.compare
| Error of 'b let equal = No_polymorphic_compare.equal
let fst3 (x,_,_) = x
let snd3 (_,x,_) = x
let trd3 (_,_,x) = x
let failwithf fmt = let failwithf fmt =
Format.kfprintf (fun _ -> failwith (Format.flush_str_formatter ())) Format.kfprintf (fun _ -> failwith (Format.flush_str_formatter ()))

@ -7,31 +7,33 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
(** Wrappers for making pretty-printable modules *) (** Wrappers for making pretty-printable modules *)
module type SetOrderedType = sig module type SetOrderedType = sig
include Set.OrderedType include Caml.Set.OrderedType
val pp_element : F.formatter -> t -> unit val pp_element : F.formatter -> t -> unit
end end
module type MapOrderedType = sig module type MapOrderedType = sig
include Map.OrderedType include Caml.Map.OrderedType
val pp_key : F.formatter -> t -> unit val pp_key : F.formatter -> t -> unit
end end
module type PPSet = sig module type PPSet = sig
include Set.S include Caml.Set.S
val pp_element : F.formatter -> elt -> unit val pp_element : F.formatter -> elt -> unit
val pp : F.formatter -> t -> unit val pp : F.formatter -> t -> unit
end end
module type PPMap = sig module type PPMap = sig
include Map.S include Caml.Map.S
val pp_key : F.formatter -> key -> unit val pp_key : F.formatter -> key -> unit
val pp : pp_value:(F.formatter -> 'a -> unit) -> F.formatter -> 'a t -> unit val pp : pp_value:(F.formatter -> 'a -> unit) -> F.formatter -> 'a t -> unit
@ -44,7 +46,7 @@ let pp_collection ~pp_item fmt c =
F.fprintf fmt "{ %a }" pp_collection c F.fprintf fmt "{ %a }" pp_collection c
module MakePPSet (Ord : SetOrderedType) = struct module MakePPSet (Ord : SetOrderedType) = struct
include Set.Make(Ord) include Caml.Set.Make(Ord)
let pp_element = Ord.pp_element let pp_element = Ord.pp_element
@ -54,7 +56,7 @@ end
module MakePPCompareSet module MakePPCompareSet
(Ord : sig include SetOrderedType val compare_pp : t -> t -> int end) = struct (Ord : sig include SetOrderedType val compare_pp : t -> t -> int end) = struct
include Set.Make(Ord) include Caml.Set.Make(Ord)
let pp_element = Ord.pp_element let pp_element = Ord.pp_element
@ -64,7 +66,7 @@ module MakePPCompareSet
end end
module MakePPMap (Ord : MapOrderedType) = struct module MakePPMap (Ord : MapOrderedType) = struct
include Map.Make(Ord) include Caml.Map.Make(Ord)
let pp_key = Ord.pp_key let pp_key = Ord.pp_key

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
(** Wrappers for making pretty-printable modules *) (** Wrappers for making pretty-printable modules *)
@ -26,27 +28,25 @@ module type MapOrderedType = sig
end end
module type PPSet = sig module type PPSet = sig
include Set.S include Caml.Set.S
val pp_element : F.formatter -> elt -> unit val pp_element : F.formatter -> elt -> unit
val pp : F.formatter -> t -> unit val pp : F.formatter -> t -> unit
end end
module type PPMap = sig module type PPMap = sig
include Map.S include Caml.Map.S
val pp_key : F.formatter -> key -> unit val pp_key : F.formatter -> key -> unit
val pp : pp_value:(F.formatter -> 'a -> unit) -> F.formatter -> 'a t -> unit val pp : pp_value:(F.formatter -> 'a -> unit) -> F.formatter -> 'a t -> unit
end end
module MakePPSet : functor (Ord : SetOrderedType) -> sig module MakePPSet (Ord : SetOrderedType) : (PPSet with type elt = Ord.t)
include PPSet with type elt = Ord.t
end
(** Use a comparison function to determine the order of the elements printed *) (** Use a comparison function to determine the order of the elements printed *)
module MakePPCompareSet : module MakePPCompareSet
functor (Ord : sig include SetOrderedType val compare_pp : t -> t -> int end) -> sig (Ord : sig
include PPSet with type elt = Ord.t include SetOrderedType
end val compare_pp : t -> t -> int
end)
module MakePPMap : functor (Ord : MapOrderedType) -> sig : (PPSet with type elt = Ord.t)
include PPMap with type key = Ord.t
end module MakePPMap (Ord : MapOrderedType) : (PPMap with type key = Ord.t)

@ -26,7 +26,6 @@ let print_error_and_exit ?(exit_code=1) fmt =
terminate. The standard out and error are not redirected. If the command fails to execute, terminate. The standard out and error are not redirected. If the command fails to execute,
print an error message and exit. *) print an error message and exit. *)
let create_process_and_wait ~prog ~args = let create_process_and_wait ~prog ~args =
let open! Core.Std in
Unix.fork_exec ~prog ~args:(prog :: args) () Unix.fork_exec ~prog ~args:(prog :: args) ()
|> Unix.waitpid |> Unix.waitpid
|> function |> function
@ -49,7 +48,7 @@ let start_current_jobs_count () = ref 0
let waited_for_jobs = ref 0 let waited_for_jobs = ref 0
module PidMap = Map.Make (Pid) module PidMap = Caml.Map.Make (Pid)
(** [wait_for_son pid_child f jobs_count] wait for pid_child (** [wait_for_son pid_child f jobs_count] wait for pid_child
and all the other children and update the current jobs count. and all the other children and update the current jobs count.
@ -74,7 +73,6 @@ let pid_to_program jobsMap pid =
env)] where [dir_opt] is an optional directory to chdir to before executing [command] with env)] where [dir_opt] is an optional directory to chdir to before executing [command] with
[args] in [env]. [prog_to_string] is used for printing information about the job's status. *) [args] in [env]. [prog_to_string] is used for printing information about the job's status. *)
let run_jobs_in_parallel jobs_stack gen_prog prog_to_string = let run_jobs_in_parallel jobs_stack gen_prog prog_to_string =
let open! Core.Std in
let run_job () = let run_job () =
let jobs_map = ref PidMap.empty in let jobs_map = ref PidMap.empty in
let current_jobs_count = start_current_jobs_count () in let current_jobs_count = start_current_jobs_count () in
@ -98,7 +96,6 @@ let run_jobs_in_parallel jobs_stack gen_prog prog_to_string =
L.out "Waited for %d jobs" !waited_for_jobs L.out "Waited for %d jobs" !waited_for_jobs
let pipeline ~producer_prog ~producer_args ~consumer_prog ~consumer_args = let pipeline ~producer_prog ~producer_args ~consumer_prog ~consumer_args =
let open! Core.Std in
let pipe_in, pipe_out = Unix.pipe () in let pipe_in, pipe_out = Unix.pipe () in
match Unix.fork () with match Unix.fork () with
| `In_the_child -> | `In_the_child ->

@ -10,7 +10,6 @@
open! IStd open! IStd
let count_newlines (path: string): int = let count_newlines (path: string): int =
let open! Core.Std in
let f file = In_channel.fold_lines file ~init:0 ~f:(fun i _ -> i + 1) in let f file = In_channel.fold_lines file ~init:0 ~f:(fun i _ -> i + 1) in
In_channel.with_file path ~f In_channel.with_file path ~f
@ -30,9 +29,9 @@ struct
type t = _t [@@deriving compare] type t = _t [@@deriving compare]
end end
module Map = Map.Make(OrderedSourceFile) module Map = Caml.Map.Make (OrderedSourceFile)
module Set = Set.Make(OrderedSourceFile) module Set = Caml.Set.Make (OrderedSourceFile)
let rel_path_from_abs_path root fname = let rel_path_from_abs_path root fname =
let relative_complemented_fname = Utils.filename_to_relative root fname in let relative_complemented_fname = Utils.filename_to_relative root fname in

@ -10,6 +10,7 @@
open! IStd open! IStd
module F = Format module F = Format
module Hashtbl = Caml.Hashtbl
(** initial process times *) (** initial process times *)
let initial_times = Unix.times () let initial_times = Unix.times ()

@ -59,7 +59,7 @@ val directory_iter : (string -> unit) -> string -> unit
(** Remove a directory and its contents *) (** Remove a directory and its contents *)
val remove_directory_tree : string -> unit val remove_directory_tree : string -> unit
val read_optional_json_file : string -> (Yojson.Basic.json, string) result val read_optional_json_file : string -> (Yojson.Basic.json, string) Result.t
val with_file : string -> f:(out_channel -> 'a) -> 'a val with_file : string -> f:(out_channel -> 'a) -> 'a

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** [load serializer path] searches for the file at the given path in the zip libraries. (** [load serializer path] searches for the file at the given path in the zip libraries.
If Config.infer_cache is set, already deserialized data will be saved there and [path] If Config.infer_cache is set, already deserialized data will be saved there and [path]
will be searched from the cache first. *) will be searched from the cache first. *)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type 'a state = { pre: 'a; post: 'a; visit_count: int; } type 'a state = { pre: 'a; post: 'a; visit_count: int; }
(** type of an intraprocedural abstract interpreter *) (** type of an intraprocedural abstract interpreter *)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
type t [@@deriving compare] type t [@@deriving compare]

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module type Spec = module type Spec =
sig sig
type astate type astate

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type 'a parameter = type 'a parameter =
{ sink : 'a; { sink : 'a;
(** sink type of the parameter *) (** sink type of the parameter *)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type 'a parameter = type 'a parameter =
{ sink : 'a; { sink : 'a;
(** sink type of the parameter *) (** sink type of the parameter *)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Suffix of a normal trace: just sinks and passthroughs, but no sources *) (** Suffix of a normal trace: just sinks and passthroughs, but no sources *)
module type S = sig module type S = sig
include Trace.S include Trace.S

@ -7,4 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
val checker: Callbacks.proc_callback_args -> unit val checker: Callbacks.proc_callback_args -> unit

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(* The domain for the analysis is sets of global variables if an initialization is needed at (* The domain for the analysis is sets of global variables if an initialization is needed at
runtime, or Bottom if no initialization is needed. For instance, `int x = 32; int y = x * 52;` runtime, or Bottom if no initialization is needed. For instance, `int x = 32; int y = x * 52;`
gives a summary of Bottom for both initializers corresponding to these globals, but `int x = gives a summary of Bottom for both initializers corresponding to these globals, but `int x =

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module type S = sig module type S = sig
include TraceElem.S include TraceElem.S

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module type S = sig module type S = sig
include TraceElem.S include TraceElem.S

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Module for parsing stack traces and using them to guide Infer analysis *) (** Module for parsing stack traces and using them to guide Infer analysis *)
type frame = { type frame = {

@ -170,7 +170,7 @@ let method_analysis callback =
(* a results table is a Map where a key is an a procedure environment, (* a results table is a Map where a key is an a procedure environment,
i.e., something of type Idenv.t * Tenv.t * Procname.t * Procdesc.t i.e., something of type Idenv.t * Tenv.t * Procname.t * Procdesc.t
*) *)
module ResultsTableType = Map.Make (struct module ResultsTableType = Caml.Map.Make (struct
type t = Idenv.t * Tenv.t * Procname.t * Procdesc.t type t = Idenv.t * Tenv.t * Procname.t * Procdesc.t
let compare (_, _, pn1, _) (_,_,pn2,_) = Procname.compare pn1 pn2 let compare (_, _, pn1, _) (_,_,pn2,_) = Procname.compare pn1 pn2
end) end)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module F = Format module F = Format

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
module type Kind = sig module type Kind = sig

@ -15,7 +15,7 @@ type 'a state = { pre: 'a; post: 'a; visit_count: int; }
module type S = sig module type S = sig
module TransferFunctions : TransferFunctions.S module TransferFunctions : TransferFunctions.S
module InvariantMap : Map.S with type key = TransferFunctions.CFG.id module InvariantMap : Caml.Map.S with type key = TransferFunctions.CFG.id
module Interprocedural module Interprocedural
(Summary : Summary.S with type summary = TransferFunctions.Domain.astate) : (Summary : Summary.S with type summary = TransferFunctions.Domain.astate) :
sig sig

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Module for naming heap locations via the path used to access them (e.g., x.f.g, y[a].b) *) (** Module for naming heap locations via the path used to access them (e.g., x.f.g, y[a].b) *)
type base = Var.t * Typ.t [@@deriving compare] type base = Var.t * Typ.t [@@deriving compare]

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
module F = Format module F = Format
module Set = struct module Set = struct

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Generic abstract domains backed by access paths *) (** Generic abstract domains backed by access paths *)
(** add-only set of access paths. To make common operations efficient (namely, add, join, and (** add-only set of access paths. To make common operations efficient (namely, add, join, and

@ -94,7 +94,7 @@ module Elem = struct
end end
module ElemSet = Set.Make(Elem) module ElemSet = Caml.Set.Make(Elem)
module State = struct module State = struct

@ -228,12 +228,12 @@ module OneInstrPerNode (Base : S with type node = Procdesc.Node.t
(instrs t) (instrs t)
end end
module NodeIdMap (CFG : S) = Map.Make(struct module NodeIdMap (CFG : S) = Caml.Map.Make(struct
type t = CFG.id type t = CFG.id
let compare = CFG.compare_id let compare = CFG.compare_id
end) end)
module NodeIdSet (CFG : S) = Set.Make(struct module NodeIdSet (CFG : S) = Caml.Set.Make(struct
type t = CFG.id type t = CFG.id
let compare = CFG.compare_id let compare = CFG.compare_id
end) end)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Control-flow graph for a single procedure (as opposed to cfg.ml, which represents a cfg for a (** Control-flow graph for a single procedure (as opposed to cfg.ml, which represents a cfg for a
file). Defines useful wrappers that allows us to do tricks like turn a forward cfg to into a file). Defines useful wrappers that allows us to do tricks like turn a forward cfg to into a
backward one, or view a cfg as having a single instruction per block *) backward one, or view a cfg as having a single instruction per block *)
@ -91,6 +93,6 @@ module OneInstrPerNode (Base : S with type node = DefaultNode.t and type id = De
and type node = Base.node and type node = Base.node
and type id = Base.id * index and type id = Base.id * index
module NodeIdMap (CFG : S) : Map.S with type key = CFG.id module NodeIdMap (CFG : S) : Caml.Map.S with type key = CFG.id
module NodeIdSet (CFG : S) : Set.S with type elt = CFG.id module NodeIdSet (CFG : S) : Caml.Set.S with type elt = CFG.id

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type 'a t = { pdesc : Procdesc.t; tenv : Tenv.t; extras : 'a; } type 'a t = { pdesc : Procdesc.t; tenv : Tenv.t; extras : 'a; }
type no_extras type no_extras

@ -19,7 +19,7 @@ let checkers_repeated_calls_name = "CHECKERS_REPEATED_CALLS"
module RepeatedCallsExtension : Eradicate.ExtensionT = module RepeatedCallsExtension : Eradicate.ExtensionT =
struct struct
module InstrSet = module InstrSet =
Set.Make(struct Caml.Set.Make(struct
type t = Sil.instr type t = Sil.instr
let compare i1 i2 = match i1, i2 with let compare i1 i2 = match i1, i2 with
| Sil.Call (_, e1, etl1, _, cf1), Sil.Call (_, e2, etl2, _, cf2) -> | Sil.Call (_, e1, etl1, _, cf1), Sil.Call (_, e2, etl2, _, cf2) ->

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Transfer functions that push abstract states across instructions. A typical client should (** Transfer functions that push abstract states across instructions. A typical client should
implement the Make signature to allow the transfer functions to be used with any kind of CFG. *) implement the Make signature to allow the transfer functions to be used with any kind of CFG. *)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Single abstraction for all the kinds of variables in SIL *) (** Single abstraction for all the kinds of variables in SIL *)
type t = private type t = private

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type context = { type context = {
translation_unit_context : CFrontend_config.translation_unit_context; translation_unit_context : CFrontend_config.translation_unit_context;
current_method : Clang_ast_t.decl option; current_method : Clang_ast_t.decl option;

@ -6,4 +6,6 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! IStd;
let capture: ClangCommand.t => unit; let capture: ClangCommand.t => unit;

@ -6,6 +6,8 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! IStd;
type t; type t;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** Returns true if the passed-in list of decls contains an (** Returns true if the passed-in list of decls contains an
ObjCImplementationDecl of a descendant of CKComponent or ObjCImplementationDecl of a descendant of CKComponent or
CKComponentController. CKComponentController.

@ -8,6 +8,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Contains current class and current method to be translated as well as local variables, *) (** Contains current class and current method to be translated as well as local variables, *)
(** and the cg, cfg, and tenv corresponding to the current file. *) (** and the cg, cfg, and tenv corresponding to the current file. *)

@ -23,7 +23,7 @@ type curr_class =
val equal_curr_class : curr_class -> curr_class -> bool val equal_curr_class : curr_class -> curr_class -> bool
type str_node_map = (string, Procdesc.Node.t) Hashtbl.t type str_node_map = (string, Procdesc.Node.t) Caml.Hashtbl.t
type t = type t =
{ {

@ -7,4 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
val do_frontend_checks : CFrontend_config.translation_unit_context -> Clang_ast_t.decl -> unit val do_frontend_checks : CFrontend_config.translation_unit_context -> Clang_ast_t.decl -> unit

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type issue = type issue =
| Assign_pointer_warning | Assign_pointer_warning
| Bad_pointer_comparison | Bad_pointer_comparison

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type issue = type issue =
| Assign_pointer_warning | Assign_pointer_warning
| Bad_pointer_comparison | Bad_pointer_comparison

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(* This module defines a language to define checkers. These checkers (* This module defines a language to define checkers. These checkers
are intepreted over the AST of the program. A checker is defined by a are intepreted over the AST of the program. A checker is defined by a
CTL formula which express a condition saying when the checker should CTL formula which express a condition saying when the checker should

@ -8,6 +8,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(** Utility methods to support the translation of clang ast constructs into sil instructions. *) (** Utility methods to support the translation of clang ast constructs into sil instructions. *)

@ -34,7 +34,7 @@ module TypePointerOrd = struct
type t = t_ptr [@@deriving compare] type t = t_ptr [@@deriving compare]
end end
module TypePointerMap = Map.Make(TypePointerOrd) module TypePointerMap = Caml.Map.Make(TypePointerOrd)
let rec type_ptr_to_string type_ptr = match type_ptr with let rec type_ptr_to_string type_ptr = match type_ptr with
| `TPtr raw -> "clang_ptr_" ^ (string_of_int raw) | `TPtr raw -> "clang_ptr_" ^ (string_of_int raw)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(* Types used by the ctl parser *) (* Types used by the ctl parser *)

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
type t = string * string list (* (name, [param1,...,paramK]) *) type t = string * string list (* (name, [param1,...,paramK]) *)
val captured_variables_cxx_ref : Clang_ast_t.decl -> Clang_ast_t.named_decl_info list val captured_variables_cxx_ref : Clang_ast_t.decl -> Clang_ast_t.named_decl_info list

@ -8,6 +8,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
(* (*
* This file is a big bunch of tables; they read better with really long lines. * This file is a big bunch of tables; they read better with really long lines.

@ -9,7 +9,7 @@
open! IStd open! IStd
type model_table_t = (string, bool * bool list) Hashtbl.t type model_table_t = (string, bool * bool list) Caml.Hashtbl.t
(** Name of this file. *) (** Name of this file. *)
val this_file : string val this_file : string
@ -18,7 +18,7 @@ val annotated_table_nullable : model_table_t
val annotated_table_present : model_table_t val annotated_table_present : model_table_t
val annotated_table_strict : model_table_t val annotated_table_strict : model_table_t
val check_not_null_table : model_table_t val check_not_null_table : model_table_t
val check_not_null_parameter_table : (string, int) Hashtbl.t val check_not_null_parameter_table : (string, int) Caml.Hashtbl.t
val check_state_table : model_table_t val check_state_table : model_table_t
val check_argument_table : model_table_t val check_argument_table : model_table_t
val containsKey_table : model_table_t val containsKey_table : model_table_t

@ -8,6 +8,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
open ModelTables open ModelTables
module L = Logging module L = Logging

@ -15,7 +15,7 @@ module P = Printf
(** Module to represent annotations on types. *) (** Module to represent annotations on types. *)
module AnnotationsMap = Map.Make ( module AnnotationsMap = Caml.Map.Make (
struct struct
open Annotations open Annotations
type t = annotation [@@deriving compare] type t = annotation [@@deriving compare]

@ -8,6 +8,7 @@
*) *)
open! IStd open! IStd
module Hashtbl = Caml.Hashtbl
module L = Logging module L = Logging
module P = Printf module P = Printf

@ -40,7 +40,7 @@ let unit_ext : unit ext = {
} }
module M = Map.Make (struct module M = Caml.Map.Make (struct
type t = Exp.t type t = Exp.t
let compare = Exp.compare end) let compare = Exp.compare end)

@ -64,7 +64,6 @@ let swap_command cmd =
Config.wrappers_dir // clang Config.wrappers_dir // clang
let run_compilation_file compilation_database file = let run_compilation_file compilation_database file =
let open! Core.Std in
try try
let compilation_data = CompilationDatabase.find compilation_database file in let compilation_data = CompilationDatabase.find compilation_database file in
let wrapper_cmd = swap_command compilation_data.command in let wrapper_cmd = swap_command compilation_data.command in

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! IStd
(** capture_files_in_database file runs the capture of the files for which (** capture_files_in_database file runs the capture of the files for which
we have compilation commands in the database. If the option changed-files-index we have compilation commands in the database. If the option changed-files-index
is passed, we only capture the files there *) is passed, we only capture the files there *)

@ -6,6 +6,8 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! IStd;
/* module for escaping clang arguments on the command line and put them into files */ /* module for escaping clang arguments on the command line and put them into files */
/** quoting style of the arguments */ /** quoting style of the arguments */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save