From 2e66dcfac41360427a449ce0a94bc6eb07c8cd72 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 9 Dec 2016 16:33:54 -0800 Subject: [PATCH] Open Core.Std by default, still use Caml Hashtbl, Map, Set Reviewed By: cristianoc Differential Revision: D4232458 fbshipit-source-id: 3d73c69 --- infer/src/IR/AttributesTable.re | 2 + infer/src/IR/BUILTINS.mli | 2 + infer/src/IR/BuiltinDecl.ml | 2 + infer/src/IR/CallSite.ml | 2 + infer/src/IR/CallSite.mli | 2 + infer/src/IR/Cg.re | 2 + infer/src/IR/Errlog.ml | 5 +- infer/src/IR/Exp.re | 6 ++- infer/src/IR/Exp.rei | 6 +-- infer/src/IR/Ident.re | 10 ++-- infer/src/IR/Ident.rei | 12 ++--- infer/src/IR/LintIssues.mli | 2 + infer/src/IR/Mangled.re | 2 +- infer/src/IR/Mangled.rei | 2 +- infer/src/IR/ProcAttributes.re | 2 + infer/src/IR/ProcAttributes.rei | 2 +- infer/src/IR/Procdesc.re | 8 +-- infer/src/IR/Procdesc.rei | 8 +-- infer/src/IR/Procname.re | 6 ++- infer/src/IR/Procname.rei | 6 +-- infer/src/IR/Sil.re | 4 +- infer/src/IR/Sil.rei | 2 +- infer/src/IR/Subtype.re | 2 +- infer/src/IR/Tenv.re | 2 + infer/src/IR/Typ.re | 6 ++- infer/src/IR/Typ.rei | 6 +-- infer/src/IR/Typename.re | 2 +- infer/src/IR/Typename.rei | 2 +- infer/src/Makefile | 2 +- infer/src/backend/InferPrint.re | 2 + infer/src/backend/abs.ml | 4 +- infer/src/backend/crashcontext.mli | 2 + infer/src/backend/dom.ml | 3 +- infer/src/backend/exe_env.ml | 1 + infer/src/backend/infer.ml | 2 - infer/src/backend/interproc.ml | 7 +-- infer/src/backend/paths.ml | 4 +- infer/src/backend/printer.ml | 1 + infer/src/backend/propset.ml | 2 +- infer/src/backend/specs.ml | 3 +- infer/src/backend/specs.mli | 2 +- infer/src/backend/state.ml | 4 +- infer/src/base/DB.ml | 4 +- infer/src/base/DB.mli | 4 +- infer/src/base/IStd.ml | 50 +++---------------- infer/src/base/PrettyPrintable.ml | 16 +++--- infer/src/base/PrettyPrintable.mli | 26 +++++----- infer/src/base/Process.ml | 5 +- infer/src/base/SourceFile.ml | 5 +- infer/src/base/Utils.ml | 1 + infer/src/base/Utils.mli | 2 +- infer/src/base/ZipLib.mli | 2 + infer/src/checkers/AbstractInterpreter.mli | 2 + infer/src/checkers/Passthrough.mli | 2 + infer/src/checkers/SimpleChecker.mli | 2 + infer/src/checkers/Sink.ml | 2 + infer/src/checkers/Sink.mli | 2 + infer/src/checkers/SinkTrace.mli | 2 + infer/src/checkers/Siof.mli | 2 + infer/src/checkers/SiofDomain.ml | 2 + infer/src/checkers/Source.ml | 2 + infer/src/checkers/Source.mli | 2 + infer/src/checkers/Stacktrace.mli | 2 + infer/src/checkers/ThreadSafety.ml | 2 +- infer/src/checkers/ThreadSafetyDomain.ml | 2 +- infer/src/checkers/TraceElem.ml | 2 + infer/src/checkers/abstractInterpreter.ml | 2 +- infer/src/checkers/accessPath.mli | 2 + infer/src/checkers/accessPathDomains.ml | 2 + infer/src/checkers/accessPathDomains.mli | 2 + infer/src/checkers/checkTraceCallSequence.ml | 2 +- infer/src/checkers/procCfg.ml | 4 +- infer/src/checkers/procCfg.mli | 6 ++- infer/src/checkers/procData.mli | 2 + infer/src/checkers/repeatedCallsChecker.ml | 2 +- infer/src/checkers/transferFunctions.mli | 2 + infer/src/checkers/var.mli | 2 + infer/src/clang/CLintersContext.ml | 2 + infer/src/clang/Capture.rei | 2 + infer/src/clang/ClangCommand.rei | 2 + infer/src/clang/ComponentKit.mli | 2 + infer/src/clang/cContext.ml | 1 + infer/src/clang/cContext.mli | 2 +- infer/src/clang/cFrontend_checkers_main.mli | 2 + infer/src/clang/cIssue.ml | 2 + infer/src/clang/cIssue.mli | 2 + infer/src/clang/cTL.mli | 2 + infer/src/clang/cTrans_utils.ml | 1 + infer/src/clang/clang_ast_types.ml | 2 +- infer/src/clang/ctl_parser_types.ml | 2 + infer/src/clang/predicates.mli | 2 + infer/src/eradicate/modelTables.ml | 1 + infer/src/eradicate/modelTables.mli | 4 +- infer/src/eradicate/models.ml | 1 + infer/src/eradicate/typeAnnotation.ml | 2 +- infer/src/eradicate/typeErr.ml | 1 + infer/src/eradicate/typeState.ml | 2 +- .../integration/CaptureCompilationDatabase.ml | 1 - .../CaptureCompilationDatabase.mli | 2 + infer/src/integration/ClangQuotes.rei | 2 + infer/src/java/jContext.ml | 1 + infer/src/java/jContext.mli | 4 +- infer/src/java/jTransExn.ml | 1 + infer/src/quandary/JavaTrace.mli | 2 + infer/src/quandary/QuandarySummary.mli | 2 + infer/src/quandary/TaintSpec.ml | 2 + 106 files changed, 229 insertions(+), 150 deletions(-) diff --git a/infer/src/IR/AttributesTable.re b/infer/src/IR/AttributesTable.re index 1a89301f5..b218180e2 100644 --- a/infer/src/IR/AttributesTable.re +++ b/infer/src/IR/AttributesTable.re @@ -8,6 +8,8 @@ */ open! IStd; +let module Hashtbl = Caml.Hashtbl; + let module F = Format; let module L = Logging; diff --git a/infer/src/IR/BUILTINS.mli b/infer/src/IR/BUILTINS.mli index 3a56fcc22..85b14f298 100644 --- a/infer/src/IR/BUILTINS.mli +++ b/infer/src/IR/BUILTINS.mli @@ -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 diff --git a/infer/src/IR/BuiltinDecl.ml b/infer/src/IR/BuiltinDecl.ml index 0eb458d04..6045bebc2 100644 --- a/infer/src/IR/BuiltinDecl.ml +++ b/infer/src/IR/BuiltinDecl.ml @@ -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 diff --git a/infer/src/IR/CallSite.ml b/infer/src/IR/CallSite.ml index 61c4dddf3..c849b33a7 100644 --- a/infer/src/IR/CallSite.ml +++ b/infer/src/IR/CallSite.ml @@ -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 = diff --git a/infer/src/IR/CallSite.mli b/infer/src/IR/CallSite.mli index fe13d13e0..2841fa6b3 100644 --- a/infer/src/IR/CallSite.mli +++ b/infer/src/IR/CallSite.mli @@ -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] diff --git a/infer/src/IR/Cg.re b/infer/src/IR/Cg.re index 477883c3d..12fd5f722 100644 --- a/infer/src/IR/Cg.re +++ b/infer/src/IR/Cg.re @@ -12,6 +12,8 @@ */ open! IStd; +let module Hashtbl = Caml.Hashtbl; + /** Module for call graphs */ let module L = Logging; diff --git a/infer/src/IR/Errlog.ml b/infer/src/IR/Errlog.ml index 00d613f46..2857d7838 100644 --- a/infer/src/IR/Errlog.ml +++ b/infer/src/IR/Errlog.ml @@ -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) diff --git a/infer/src/IR/Exp.re b/infer/src/IR/Exp.re index e55e5986f..b9dcea3d7 100644 --- a/infer/src/IR/Exp.re +++ b/infer/src/IR/Exp.re @@ -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; }; diff --git a/infer/src/IR/Exp.rei b/infer/src/IR/Exp.rei index fd0778e89..d3f0ec7e0 100644 --- a/infer/src/IR/Exp.rei +++ b/infer/src/IR/Exp.rei @@ -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. */ diff --git a/infer/src/IR/Ident.re b/infer/src/IR/Ident.re index 98deeaa47..d73a3e5d7 100644 --- a/infer/src/IR/Ident.re +++ b/infer/src/IR/Ident.re @@ -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]; }; diff --git a/infer/src/IR/Ident.rei b/infer/src/IR/Ident.rei index 4fe7bc10d..8bdbea78d 100644 --- a/infer/src/IR/Ident.rei +++ b/infer/src/IR/Ident.rei @@ -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 */ diff --git a/infer/src/IR/LintIssues.mli b/infer/src/IR/LintIssues.mli index 0d2be45be..114c84327 100644 --- a/infer/src/IR/LintIssues.mli +++ b/infer/src/IR/LintIssues.mli @@ -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 diff --git a/infer/src/IR/Mangled.re b/infer/src/IR/Mangled.re index 0db050a25..0fbcbe57a 100644 --- a/infer/src/IR/Mangled.re +++ b/infer/src/IR/Mangled.re @@ -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; }; diff --git a/infer/src/IR/Mangled.rei b/infer/src/IR/Mangled.rei index 29296caef..429d0fb85 100644 --- a/infer/src/IR/Mangled.rei +++ b/infer/src/IR/Mangled.rei @@ -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; diff --git a/infer/src/IR/ProcAttributes.re b/infer/src/IR/ProcAttributes.re index cc2da7f4a..866586f9a 100644 --- a/infer/src/IR/ProcAttributes.re +++ b/infer/src/IR/ProcAttributes.re @@ -8,6 +8,8 @@ */ open! IStd; +let module Hashtbl = Caml.Hashtbl; + /** Attributes of a procedure. */ let module L = Logging; diff --git a/infer/src/IR/ProcAttributes.rei b/infer/src/IR/ProcAttributes.rei index 38c66023f..766cd8a41 100644 --- a/infer/src/IR/ProcAttributes.rei +++ b/infer/src/IR/ProcAttributes.rei @@ -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 */ diff --git a/infer/src/IR/Procdesc.re b/infer/src/IR/Procdesc.re index b8491e3e0..f0baacd56 100644 --- a/infer/src/IR/Procdesc.re +++ b/infer/src/IR/Procdesc.re @@ -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. */ diff --git a/infer/src/IR/Procdesc.rei b/infer/src/IR/Procdesc.rei index 24cfff185..4d7b87c87 100644 --- a/infer/src/IR/Procdesc.rei +++ b/infer/src/IR/Procdesc.rei @@ -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 */ diff --git a/infer/src/IR/Procname.re b/infer/src/IR/Procname.re index 0ffd720bd..4042e7565 100644 --- a/infer/src/IR/Procname.re +++ b/infer/src/IR/Procname.re @@ -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; }; diff --git a/infer/src/IR/Procname.rei b/infer/src/IR/Procname.rei index 716d7a9ba..02cdd4264 100644 --- a/infer/src/IR/Procname.rei +++ b/infer/src/IR/Procname.rei @@ -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. */ diff --git a/infer/src/IR/Sil.re b/infer/src/IR/Sil.re index 343a65bb0..0b5b6f4b3 100644 --- a/infer/src/IR/Sil.re +++ b/infer/src/IR/Sil.re @@ -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; }; diff --git a/infer/src/IR/Sil.rei b/infer/src/IR/Sil.rei index aedf7a7a3..453cc475f 100644 --- a/infer/src/IR/Sil.rei +++ b/infer/src/IR/Sil.rei @@ -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} */ diff --git a/infer/src/IR/Subtype.re b/infer/src/IR/Subtype.re index 66c7748be..90fa02416 100644 --- a/infer/src/IR/Subtype.re +++ b/infer/src/IR/Subtype.re @@ -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; diff --git a/infer/src/IR/Tenv.re b/infer/src/IR/Tenv.re index 10e56b4f6..276275bd9 100644 --- a/infer/src/IR/Tenv.re +++ b/infer/src/IR/Tenv.re @@ -8,6 +8,8 @@ */ open! IStd; +let module Hashtbl = Caml.Hashtbl; + /** Module for Type Environments. */ diff --git a/infer/src/IR/Typ.re b/infer/src/IR/Typ.re index 88dcb58ad..c2eb30a61 100644 --- a/infer/src/IR/Typ.re +++ b/infer/src/IR/Typ.re @@ -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; }; diff --git a/infer/src/IR/Typ.rei b/infer/src/IR/Typ.rei index 458d025b1..01f725bca 100644 --- a/infer/src/IR/Typ.rei +++ b/infer/src/IR/Typ.rei @@ -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 */ diff --git a/infer/src/IR/Typename.re b/infer/src/IR/Typename.re index 0fee6bd5e..c5d664979 100644 --- a/infer/src/IR/Typename.re +++ b/infer/src/IR/Typename.re @@ -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; }; diff --git a/infer/src/IR/Typename.rei b/infer/src/IR/Typename.rei index 2a3ca028d..69a358946 100644 --- a/infer/src/IR/Typename.rei +++ b/infer/src/IR/Typename.rei @@ -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; diff --git a/infer/src/Makefile b/infer/src/Makefile index 8ad34f4f1..f3ef448fe 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -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 \ diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re index 84ab1f5d2..e03bd32d4 100644 --- a/infer/src/backend/InferPrint.re +++ b/infer/src/backend/InferPrint.re @@ -9,6 +9,8 @@ */ open! IStd; +let module Hashtbl = Caml.Hashtbl; + let module L = Logging; let module F = Format; diff --git a/infer/src/backend/abs.ml b/infer/src/backend/abs.ml index 78dbafcc2..19ec0c651 100644 --- a/infer/src/backend/abs.ml +++ b/infer/src/backend/abs.ml @@ -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) diff --git a/infer/src/backend/crashcontext.mli b/infer/src/backend/crashcontext.mli index 4acae8edc..d10503139 100644 --- a/infer/src/backend/crashcontext.mli +++ b/infer/src/backend/crashcontext.mli @@ -7,6 +7,8 @@ * of patent rights can be found in the PATENTS file in the same directory. *) +open! IStd + (** CRASHCONTEXT Intro [experimental]: diff --git a/infer/src/backend/dom.ml b/infer/src/backend/dom.ml index b477c0f49..12e3bec1f 100644 --- a/infer/src/backend/dom.ml +++ b/infer/src/backend/dom.ml @@ -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) diff --git a/infer/src/backend/exe_env.ml b/infer/src/backend/exe_env.ml index c06829dd2..2fe164e25 100644 --- a/infer/src/backend/exe_env.ml +++ b/infer/src/backend/exe_env.ml @@ -9,6 +9,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl (** Support for Execution environments *) diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index 6dbd0d7cd..cad5074f9 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -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 ; diff --git a/infer/src/backend/interproc.ml b/infer/src/backend/interproc.ml index d5346c4bc..e2ea23dff 100644 --- a/infer/src/backend/interproc.ml +++ b/infer/src/backend/interproc.ml @@ -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) diff --git a/infer/src/backend/paths.ml b/infer/src/backend/paths.ml index 916b74f5b..614b86a57 100644 --- a/infer/src/backend/paths.ml +++ b/infer/src/backend/paths.ml @@ -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) diff --git a/infer/src/backend/printer.ml b/infer/src/backend/printer.ml index b1df3d37e..75fc0933c 100644 --- a/infer/src/backend/printer.ml +++ b/infer/src/backend/printer.ml @@ -9,6 +9,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl (** Printers for the analysis results *) diff --git a/infer/src/backend/propset.ml b/infer/src/backend/propset.ml index babb7fc00..c631c4aad 100644 --- a/infer/src/backend/propset.ml +++ b/infer/src/backend/propset.ml @@ -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) diff --git a/infer/src/backend/specs.ml b/infer/src/backend/specs.ml index 2a7d5e243..a8f494188 100644 --- a/infer/src/backend/specs.ml +++ b/infer/src/backend/specs.ml @@ -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) diff --git a/infer/src/backend/specs.mli b/infer/src/backend/specs.mli index dc0af9a64..f7c06c090 100644 --- a/infer/src/backend/specs.mli +++ b/infer/src/backend/specs.mli @@ -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 diff --git a/infer/src/backend/state.ml b/infer/src/backend/state.ml index a646b23cf..0713439d8 100644 --- a/infer/src/backend/state.ml +++ b/infer/src/backend/state.ml @@ -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 diff --git a/infer/src/base/DB.ml b/infer/src/base/DB.ml index aa4b5a66a..4085f2c66 100644 --- a/infer/src/base/DB.ml +++ b/infer/src/base/DB.ml @@ -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) diff --git a/infer/src/base/DB.mli b/infer/src/base/DB.mli index d9443d353..8508d2d26 100644 --- a/infer/src/base/DB.mli +++ b/infer/src/base/DB.mli @@ -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 diff --git a/infer/src/base/IStd.ml b/infer/src/base/IStd.ml index 6eeb53d53..215bbbce4 100644 --- a/infer/src/base/IStd.ml +++ b/infer/src/base/IStd.ml @@ -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 ())) diff --git a/infer/src/base/PrettyPrintable.ml b/infer/src/base/PrettyPrintable.ml index 728cbd1a4..54385e8b8 100644 --- a/infer/src/base/PrettyPrintable.ml +++ b/infer/src/base/PrettyPrintable.ml @@ -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 diff --git a/infer/src/base/PrettyPrintable.mli b/infer/src/base/PrettyPrintable.mli index 7c7a34daa..9a3d78f2f 100644 --- a/infer/src/base/PrettyPrintable.mli +++ b/infer/src/base/PrettyPrintable.mli @@ -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) diff --git a/infer/src/base/Process.ml b/infer/src/base/Process.ml index c594c2201..12c5820a6 100644 --- a/infer/src/base/Process.ml +++ b/infer/src/base/Process.ml @@ -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 -> diff --git a/infer/src/base/SourceFile.ml b/infer/src/base/SourceFile.ml index 258f11bb6..6615dcf99 100644 --- a/infer/src/base/SourceFile.ml +++ b/infer/src/base/SourceFile.ml @@ -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 diff --git a/infer/src/base/Utils.ml b/infer/src/base/Utils.ml index 30fc7c516..6b7340646 100644 --- a/infer/src/base/Utils.ml +++ b/infer/src/base/Utils.ml @@ -10,6 +10,7 @@ open! IStd module F = Format +module Hashtbl = Caml.Hashtbl (** initial process times *) let initial_times = Unix.times () diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index 4d5adad1c..0fbb3e971 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -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 diff --git a/infer/src/base/ZipLib.mli b/infer/src/base/ZipLib.mli index c2441c57c..608b700e5 100644 --- a/infer/src/base/ZipLib.mli +++ b/infer/src/base/ZipLib.mli @@ -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. *) diff --git a/infer/src/checkers/AbstractInterpreter.mli b/infer/src/checkers/AbstractInterpreter.mli index 1ad598392..14b0ca8f0 100644 --- a/infer/src/checkers/AbstractInterpreter.mli +++ b/infer/src/checkers/AbstractInterpreter.mli @@ -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 *) diff --git a/infer/src/checkers/Passthrough.mli b/infer/src/checkers/Passthrough.mli index 32d6a748d..fff95635a 100644 --- a/infer/src/checkers/Passthrough.mli +++ b/infer/src/checkers/Passthrough.mli @@ -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] diff --git a/infer/src/checkers/SimpleChecker.mli b/infer/src/checkers/SimpleChecker.mli index 9ec95785d..660a04f13 100644 --- a/infer/src/checkers/SimpleChecker.mli +++ b/infer/src/checkers/SimpleChecker.mli @@ -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 diff --git a/infer/src/checkers/Sink.ml b/infer/src/checkers/Sink.ml index 26ec12592..34efee70a 100644 --- a/infer/src/checkers/Sink.ml +++ b/infer/src/checkers/Sink.ml @@ -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 *) diff --git a/infer/src/checkers/Sink.mli b/infer/src/checkers/Sink.mli index 4f8ad7f40..578bd03c1 100644 --- a/infer/src/checkers/Sink.mli +++ b/infer/src/checkers/Sink.mli @@ -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 *) diff --git a/infer/src/checkers/SinkTrace.mli b/infer/src/checkers/SinkTrace.mli index 4ea3de3aa..daf37fc4c 100644 --- a/infer/src/checkers/SinkTrace.mli +++ b/infer/src/checkers/SinkTrace.mli @@ -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 diff --git a/infer/src/checkers/Siof.mli b/infer/src/checkers/Siof.mli index 06800b4a8..c99489fe0 100644 --- a/infer/src/checkers/Siof.mli +++ b/infer/src/checkers/Siof.mli @@ -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 diff --git a/infer/src/checkers/SiofDomain.ml b/infer/src/checkers/SiofDomain.ml index cb4bea98b..c41e345d2 100644 --- a/infer/src/checkers/SiofDomain.ml +++ b/infer/src/checkers/SiofDomain.ml @@ -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 = diff --git a/infer/src/checkers/Source.ml b/infer/src/checkers/Source.ml index 831458765..d6436beb3 100644 --- a/infer/src/checkers/Source.ml +++ b/infer/src/checkers/Source.ml @@ -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 diff --git a/infer/src/checkers/Source.mli b/infer/src/checkers/Source.mli index 4916bb67d..e9949ecb8 100644 --- a/infer/src/checkers/Source.mli +++ b/infer/src/checkers/Source.mli @@ -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 diff --git a/infer/src/checkers/Stacktrace.mli b/infer/src/checkers/Stacktrace.mli index 2f4bdc9c5..64b7c87d0 100644 --- a/infer/src/checkers/Stacktrace.mli +++ b/infer/src/checkers/Stacktrace.mli @@ -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 = { diff --git a/infer/src/checkers/ThreadSafety.ml b/infer/src/checkers/ThreadSafety.ml index 3f4c8288d..b9c7f203c 100644 --- a/infer/src/checkers/ThreadSafety.ml +++ b/infer/src/checkers/ThreadSafety.ml @@ -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) diff --git a/infer/src/checkers/ThreadSafetyDomain.ml b/infer/src/checkers/ThreadSafetyDomain.ml index 826e63c34..f7c12c069 100644 --- a/infer/src/checkers/ThreadSafetyDomain.ml +++ b/infer/src/checkers/ThreadSafetyDomain.ml @@ -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 diff --git a/infer/src/checkers/TraceElem.ml b/infer/src/checkers/TraceElem.ml index 8fef9a84c..4267eca7b 100644 --- a/infer/src/checkers/TraceElem.ml +++ b/infer/src/checkers/TraceElem.ml @@ -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 diff --git a/infer/src/checkers/abstractInterpreter.ml b/infer/src/checkers/abstractInterpreter.ml index fa886bd4e..51ee73280 100644 --- a/infer/src/checkers/abstractInterpreter.ml +++ b/infer/src/checkers/abstractInterpreter.ml @@ -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 diff --git a/infer/src/checkers/accessPath.mli b/infer/src/checkers/accessPath.mli index e883a8e16..b196ce72c 100644 --- a/infer/src/checkers/accessPath.mli +++ b/infer/src/checkers/accessPath.mli @@ -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] diff --git a/infer/src/checkers/accessPathDomains.ml b/infer/src/checkers/accessPathDomains.ml index a9d9c60e9..c91d70ce2 100644 --- a/infer/src/checkers/accessPathDomains.ml +++ b/infer/src/checkers/accessPathDomains.ml @@ -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 diff --git a/infer/src/checkers/accessPathDomains.mli b/infer/src/checkers/accessPathDomains.mli index a3ba3a740..7a21e2a45 100644 --- a/infer/src/checkers/accessPathDomains.mli +++ b/infer/src/checkers/accessPathDomains.mli @@ -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 diff --git a/infer/src/checkers/checkTraceCallSequence.ml b/infer/src/checkers/checkTraceCallSequence.ml index eb0224e74..ef9de4503 100644 --- a/infer/src/checkers/checkTraceCallSequence.ml +++ b/infer/src/checkers/checkTraceCallSequence.ml @@ -94,7 +94,7 @@ module Elem = struct end -module ElemSet = Set.Make(Elem) +module ElemSet = Caml.Set.Make(Elem) module State = struct diff --git a/infer/src/checkers/procCfg.ml b/infer/src/checkers/procCfg.ml index 94e8c8eee..0556cdeee 100644 --- a/infer/src/checkers/procCfg.ml +++ b/infer/src/checkers/procCfg.ml @@ -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) diff --git a/infer/src/checkers/procCfg.mli b/infer/src/checkers/procCfg.mli index 9070c83d9..d29bd4360 100644 --- a/infer/src/checkers/procCfg.mli +++ b/infer/src/checkers/procCfg.mli @@ -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 diff --git a/infer/src/checkers/procData.mli b/infer/src/checkers/procData.mli index e98a42c49..2b4d34020 100644 --- a/infer/src/checkers/procData.mli +++ b/infer/src/checkers/procData.mli @@ -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 diff --git a/infer/src/checkers/repeatedCallsChecker.ml b/infer/src/checkers/repeatedCallsChecker.ml index eb2b7ae0b..bd144b9db 100644 --- a/infer/src/checkers/repeatedCallsChecker.ml +++ b/infer/src/checkers/repeatedCallsChecker.ml @@ -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) -> diff --git a/infer/src/checkers/transferFunctions.mli b/infer/src/checkers/transferFunctions.mli index 3b75ea52a..cfec4b57a 100644 --- a/infer/src/checkers/transferFunctions.mli +++ b/infer/src/checkers/transferFunctions.mli @@ -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. *) diff --git a/infer/src/checkers/var.mli b/infer/src/checkers/var.mli index 7f01d3c6a..b31ab6865 100644 --- a/infer/src/checkers/var.mli +++ b/infer/src/checkers/var.mli @@ -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 diff --git a/infer/src/clang/CLintersContext.ml b/infer/src/clang/CLintersContext.ml index fd7cad7df..d2109617a 100644 --- a/infer/src/clang/CLintersContext.ml +++ b/infer/src/clang/CLintersContext.ml @@ -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; diff --git a/infer/src/clang/Capture.rei b/infer/src/clang/Capture.rei index a6986d710..ea6051d7b 100644 --- a/infer/src/clang/Capture.rei +++ b/infer/src/clang/Capture.rei @@ -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; diff --git a/infer/src/clang/ClangCommand.rei b/infer/src/clang/ClangCommand.rei index 1e3df1cdc..f98d377a8 100644 --- a/infer/src/clang/ClangCommand.rei +++ b/infer/src/clang/ClangCommand.rei @@ -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; diff --git a/infer/src/clang/ComponentKit.mli b/infer/src/clang/ComponentKit.mli index 2bdd2443b..3b261ddde 100644 --- a/infer/src/clang/ComponentKit.mli +++ b/infer/src/clang/ComponentKit.mli @@ -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. diff --git a/infer/src/clang/cContext.ml b/infer/src/clang/cContext.ml index e82f23fbc..1529b5233 100644 --- a/infer/src/clang/cContext.ml +++ b/infer/src/clang/cContext.ml @@ -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. *) diff --git a/infer/src/clang/cContext.mli b/infer/src/clang/cContext.mli index 10102557f..7aaf0b789 100644 --- a/infer/src/clang/cContext.mli +++ b/infer/src/clang/cContext.mli @@ -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 = { diff --git a/infer/src/clang/cFrontend_checkers_main.mli b/infer/src/clang/cFrontend_checkers_main.mli index 9091316f9..364a25822 100644 --- a/infer/src/clang/cFrontend_checkers_main.mli +++ b/infer/src/clang/cFrontend_checkers_main.mli @@ -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 diff --git a/infer/src/clang/cIssue.ml b/infer/src/clang/cIssue.ml index a60d2c387..acba40486 100644 --- a/infer/src/clang/cIssue.ml +++ b/infer/src/clang/cIssue.ml @@ -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 diff --git a/infer/src/clang/cIssue.mli b/infer/src/clang/cIssue.mli index d9185d429..d7bab784e 100644 --- a/infer/src/clang/cIssue.mli +++ b/infer/src/clang/cIssue.mli @@ -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 diff --git a/infer/src/clang/cTL.mli b/infer/src/clang/cTL.mli index a202975b7..a6288eb7a 100644 --- a/infer/src/clang/cTL.mli +++ b/infer/src/clang/cTL.mli @@ -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 diff --git a/infer/src/clang/cTrans_utils.ml b/infer/src/clang/cTrans_utils.ml index 804412e03..bd1ae9a6f 100644 --- a/infer/src/clang/cTrans_utils.ml +++ b/infer/src/clang/cTrans_utils.ml @@ -8,6 +8,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl (** Utility methods to support the translation of clang ast constructs into sil instructions. *) diff --git a/infer/src/clang/clang_ast_types.ml b/infer/src/clang/clang_ast_types.ml index 9286483e8..ee9aa3cc3 100644 --- a/infer/src/clang/clang_ast_types.ml +++ b/infer/src/clang/clang_ast_types.ml @@ -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) diff --git a/infer/src/clang/ctl_parser_types.ml b/infer/src/clang/ctl_parser_types.ml index 3f9b142ed..04c9486ca 100644 --- a/infer/src/clang/ctl_parser_types.ml +++ b/infer/src/clang/ctl_parser_types.ml @@ -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 *) diff --git a/infer/src/clang/predicates.mli b/infer/src/clang/predicates.mli index 66198caf4..798a9098c 100644 --- a/infer/src/clang/predicates.mli +++ b/infer/src/clang/predicates.mli @@ -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 diff --git a/infer/src/eradicate/modelTables.ml b/infer/src/eradicate/modelTables.ml index bf388a568..1d041e6de 100644 --- a/infer/src/eradicate/modelTables.ml +++ b/infer/src/eradicate/modelTables.ml @@ -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. diff --git a/infer/src/eradicate/modelTables.mli b/infer/src/eradicate/modelTables.mli index cdf5db1c4..c16707efc 100644 --- a/infer/src/eradicate/modelTables.mli +++ b/infer/src/eradicate/modelTables.mli @@ -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 diff --git a/infer/src/eradicate/models.ml b/infer/src/eradicate/models.ml index cfcc1e740..ff990ae21 100644 --- a/infer/src/eradicate/models.ml +++ b/infer/src/eradicate/models.ml @@ -8,6 +8,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl open ModelTables module L = Logging diff --git a/infer/src/eradicate/typeAnnotation.ml b/infer/src/eradicate/typeAnnotation.ml index 089e33af1..91a4d71f2 100644 --- a/infer/src/eradicate/typeAnnotation.ml +++ b/infer/src/eradicate/typeAnnotation.ml @@ -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] diff --git a/infer/src/eradicate/typeErr.ml b/infer/src/eradicate/typeErr.ml index 1d0f0d57e..4d72250b8 100644 --- a/infer/src/eradicate/typeErr.ml +++ b/infer/src/eradicate/typeErr.ml @@ -8,6 +8,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl module L = Logging module P = Printf diff --git a/infer/src/eradicate/typeState.ml b/infer/src/eradicate/typeState.ml index b42330f6e..da0f65da6 100644 --- a/infer/src/eradicate/typeState.ml +++ b/infer/src/eradicate/typeState.ml @@ -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) diff --git a/infer/src/integration/CaptureCompilationDatabase.ml b/infer/src/integration/CaptureCompilationDatabase.ml index 588f149ef..f762317ed 100644 --- a/infer/src/integration/CaptureCompilationDatabase.ml +++ b/infer/src/integration/CaptureCompilationDatabase.ml @@ -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 diff --git a/infer/src/integration/CaptureCompilationDatabase.mli b/infer/src/integration/CaptureCompilationDatabase.mli index 0dbe66a84..a82831a9b 100644 --- a/infer/src/integration/CaptureCompilationDatabase.mli +++ b/infer/src/integration/CaptureCompilationDatabase.mli @@ -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 *) diff --git a/infer/src/integration/ClangQuotes.rei b/infer/src/integration/ClangQuotes.rei index 97b2c7c5f..998ef0677 100644 --- a/infer/src/integration/ClangQuotes.rei +++ b/infer/src/integration/ClangQuotes.rei @@ -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 */ diff --git a/infer/src/java/jContext.ml b/infer/src/java/jContext.ml index 118181809..934cb00f2 100644 --- a/infer/src/java/jContext.ml +++ b/infer/src/java/jContext.ml @@ -9,6 +9,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl open Javalib_pack open Sawja_pack diff --git a/infer/src/java/jContext.mli b/infer/src/java/jContext.mli index c4ccf357b..ac34eb7e7 100644 --- a/infer/src/java/jContext.mli +++ b/infer/src/java/jContext.mli @@ -22,7 +22,7 @@ type jump_kind = (** Hastable for storing nodes that correspond to if-instructions. These are used when adding the edges in the contrl flow graph. *) -module NodeTbl : Hashtbl.S with type key = Procdesc.Node.t +module NodeTbl : Caml.Hashtbl.S with type key = Procdesc.Node.t (** data structure for saving the three structures tht contain the intermediate @@ -41,7 +41,7 @@ type t = private impl : JBir.t; mutable var_map : (Pvar.t * Typ.t * Typ.t) JBir.VarMap.t; if_jumps : int NodeTbl.t; - goto_jumps : (int, jump_kind) Hashtbl.t; + goto_jumps : (int, jump_kind) Caml.Hashtbl.t; cn : JBasics.class_name; source_file : SourceFile.t; program : JClasspath.program; diff --git a/infer/src/java/jTransExn.ml b/infer/src/java/jTransExn.ml index 6f7c74d87..3dc5c1197 100644 --- a/infer/src/java/jTransExn.ml +++ b/infer/src/java/jTransExn.ml @@ -9,6 +9,7 @@ *) open! IStd +module Hashtbl = Caml.Hashtbl open Javalib_pack open Sawja_pack diff --git a/infer/src/quandary/JavaTrace.mli b/infer/src/quandary/JavaTrace.mli index 297ca935d..d3d3fb3a1 100644 --- a/infer/src/quandary/JavaTrace.mli +++ b/infer/src/quandary/JavaTrace.mli @@ -7,4 +7,6 @@ * of patent rights can be found in the PATENTS file in the same directory. *) +open! IStd + include Trace.S diff --git a/infer/src/quandary/QuandarySummary.mli b/infer/src/quandary/QuandarySummary.mli index 2fe54e6b3..6ad46ac90 100644 --- a/infer/src/quandary/QuandarySummary.mli +++ b/infer/src/quandary/QuandarySummary.mli @@ -7,6 +7,8 @@ * of patent rights can be found in the PATENTS file in the same directory. *) +open! IStd + (** summary type for Quandary taint analysis *) diff --git a/infer/src/quandary/TaintSpec.ml b/infer/src/quandary/TaintSpec.ml index 09ef6d576..cd8cdf847 100644 --- a/infer/src/quandary/TaintSpec.ml +++ b/infer/src/quandary/TaintSpec.ml @@ -7,6 +7,8 @@ * of patent rights can be found in the PATENTS file in the same directory. *) +open! IStd + (** combination of a trace with functions for handling unknown code and converting to and from summaries *)