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;
let module Hashtbl = Caml.Hashtbl;
let module F = Format;
let module L = Logging;

@ -7,6 +7,8 @@
* 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 *)
module type S = sig
type t

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

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

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

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

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

@ -61,15 +61,15 @@ let hash: t => int;
/** 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. */
let module Map: Map.S with type key = t;
let module Map: Caml.Map.S with type key = t;
/** 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. */

@ -12,6 +12,8 @@
*/
open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** Module for Names and Identifiers */
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} */
let module IdentSet = Set.Make {
let module IdentSet = Caml.Set.Make {
type nonrec t = t;
let compare = compare;
};
let module IdentMap = Map.Make {
let module IdentMap = Caml.Map.Make {
type nonrec t = t;
let compare = compare;
};
@ -96,11 +98,11 @@ let module IdentHash = Hashtbl.Make {
let hash (id: t) => Hashtbl.hash id;
};
let module FieldSet = Set.Make {
let module FieldSet = Caml.Set.Make {
type t = fieldname [@@deriving compare];
};
let module FieldMap = Map.Make {
let module FieldMap = Caml.Map.Make {
type t = fieldname [@@deriving compare];
};

@ -48,23 +48,23 @@ let equal_kind: kind => kind => bool;
/** 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. */
let module IdentHash: Hashtbl.S with type key = t;
let module IdentHash: Caml.Hashtbl.S with type key = t;
/** 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 */
let module FieldSet: Set.S with type elt = fieldname;
let module FieldSet: Caml.Set.S with type elt = fieldname;
/** 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: {
type t;
@ -91,7 +91,7 @@ let kfootprint: kind;
/** 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 */

@ -7,6 +7,8 @@
* 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 *)
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 */
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;
let compare = compare;
};

@ -52,4 +52,4 @@ let pp: Format.formatter => t => unit;
/** 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;
let module Hashtbl = Caml.Hashtbl;
/** Attributes of a procedure. */
let module L = Logging;

@ -12,7 +12,7 @@ open! IStd;
/** Attributes of 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 */

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

@ -121,19 +121,19 @@ let module Node: {
/** 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. */
let module NodeHash: Hashtbl.S with type key = Node.t;
let module NodeHash: Caml.Hashtbl.S with type key = Node.t;
/** 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. */
let module NodeSet: Set.S with type elt = Node.t;
let module NodeSet: Caml.Set.S with type elt = Node.t;
/** procedure descriptions */

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

@ -59,15 +59,15 @@ type objc_cpp_method_kind =
/** 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. */
let module Map: Map.S with type key = t;
let module Map: Caml.Map.S with type key = t;
/** 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. */

@ -12,6 +12,8 @@
*/
open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** The Smallfoot Intermediate Language */
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} */
let module HpredSet = Set.Make {
let module HpredSet = Caml.Set.Make {
type t = hpred;
let compare = compare_hpred inst::false;
};

@ -268,7 +268,7 @@ let equal_hpred: inst::bool? => hpred => hpred => bool;
/** 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} */

@ -58,7 +58,7 @@ let module SubtypesPair = {
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;

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

@ -12,6 +12,8 @@
*/
open! IStd;
let module Hashtbl = Caml.Hashtbl;
/** The Smallfoot Intermediate Language: Types */
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} */
let module Set = Set.Make {
let module Set = Caml.Set.Make {
type nonrec t = t;
let compare = compare;
};
let module Map = Map.Make {
let module Map = Caml.Map.Make {
type nonrec t = t;
let compare = compare;
};

@ -110,13 +110,13 @@ let d_list: list t => unit;
/** 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. */
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 */

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

@ -40,4 +40,4 @@ let module Java: {
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 -strict-formats \
-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 "<*/{,*/}*.{ml,re}{,i}>: package(ppx_compare)" \
-tag thread \

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

@ -831,10 +831,10 @@ let abstract_gc tenv p =
| None -> prop
| 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 =
Set.Make(struct
Caml.Set.Make(struct
type t = Sil.hpred
let compare = Sil.compare_hpred ~inst:false
end)

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

@ -9,6 +9,7 @@
*)
open! IStd
module Hashtbl = Caml.Hashtbl
(** 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} *)
module EPset = Set.Make
module EPset = Caml.Set.Make
(struct
type t = Exp.t * Exp.t [@@deriving compare]
end)

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

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

@ -9,6 +9,7 @@
*)
open! IStd
module Hashtbl = Caml.Hashtbl
(** Interprocedural Analysis *)
@ -24,7 +25,7 @@ type visitednode =
(** Set of nodes with number of visits *)
module NodeVisitSet =
Set.Make(struct
Caml.Set.Make(struct
type t = visitednode
let compare_ids n1 n2 =
(* 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
Paths.PathSet.map (remove_locals_formals_and_check tenv pdesc) pathset
module Pmap = Map.Make
module Pmap = Caml.Map.Make
(struct
type t = Prop.normal Prop.t
let compare = Prop.compare_prop
@ -1215,7 +1216,7 @@ let report_custom_errors tenv summary =
Reporting.log_error pname exn in
IList.iter report error_preconditions
module SpecMap = Map.Make (struct
module SpecMap = Caml.Map.Make (struct
type t = Prop.normal Specs.Jprop.t
let compare = Specs.Jprop.compare
end)

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

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

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

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

@ -61,7 +61,7 @@ module Jprop : sig
end
(** 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 *)
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. *)
let mk_find_duplicate_nodes proc_desc : (Procdesc.Node.t -> Procdesc.NodeSet.t) =
let module M = (* map from (loc,kind) *)
Map.Make(struct
Caml.Map.Make(struct
type t = Location.t * Procdesc.Node.nodekind [@@deriving compare]
end) in
let module S = (* set of nodes with normalized insructions *)
Set.Make(struct
Caml.Set.Make(struct
type t = Procdesc.Node.t * Sil.instr list
let 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
module FilenameSet = Set.Make(
module FilenameSet = Caml.Set.Make(
struct
type t = filename [@@deriving compare]
end)
module FilenameMap = Map.Make(
module FilenameMap = Caml.Map.Make(
struct
type t = filename [@@deriving compare]
end)

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

@ -7,32 +7,6 @@
* 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
include Core.Std.Sys
@ -50,28 +24,20 @@ module Sys = struct
try is_file ?follow_symlinks path
with Unix.Unix_error _ -> `Unknown
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
functions and builtin equality. Use IList instead. *)
module List = struct end
(** Compare police: generic compare disabled. *)
let compare = ()
let ( @ ) = Caml.List.append
(* 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 =
| Ok of 'a
| Error of 'b
(** Compare police: generic compare mostly disabled. *)
let compare = No_polymorphic_compare.compare
let equal = No_polymorphic_compare.equal
let fst3 (x,_,_) = x
let snd3 (_,x,_) = x
let trd3 (_,_,x) = x
let failwithf fmt =
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.
*)
open! IStd
module F = Format
(** Wrappers for making pretty-printable modules *)
module type SetOrderedType = sig
include Set.OrderedType
include Caml.Set.OrderedType
val pp_element : F.formatter -> t -> unit
end
module type MapOrderedType = sig
include Map.OrderedType
include Caml.Map.OrderedType
val pp_key : F.formatter -> t -> unit
end
module type PPSet = sig
include Set.S
include Caml.Set.S
val pp_element : F.formatter -> elt -> unit
val pp : F.formatter -> t -> unit
end
module type PPMap = sig
include Map.S
include Caml.Map.S
val pp_key : F.formatter -> key -> 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
module MakePPSet (Ord : SetOrderedType) = struct
include Set.Make(Ord)
include Caml.Set.Make(Ord)
let pp_element = Ord.pp_element
@ -54,7 +56,7 @@ end
module MakePPCompareSet
(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
@ -64,7 +66,7 @@ module MakePPCompareSet
end
module MakePPMap (Ord : MapOrderedType) = struct
include Map.Make(Ord)
include Caml.Map.Make(Ord)
let pp_key = Ord.pp_key

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*)
open! IStd
module F = Format
(** Wrappers for making pretty-printable modules *)
@ -26,27 +28,25 @@ module type MapOrderedType = sig
end
module type PPSet = sig
include Set.S
include Caml.Set.S
val pp_element : F.formatter -> elt -> unit
val pp : F.formatter -> t -> unit
end
module type PPMap = sig
include Map.S
include Caml.Map.S
val pp_key : F.formatter -> key -> unit
val pp : pp_value:(F.formatter -> 'a -> unit) -> F.formatter -> 'a t -> unit
end
module MakePPSet : functor (Ord : SetOrderedType) -> sig
include PPSet with type elt = Ord.t
end
module MakePPSet (Ord : SetOrderedType) : (PPSet with type elt = Ord.t)
(** Use a comparison function to determine the order of the elements printed *)
module MakePPCompareSet :
functor (Ord : sig include SetOrderedType val compare_pp : t -> t -> int end) -> sig
include PPSet with type elt = Ord.t
end
module MakePPMap : functor (Ord : MapOrderedType) -> sig
include PPMap with type key = Ord.t
end
module MakePPCompareSet
(Ord : sig
include SetOrderedType
val compare_pp : t -> t -> int
end)
: (PPSet with type elt = Ord.t)
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,
print an error message and exit. *)
let create_process_and_wait ~prog ~args =
let open! Core.Std in
Unix.fork_exec ~prog ~args:(prog :: args) ()
|> Unix.waitpid
|> function
@ -49,7 +48,7 @@ let start_current_jobs_count () = 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
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
[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 open! Core.Std in
let run_job () =
let jobs_map = ref PidMap.empty 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
let pipeline ~producer_prog ~producer_args ~consumer_prog ~consumer_args =
let open! Core.Std in
let pipe_in, pipe_out = Unix.pipe () in
match Unix.fork () with
| `In_the_child ->

@ -10,7 +10,6 @@
open! IStd
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
In_channel.with_file path ~f
@ -30,9 +29,9 @@ struct
type t = _t [@@deriving compare]
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 relative_complemented_fname = Utils.filename_to_relative root fname in

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

@ -59,7 +59,7 @@ val directory_iter : (string -> unit) -> string -> unit
(** Remove a directory and its contents *)
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

@ -7,6 +7,8 @@
* 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.
If Config.infer_cache is set, already deserialized data will be saved there and [path]
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.
*)
open! IStd
type 'a state = { pre: 'a; post: 'a; visit_count: int; }
(** type of an intraprocedural abstract interpreter *)

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

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

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

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

@ -7,6 +7,8 @@
* 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 *)
module type S = sig
include Trace.S

@ -7,4 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory.
*)
open! IStd
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.
*)
open! IStd
(* 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;`
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.
*)
open! IStd
module type S = sig
include TraceElem.S

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

@ -7,6 +7,8 @@
* 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 *)
type frame = {

@ -170,7 +170,7 @@ let method_analysis callback =
(* 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
*)
module ResultsTableType = Map.Make (struct
module ResultsTableType = Caml.Map.Make (struct
type t = Idenv.t * Tenv.t * Procname.t * Procdesc.t
let compare (_, _, pn1, _) (_,_,pn2,_) = Procname.compare pn1 pn2
end)

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

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

@ -15,7 +15,7 @@ type 'a state = { pre: 'a; post: 'a; visit_count: int; }
module type S = sig
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
(Summary : Summary.S with type summary = TransferFunctions.Domain.astate) :
sig

@ -7,6 +7,8 @@
* 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) *)
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.
*)
open! IStd
module F = Format
module Set = struct

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

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

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

@ -7,6 +7,8 @@
* 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
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 *)
@ -91,6 +93,6 @@ module OneInstrPerNode (Base : S with type node = DefaultNode.t and type id = De
and type node = Base.node
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.
*)
open! IStd
type 'a t = { pdesc : Procdesc.t; tenv : Tenv.t; extras : 'a; }
type no_extras

@ -19,7 +19,7 @@ let checkers_repeated_calls_name = "CHECKERS_REPEATED_CALLS"
module RepeatedCallsExtension : Eradicate.ExtensionT =
struct
module InstrSet =
Set.Make(struct
Caml.Set.Make(struct
type t = Sil.instr
let compare i1 i2 = match i1, i2 with
| 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.
*)
open! IStd
(** 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. *)

@ -7,6 +7,8 @@
* 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 *)
type t = private

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

@ -6,4 +6,6 @@
* 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.
*/
open! IStd;
let capture: ClangCommand.t => unit;

@ -6,6 +6,8 @@
* 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.
*/
open! IStd;
type t;

@ -7,6 +7,8 @@
* 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
ObjCImplementationDecl of a descendant of CKComponent or
CKComponentController.

@ -8,6 +8,7 @@
*)
open! IStd
module Hashtbl = Caml.Hashtbl
(** 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. *)

@ -23,7 +23,7 @@ type curr_class =
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 =
{

@ -7,4 +7,6 @@
* 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

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

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

@ -7,6 +7,8 @@
* 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
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

@ -8,6 +8,7 @@
*)
open! IStd
module Hashtbl = Caml.Hashtbl
(** 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]
end
module TypePointerMap = Map.Make(TypePointerOrd)
module TypePointerMap = Caml.Map.Make(TypePointerOrd)
let rec type_ptr_to_string type_ptr = match type_ptr with
| `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.
*)
open! IStd
(* Types used by the ctl parser *)

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

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

@ -9,7 +9,7 @@
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. *)
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_strict : 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_argument_table : model_table_t
val containsKey_table : model_table_t

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

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

@ -8,6 +8,7 @@
*)
open! IStd
module Hashtbl = Caml.Hashtbl
module L = Logging
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
let compare = Exp.compare end)

@ -64,7 +64,6 @@ let swap_command cmd =
Config.wrappers_dir // clang
let run_compilation_file compilation_database file =
let open! Core.Std in
try
let compilation_data = CompilationDatabase.find compilation_database file 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.
*)
open! IStd
(** 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
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
* 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 */
/** quoting style of the arguments */

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

Loading…
Cancel
Save