diff --git a/infer/src/IR/ErlangTypeName.ml b/infer/src/IR/ErlangTypeName.ml index 339e1022062..e38155f198d 100644 --- a/infer/src/IR/ErlangTypeName.ml +++ b/infer/src/IR/ErlangTypeName.ml @@ -144,7 +144,7 @@ let calculate_hash atom = *) Md5.digest_string atom (* Compute md5 *) |> Md5.to_binary |> Bytes.of_string (* Get the hash as bytes *) - |> Fn.flip Caml.Bytes.get_int64_be 0 (* Get the first 8 bytes as a big-endian int64 *) + |> Fn.flip Stdlib.Bytes.get_int64_be 0 (* Get the first 8 bytes as a big-endian int64 *) |> Fn.flip Int64.shift_right_logical 8 (* Drop the last byte / keep the first 7 bytes only *) |> Int64.to_int_exn (* Put in an integer, raising if it unexpectedly does not fit *) diff --git a/infer/src/IR/Exp.ml b/infer/src/IR/Exp.ml index ab5d874634e..3a8b22c51da 100644 --- a/infer/src/IR/Exp.ml +++ b/infer/src/IR/Exp.ml @@ -9,7 +9,7 @@ (** The Smallfoot Intermediate Language: Expressions *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module F = Format module L = Logging @@ -53,11 +53,11 @@ and t = | Sizeof of sizeof_data [@@deriving compare, equal, hash, normalize] -module Set = Caml.Set.Make (struct +module Set = Stdlib.Set.Make (struct type nonrec t = t [@@deriving compare] end) -module Map = Caml.Map.Make (struct +module Map = Stdlib.Map.Make (struct type nonrec t = t [@@deriving compare] end) diff --git a/infer/src/IR/Exp.mli b/infer/src/IR/Exp.mli index 48d7b7c637e..2c577bd4bfe 100644 --- a/infer/src/IR/Exp.mli +++ b/infer/src/IR/Exp.mli @@ -50,13 +50,13 @@ val equal : t -> t -> bool (** Equality for expressions. *) (** Set of expressions. *) -module Set : Caml.Set.S with type elt = t +module Set : Stdlib.Set.S with type elt = t (** Map with expression keys. *) -module Map : Caml.Map.S with type key = t +module Map : Stdlib.Map.S with type key = t (** Hashtable with expression keys. *) -module Hash : Caml.Hashtbl.S with type key = t +module Hash : Stdlib.Hashtbl.S with type key = t val is_null_literal : t -> bool diff --git a/infer/src/IR/Ident.ml b/infer/src/IR/Ident.ml index 0515c33fd56..793ae93bc04 100644 --- a/infer/src/IR/Ident.ml +++ b/infer/src/IR/Ident.ml @@ -9,7 +9,7 @@ (** Module for Names and Identifiers *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module F = Format module Name = struct @@ -73,11 +73,11 @@ let equal i1 i2 = (** {2 Set for identifiers} *) -module Set = Caml.Set.Make (struct +module Set = Stdlib.Set.Make (struct type nonrec t = t [@@deriving compare] end) -module Map = Caml.Map.Make (struct +module Map = Stdlib.Map.Make (struct type nonrec t = t [@@deriving compare] end) @@ -128,7 +128,7 @@ module NameGenerator = struct let stamp = NameHash.find !name_map name in NameHash.replace !name_map name (stamp + 1) ; stamp + 1 - with Caml.Not_found -> + with Stdlib.Not_found -> NameHash.add !name_map name 0 ; 0 in @@ -141,7 +141,7 @@ module NameGenerator = struct let curr_stamp = NameHash.find !name_map name in let new_stamp = max curr_stamp stamp in NameHash.replace !name_map name new_stamp - with Caml.Not_found -> NameHash.add !name_map name stamp + with Stdlib.Not_found -> NameHash.add !name_map name stamp end (** Name used for the return variable *) diff --git a/infer/src/IR/Ident.mli b/infer/src/IR/Ident.mli index af339af1107..ec9baf692b8 100644 --- a/infer/src/IR/Ident.mli +++ b/infer/src/IR/Ident.mli @@ -29,10 +29,10 @@ val equal_kind : kind -> kind -> bool (** Equality for kind. *) (** Set for identifiers. *) -module Set : Caml.Set.S with type elt = t +module Set : Stdlib.Set.S with type elt = t (** Map with ident as key. *) -module Map : Caml.Map.S with type key = t +module Map : Stdlib.Map.S with type key = t module HashQueue : Hash_queue.S with type key = t diff --git a/infer/src/IR/Procdesc.ml b/infer/src/IR/Procdesc.ml index e8710bc246b..0bd07d8a61f 100644 --- a/infer/src/IR/Procdesc.ml +++ b/infer/src/IR/Procdesc.ml @@ -7,14 +7,14 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module L = Logging module F = Format module NodeKey = struct - type t = Caml.Digest.t + type t = Stdlib.Digest.t - let to_string = Caml.Digest.to_hex + let to_string = Stdlib.Digest.to_hex let compute node ~simple_key ~succs ~preds = let v = (simple_key node, List.rev_map ~f:simple_key succs, List.rev_map ~f:simple_key preds) in @@ -483,7 +483,7 @@ end (* =============== END of module Node =============== *) (** Map over nodes *) -module NodeMap = Caml.Map.Make (Node) +module NodeMap = Stdlib.Map.Make (Node) (** Hash table with nodes as keys. *) module NodeHash = Hashtbl.Make (Node) diff --git a/infer/src/IR/Procdesc.mli b/infer/src/IR/Procdesc.mli index ae5120d835d..a74af820785 100644 --- a/infer/src/IR/Procdesc.mli +++ b/infer/src/IR/Procdesc.mli @@ -199,13 +199,13 @@ end module IdMap : PrettyPrintable.PPMap with type key = Node.id (** Hash table with nodes as keys. *) -module NodeHash : Caml.Hashtbl.S with type key = Node.t +module NodeHash : Stdlib.Hashtbl.S with type key = Node.t (** Hash set with nodes as keys. *) module NodeHashSet : HashSet.S with type elt = Node.t (** Map over nodes. *) -module NodeMap : Caml.Map.S with type key = Node.t +module NodeMap : Stdlib.Map.S with type key = Node.t (** Set of nodes. *) module NodeSet : PrettyPrintable.PPSet with type elt = Node.t diff --git a/infer/src/IR/Procname.ml b/infer/src/IR/Procname.ml index 8f3a03b6e7a..eed5bd697de 100644 --- a/infer/src/IR/Procname.ml +++ b/infer/src/IR/Procname.ml @@ -6,7 +6,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module F = Format module L = Logging @@ -1177,7 +1177,7 @@ let replace_regex regex tgt name = match Str.search_forward regex name 0 with | _ -> Str.global_replace regex tgt name - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> name diff --git a/infer/src/IR/Procname.mli b/infer/src/IR/Procname.mli index a91c1e8f0d8..19e3bb78705 100644 --- a/infer/src/IR/Procname.mli +++ b/infer/src/IR/Procname.mli @@ -266,7 +266,7 @@ include module type of struct end (** Hash tables with proc names as keys. *) -module Hash : Caml.Hashtbl.S with type key = t +module Hash : Stdlib.Hashtbl.S with type key = t module LRUHash : LRUHashtbl.S with type key = t diff --git a/infer/src/IR/SourceFiles.ml b/infer/src/IR/SourceFiles.ml index 12d11abc737..b4beffaf1c8 100644 --- a/infer/src/IR/SourceFiles.ml +++ b/infer/src/IR/SourceFiles.ml @@ -63,12 +63,12 @@ let add source_file cfg tenv integer_type_widths = source_file ; (* merge the proc names defined in the source file using a hashtbl so that order is preserved but merging is still linear time *) - let existing_proc_names = Caml.Hashtbl.create (List.length old_proc_names) in + let existing_proc_names = Stdlib.Hashtbl.create (List.length old_proc_names) in List.iter old_proc_names ~f:(fun proc_name -> - Caml.Hashtbl.add existing_proc_names proc_name () ) ; + Stdlib.Hashtbl.add existing_proc_names proc_name () ) ; let proc_names = List.fold new_proc_names ~init:old_proc_names ~f:(fun proc_names proc_name -> - if not (Caml.Hashtbl.mem existing_proc_names proc_name) then proc_name :: proc_names + if not (Stdlib.Hashtbl.mem existing_proc_names proc_name) then proc_name :: proc_names else proc_names ) in (Tenv.merge_per_file ~dst:old_tenv ~src:tenv, proc_names) diff --git a/infer/src/IR/SpecializeProcdesc.ml b/infer/src/IR/SpecializeProcdesc.ml index 9e36ae31565..bd72a19da30 100644 --- a/infer/src/IR/SpecializeProcdesc.ml +++ b/infer/src/IR/SpecializeProcdesc.ml @@ -24,7 +24,7 @@ let convert_cfg ~callee_pdesc ~resolved_pdesc ~f_instr_list = | node :: other_node -> let converted_node = try Procdesc.NodeMap.find node !node_map - with Caml.Not_found -> + with Stdlib.Not_found -> let new_node = convert_node node and successors = Procdesc.Node.get_succs node and exn_nodes = Procdesc.Node.get_exn node in @@ -59,7 +59,7 @@ let with_formals_types_proc callee_pdesc resolved_pdesc substitutions = in let subst_map = ref Ident.Map.empty in let redirect_typename origin_id = - try Some (Ident.Map.find origin_id !subst_map) with Caml.Not_found -> None + try Some (Ident.Map.find origin_id !subst_map) with Stdlib.Not_found -> None in let convert_instr = function | Sil.Load @@ -69,7 +69,7 @@ let with_formals_types_proc callee_pdesc resolved_pdesc substitutions = ; loc } -> let specialized_typname = try Mangled.Map.find (Pvar.get_name origin_pvar) substitutions - with Caml.Not_found -> origin_typename + with Stdlib.Not_found -> origin_typename in subst_map := Ident.Map.add id specialized_typname !subst_map ; let typ = mk_ptr_typ specialized_typname in @@ -78,7 +78,7 @@ let with_formals_types_proc callee_pdesc resolved_pdesc substitutions = {id; e= Exp.Var origin_id as origin_exp; typ= {Typ.desc= Tstruct _} as origin_typ; loc} -> let updated_typ : Typ.t = try Typ.mk ~default:origin_typ (Tstruct (Ident.Map.find origin_id !subst_map)) - with Caml.Not_found -> origin_typ + with Stdlib.Not_found -> origin_typ in Some (Sil.Load {id; e= convert_exp origin_exp; typ= updated_typ; loc}) | Sil.Load {id; e= origin_exp; typ; loc} -> diff --git a/infer/src/IR/Subtype.ml b/infer/src/IR/Subtype.ml index 160090e1a9f..eeda4465a2c 100644 --- a/infer/src/IR/Subtype.ml +++ b/infer/src/IR/Subtype.ml @@ -74,7 +74,7 @@ let check_subclass_tenv tenv c1 c2 : result = if is_root_class c2 then Yes else check c1 -module SubtypesMap = Caml.Map.Make (struct +module SubtypesMap = Stdlib.Map.Make (struct (* pair of subtypes *) type t = Typ.Name.t * Typ.Name.t [@@deriving compare] end) @@ -83,7 +83,7 @@ let check_subtype = let subtMap = ref SubtypesMap.empty in fun tenv c1 c2 : result -> try SubtypesMap.find (c1, c2) !subtMap - with Caml.Not_found -> + with Stdlib.Not_found -> let is_subt = check_subclass_tenv tenv c1 c2 in subtMap := SubtypesMap.add (c1, c2) is_subt !subtMap ; is_subt diff --git a/infer/src/IR/Tenv.ml b/infer/src/IR/Tenv.ml index 144f01a6f50..41bd8083baa 100644 --- a/infer/src/IR/Tenv.ml +++ b/infer/src/IR/Tenv.ml @@ -12,7 +12,7 @@ open Option.Monad_infix (** Module for Type Environments. *) (** Hash tables on type names. *) -module TypenameHash = Caml.Hashtbl.Make (Typ.Name) +module TypenameHash = Stdlib.Hashtbl.Make (Typ.Name) (** Type for type environment. *) type t = Struct.t TypenameHash.t @@ -47,7 +47,7 @@ let mk_struct tenv ?default ?fields ?statics ?methods ?exported_objc_methods ?su let lookup tenv name : Struct.t option = let result = try Some (TypenameHash.find tenv name) - with Caml.Not_found -> ( + with Stdlib.Not_found -> ( (* ToDo: remove the following additional lookups once C/C++ interop is resolved *) match (name : Typ.Name.t) with | CStruct m -> @@ -175,7 +175,7 @@ let get_parent tenv name = let get_fields_trans = - let module Fields = Caml.Set.Make (struct + let module Fields = Stdlib.Set.Make (struct type t = Struct.field let compare {Struct.name= x} {Struct.name= y} = diff --git a/infer/src/IR/Typ.ml b/infer/src/IR/Typ.ml index 5d139be892a..8e5e2fed5b8 100644 --- a/infer/src/IR/Typ.ml +++ b/infer/src/IR/Typ.ml @@ -9,7 +9,7 @@ (** The Smallfoot Intermediate Language: Types *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module L = Logging module F = Format diff --git a/infer/src/IR/Typ.mli b/infer/src/IR/Typ.mli index 9b9d433f1ba..89fa3f05fad 100644 --- a/infer/src/IR/Typ.mli +++ b/infer/src/IR/Typ.mli @@ -279,7 +279,7 @@ module Name : sig module Map : PrettyPrintable.PPMap with type key = t - module Hash : Caml.Hashtbl.S with type key = t + module Hash : Stdlib.Hashtbl.S with type key = t end val equal : t -> t -> bool diff --git a/infer/src/IR/WeakTopologicalOrder.ml b/infer/src/IR/WeakTopologicalOrder.ml index 8f00bcf37ba..a4b3ead83be 100644 --- a/infer/src/IR/WeakTopologicalOrder.ml +++ b/infer/src/IR/WeakTopologicalOrder.ml @@ -177,7 +177,7 @@ module Bourdoncle_SCC (CFG : PreProcCfg) = struct current strictly connected component. *) record_head node_dfn - | exception (Not_found_s _ | Caml.Not_found) -> + | exception (Not_found_s _ | Stdlib.Not_found) -> push_on_stack node in let rec process_stack partition = diff --git a/infer/src/IR/inferconfig.ml b/infer/src/IR/inferconfig.ml index 43d070cae0c..41458e5c074 100644 --- a/infer/src/IR/inferconfig.ml +++ b/infer/src/IR/inferconfig.ml @@ -53,7 +53,7 @@ module FileContainsStringMatcher = struct let file_contains regexp regexp_not_opt source_file = let rec loop regexp file_in = try Str.search_forward regexp (In_channel.input_line_exn file_in) 0 >= 0 with - | Caml.Not_found -> + | Stdlib.Not_found -> loop regexp file_in | End_of_file -> false @@ -120,7 +120,7 @@ module FileOrProcMatcher = struct ~f:(fun map pattern -> let previous = try String.Map.find_exn map pattern.class_name - with Not_found_s _ | Caml.Not_found -> [] + with Not_found_s _ | Stdlib.Not_found -> [] in String.Map.set ~key:pattern.class_name ~data:(pattern :: previous) map ) ~init:String.Map.empty m_patterns @@ -134,7 +134,7 @@ module FileOrProcMatcher = struct ~f:(fun p -> match p.method_name with None -> true | Some m -> String.equal m method_name ) class_patterns - with Not_found_s _ | Caml.Not_found -> false + with Not_found_s _ | Stdlib.Not_found -> false in fun _ proc_name -> match proc_name with Procname.Java pname_java -> do_java pname_java | _ -> false diff --git a/infer/src/absint/AbstractDomain.ml b/infer/src/absint/AbstractDomain.ml index aec93ce21f0..83528d3d525 100644 --- a/infer/src/absint/AbstractDomain.ml +++ b/infer/src/absint/AbstractDomain.ml @@ -603,7 +603,7 @@ module MapOfPPMap (M : PrettyPrintable.PPMap) (ValueDomain : S) = struct else M.for_all (fun k lhs_v -> - try ValueDomain.leq ~lhs:lhs_v ~rhs:(M.find k rhs) with Caml.Not_found -> false ) + try ValueDomain.leq ~lhs:lhs_v ~rhs:(M.find k rhs) with Stdlib.Not_found -> false ) lhs @@ -665,7 +665,7 @@ module InvertedMap (Key : PrettyPrintable.PrintableOrderedType) (ValueDomain : S if phys_equal lhs rhs then true else try for_all (fun k rhs_v -> ValueDomain.leq ~lhs:(find k lhs) ~rhs:rhs_v) rhs - with Caml.Not_found -> false + with Stdlib.Not_found -> false let inter ~f astate1 astate2 = diff --git a/infer/src/absint/AbstractDomain.mli b/infer/src/absint/AbstractDomain.mli index fdbaaedcf47..1f34a4862b7 100644 --- a/infer/src/absint/AbstractDomain.mli +++ b/infer/src/absint/AbstractDomain.mli @@ -210,7 +210,7 @@ end module MinReprSet (Element : PrettyPrintable.PrintableOrderedType) : sig type elt = Element.t - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include WithBottom with type t := t diff --git a/infer/src/absint/AbstractInterpreter.ml b/infer/src/absint/AbstractInterpreter.ml index 2f4eaf1cd1f..ecf65908e81 100644 --- a/infer/src/absint/AbstractInterpreter.ml +++ b/infer/src/absint/AbstractInterpreter.ml @@ -619,7 +619,7 @@ module AbstractInterpreterCommon (TransferFunctions : NodeTransferFunctions) = s Ok post with exn -> (* delay reraising to get a chance to write the debug HTML *) - let backtrace = Caml.Printexc.get_raw_backtrace () in + let backtrace = Stdlib.Printexc.get_raw_backtrace () in Error (exn, backtrace, instr) ) in match result with @@ -639,7 +639,7 @@ module AbstractInterpreterCommon (TransferFunctions : NodeTransferFunctions) = s (Sil.pp_instr ~print_types:true Pp.text) instr ; logged_error := true ) ) ; - Caml.Printexc.raise_with_backtrace exn backtrace + Stdlib.Printexc.raise_with_backtrace exn backtrace in (* hack to ensure that we call [exec_instr] on a node even if it has no instructions *) let instrs = if Instrs.is_empty instrs then Instrs.singleton Sil.skip_instr else instrs in diff --git a/infer/src/absint/AccessTree.ml b/infer/src/absint/AccessTree.ml index 55b95576450..f6b6519c70f 100644 --- a/infer/src/absint/AccessTree.ml +++ b/infer/src/absint/AccessTree.ml @@ -168,7 +168,7 @@ module Make (TraceDomain : AbstractDomain.WithBottom) (Config : Config) = struct (* input query was [ap]*, and [trace] is the trace associated with [ap]. get the traces associated with the children of [ap] in [tree] and join them with [trace] *) Some (join_all_traces trace subtree, subtree) - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> None @@ -186,7 +186,7 @@ module Make (TraceDomain : AbstractDomain.WithBottom) (Config : Config) = struct try let rhs_v = AccessMap.find k rhs_subtree in access_tree_lteq lhs_v rhs_v - with Caml.Not_found -> false ) + with Stdlib.Not_found -> false ) lhs_subtree | _, Star -> true @@ -202,7 +202,7 @@ module Make (TraceDomain : AbstractDomain.WithBottom) (Config : Config) = struct try let rhs_v = BaseMap.find k rhs in access_tree_lteq lhs_v rhs_v - with Caml.Not_found -> false ) + with Stdlib.Not_found -> false ) lhs @@ -293,7 +293,7 @@ module Make (TraceDomain : AbstractDomain.WithBottom) (Config : Config) = struct access_tree_add_trace_ ~seen_array_access accesses empty_starred_leaf depth' else let access_node = - try AccessMap.find access subtree with Caml.Not_found -> empty_normal_leaf + try AccessMap.find access subtree with Stdlib.Not_found -> empty_normal_leaf in (* once we encounter a subtree rooted in an array access, we have to do weak updates in the entire subtree. the reason: if I do x[i].f.g = , then @@ -323,7 +323,7 @@ module Make (TraceDomain : AbstractDomain.WithBottom) (Config : Config) = struct let is_exact = AccessPath.Abs.is_exact ap in let base_node = try BaseMap.find base tree - with Caml.Not_found -> + with Stdlib.Not_found -> (* note: we interpret max_depth <= 0 as max_depth = 1 *) if Config.max_depth > 1 then empty_normal_leaf else empty_starred_leaf in diff --git a/infer/src/absint/Errlog.ml b/infer/src/absint/Errlog.ml index c73e4ebdc26..971a8b7619a 100644 --- a/infer/src/absint/Errlog.ml +++ b/infer/src/absint/Errlog.ml @@ -6,7 +6,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module L = Logging module F = Format @@ -91,7 +91,7 @@ type err_data = let compare_err_data err_data1 err_data2 = Location.compare err_data1.loc err_data2.loc module ErrDataSet = (* set err_data with no repeated loc *) -Caml.Set.Make (struct +Stdlib.Set.Make (struct type t = err_data [@@deriving compare] end) @@ -184,7 +184,7 @@ let add_issue tbl err_key (err_datas : ErrDataSet.t) : bool = else ( ErrLogHash.replace tbl err_key (ErrDataSet.union err_datas current_eds) ; true ) - with Caml.Not_found | Not_found_s _ -> + with Stdlib.Not_found | Not_found_s _ -> ErrLogHash.add tbl err_key err_datas ; true diff --git a/infer/src/absint/Localise.ml b/infer/src/absint/Localise.ml index 2227382a4b1..af2931bf29a 100644 --- a/infer/src/absint/Localise.ml +++ b/infer/src/absint/Localise.ml @@ -104,7 +104,7 @@ let get_value_line_tag tags = let value = snd (List.find_exn ~f:(fun (tag, _) -> String.equal tag Tags.value) tags) in let line = snd (List.find_exn ~f:(fun (tag, _) -> String.equal tag Tags.line) tags) in Some [value; line] - with Not_found_s _ | Caml.Not_found -> None + with Not_found_s _ | Stdlib.Not_found -> None (** extract from desc a value on which to apply polymorphic hash and equality *) diff --git a/infer/src/absint/ProcCfg.ml b/infer/src/absint/ProcCfg.ml index 10d057cf8e3..2f6bb2cbcbc 100644 --- a/infer/src/absint/ProcCfg.ml +++ b/infer/src/absint/ProcCfg.ml @@ -227,7 +227,7 @@ module Exceptional = struct let add_exn_pred exn_preds_acc exn_succ_node = let exn_succ_node_id = Procdesc.Node.get_id exn_succ_node in let existing_exn_preds = - try Procdesc.IdMap.find exn_succ_node_id exn_preds_acc with Caml.Not_found -> [] + try Procdesc.IdMap.find exn_succ_node_id exn_preds_acc with Stdlib.Not_found -> [] in if not (List.mem ~equal:Procdesc.Node.equal existing_exn_preds n) then (* don't add duplicates *) @@ -252,7 +252,7 @@ module Exceptional = struct match Procdesc.IdMap.find (Procdesc.Node.get_id n) exn_pred_map with | exn_preds -> List.fold exn_preds ~init ~f - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> init diff --git a/infer/src/absint/Scheduler.ml b/infer/src/absint/Scheduler.ml index 83902ae94c4..e8503f4fb4e 100644 --- a/infer/src/absint/Scheduler.ml +++ b/infer/src/absint/Scheduler.ml @@ -97,7 +97,7 @@ module ReversePostorder (CFG : ProcCfg.S) = struct let node = WorkUnit.node max_priority_work in let t' = {t with worklist= M.remove (CFG.Node.id node) t.worklist} in Some (node, WorkUnit.visited_preds max_priority_work, t') - with Caml.Not_found -> None + with Stdlib.Not_found -> None let empty cfg = {worklist= M.empty; cfg} diff --git a/infer/src/backend/AnalysisDependencyGraph.ml b/infer/src/backend/AnalysisDependencyGraph.ml index 29b63de6cf3..c303f66124e 100644 --- a/infer/src/backend/AnalysisDependencyGraph.ml +++ b/infer/src/backend/AnalysisDependencyGraph.ml @@ -224,7 +224,7 @@ module Serialized = struct is_first := false ) coll in - let pp_proc_id_list fmt list = pp_proc_id_iter Caml.List.iter fmt list in + let pp_proc_id_list fmt list = pp_proc_id_iter Stdlib.List.iter fmt list in let pp_proc_id_set fmt set = pp_proc_id_iter Procname.Set.iter fmt set in Utils.with_file_out file ~f:(fun outf -> Printf.fprintf outf "schema_version=%d\n" schema_version ; diff --git a/infer/src/backend/GCStats.ml b/infer/src/backend/GCStats.ml index 8ebb15ce4e0..1d02fa70b96 100644 --- a/infer/src/backend/GCStats.ml +++ b/infer/src/backend/GCStats.ml @@ -8,7 +8,7 @@ open! IStd module F = Format module L = Logging -module Gc = Caml.Gc +module Gc = Stdlib.Gc (** a subset of {!Gc.stat} that can be aggregated across multiple processes *) type t = diff --git a/infer/src/backend/InferAnalyze.ml b/infer/src/backend/InferAnalyze.ml index dfbbc42e842..c20633d1422 100644 --- a/infer/src/backend/InferAnalyze.ml +++ b/infer/src/backend/InferAnalyze.ml @@ -34,8 +34,8 @@ let do_compaction_if_needed = Int64.(ns_since_last_compaction >= compaction_minimum_interval_ns) in fun () -> - let stat = Caml.Gc.quick_stat () in - let heap_words = stat.Caml.Gc.heap_words in + let stat = Stdlib.Gc.quick_stat () in + let heap_words = stat.Stdlib.Gc.heap_words in if heap_words >= compaction_if_heap_greater_equal_to_words && time_since_last_compaction_is_over_threshold () diff --git a/infer/src/backend/SourceFileGraph.ml b/infer/src/backend/SourceFileGraph.ml index 09a3f51f5ae..98e63856391 100644 --- a/infer/src/backend/SourceFileGraph.ml +++ b/infer/src/backend/SourceFileGraph.ml @@ -102,7 +102,7 @@ module G = struct g - module Cache = Caml.Hashtbl.Make (Vertex) + module Cache = Stdlib.Hashtbl.Make (Vertex) let vertex_name = (* hashtable from source files to strings of the form "N%d". Used for dot conversion only. *) diff --git a/infer/src/backend/Summary.ml b/infer/src/backend/Summary.ml index 3a44e66a7db..36cd640e996 100644 --- a/infer/src/backend/Summary.ml +++ b/infer/src/backend/Summary.ml @@ -179,7 +179,7 @@ let mk_full_summary payloads (report_summary : ReportSummary.t) module OnDisk = struct - module Hash = Caml.Hashtbl.Make (struct + module Hash = Stdlib.Hashtbl.Make (struct type t = Procname.t * AnalysisRequest.t [@@deriving equal, hash] end) @@ -272,7 +272,7 @@ module OnDisk = struct match Hash.find cache (proc_name, analysis_req) with | summary -> found_from_cache summary - | exception Caml.Not_found -> ( + | exception Stdlib.Not_found -> ( match (analysis_req : AnalysisRequest.t) with | All -> (* We already tried to find the cache for [All]. *) @@ -282,7 +282,7 @@ module OnDisk = struct match Hash.find cache (proc_name, analysis_req) with | summary -> found_from_cache summary - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> not_found_from_cache () ) ) diff --git a/infer/src/backend/printer.ml b/infer/src/backend/printer.ml index 098f26a4c53..74e9c5c73f5 100644 --- a/infer/src/backend/printer.ml +++ b/infer/src/backend/printer.ml @@ -7,7 +7,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl (** Printers for the analysis results *) @@ -185,7 +185,7 @@ end = struct try let set = Hashtbl.find err_per_line err_data.loc.Location.line in Hashtbl.replace err_per_line err_data.loc.Location.line (String.Set.add set err_str) - with Caml.Not_found -> + with Stdlib.Not_found -> Hashtbl.add err_per_line err_data.loc.Location.line (String.Set.singleton err_str) in Errlog.iter add_err err_log ; @@ -202,7 +202,7 @@ end = struct Procdesc.init_wto proc_desc ; let process_node n = let lnum = (Procdesc.Node.get_loc n).Location.line in - let curr_nodes = try Hashtbl.find table_nodes_at_linenum lnum with Caml.Not_found -> [] in + let curr_nodes = try Hashtbl.find table_nodes_at_linenum lnum with Stdlib.Not_found -> [] in Hashtbl.replace table_nodes_at_linenum lnum (n :: curr_nodes) in List.iter ~f:process_node (Procdesc.get_nodes proc_desc) ; @@ -246,12 +246,12 @@ end = struct else F.fprintf fmt "no summary for %s" proc_name_escaped | _ -> () ) - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> () ) ; ( match Hashtbl.find table_err_per_line line_number with | errset -> String.Set.iter errset ~f:(pp_err_message fmt) - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> () ) ; F.fprintf fmt "@\n" in @@ -290,7 +290,7 @@ end = struct if is_allow_listed file then ( let pdescs_in_file = try Hashtbl.find pdescs_in_source file - with Caml.Not_found -> Procname.Map.empty + with Stdlib.Not_found -> Procname.Map.empty in let pdescs_in_file = Procname.Map.add proc_name proc_desc pdescs_in_file in Hashtbl.replace pdescs_in_source file pdescs_in_file ; @@ -306,7 +306,7 @@ end = struct match Hashtbl.find pdescs_in_source file with | pdescs_map -> Procname.Map.bindings pdescs_map |> List.map ~f:snd - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> [] in DB.Results_dir.init file ; diff --git a/infer/src/backend/registerCheckers.ml b/infer/src/backend/registerCheckers.ml index f5c91589043..a1933532927 100644 --- a/infer/src/backend/registerCheckers.ml +++ b/infer/src/backend/registerCheckers.ml @@ -261,7 +261,7 @@ let register checkers = List.iter ~f:register_one checkers -module LanguageSet = Caml.Set.Make (Language) +module LanguageSet = Stdlib.Set.Make (Language) let pp_checker fmt {checker; callbacks} = let langs_of_callbacks = diff --git a/infer/src/base/CommandLineOption.ml b/infer/src/base/CommandLineOption.ml index d0d994175af..97144e1d1c5 100644 --- a/infer/src/base/CommandLineOption.ml +++ b/infer/src/base/CommandLineOption.ml @@ -181,7 +181,7 @@ let check_no_duplicates desc_list = let parse_mode_desc_lists = List.map ~f:(fun parse_mode -> (parse_mode, ref [])) all_of_parse_mode -module SectionMap = Caml.Map.Make (struct +module SectionMap = Stdlib.Map.Make (struct type t = String.t (* this must be the reverse of the order in which we want the sections to appear in the @@ -213,7 +213,7 @@ let add parse_mode sections desc = desc_list := desc :: !desc_list ; let add_to_section (command, section) = let sections = List.Assoc.find_exn ~equal:InferCommand.equal help_sections_desc_lists command in - let prev_contents = try SectionMap.find section !sections with Caml.Not_found -> [] in + let prev_contents = try SectionMap.find section !sections with Stdlib.Not_found -> [] in sections := SectionMap.add section (desc :: prev_contents) !sections in List.iter sections ~f:add_to_section ; @@ -980,7 +980,7 @@ let decode_inferconfig_to_argv path = in decode_json ~inferconfig_dir json_val @ result with - | Not_found_s _ | Caml.Not_found -> + | Not_found_s _ | Stdlib.Not_found -> warnf "WARNING: while reading config file %s:@\nUnknown option %s@." path key ; result | YSU.Type_error (msg, json) -> diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 8e3c5373156..6716280629d 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -113,7 +113,7 @@ let string_of_build_system build_system = let build_system_of_exe_name name = try List.Assoc.find_exn ~equal:String.equal (List.Assoc.inverse build_system_exe_assoc) name - with Not_found_s _ | Caml.Not_found -> + with Not_found_s _ | Stdlib.Not_found -> L.(die UserError) "Unsupported build command '%s'.@\n\ If this is an alias for another build system that infer supports, you can use@\n\ @@ -3762,7 +3762,7 @@ let post_parsing_initialization command_opt = match inferconfig_file with | Some inferconfig -> Printf.sprintf "version %s/inferconfig %s" Version.commit - (Caml.Digest.to_hex (Caml.Digest.file inferconfig)) + (Stdlib.Digest.to_hex (Stdlib.Digest.file inferconfig)) | None -> Version.commit in @@ -3798,7 +3798,7 @@ let post_parsing_initialization command_opt = in let suggest_keep_going = should_print_backtrace_default && not !keep_going in let backtrace = - if is_infer_exit_zero then "" else Caml.Printexc.raw_backtrace_to_string raw_backtrace + if is_infer_exit_zero then "" else Stdlib.Printexc.raw_backtrace_to_string raw_backtrace in let print_exception () = let error prefix msg = @@ -3834,7 +3834,7 @@ let post_parsing_initialization command_opt = Epilogues.run () ; Stdlib.exit exitcode in - Caml.Printexc.set_uncaught_exception_handler uncaught_exception_handler ; + Stdlib.Printexc.set_uncaught_exception_handler uncaught_exception_handler ; F.set_margin !margin ; let set_gc_params () = let ctrl = Gc.get () in diff --git a/infer/src/base/DB.ml b/infer/src/base/DB.ml index 1f77aae8766..1f7ebcbce5e 100644 --- a/infer/src/base/DB.ml +++ b/infer/src/base/DB.ml @@ -51,7 +51,7 @@ let source_dir_to_string source_dir = source_dir (** get the path to an internal file with the given extention (.tenv, ...) *) let source_dir_get_internal_file source_dir extension = let source_dir_name = - append_crc_cutoff (Caml.Filename.remove_extension (Filename.basename source_dir)) + append_crc_cutoff (Stdlib.Filename.remove_extension (Filename.basename source_dir)) in let fname = source_dir_name ^ extension in Filename.concat source_dir fname diff --git a/infer/src/base/DBWriter.ml b/infer/src/base/DBWriter.ml index e71dad43a8a..47ddb856d04 100644 --- a/infer/src/base/DBWriter.ml +++ b/infer/src/base/DBWriter.ml @@ -628,7 +628,7 @@ module Command = struct Implementation.update_report_summary ~proc_uid ~merge_report_summary end -type response = Ack | Error of (exn * Caml.Printexc.raw_backtrace) +type response = Ack | Error of (exn * Stdlib.Printexc.raw_backtrace) let server_pid : Pid.t option ref = ref None @@ -656,7 +656,7 @@ module Server = struct Command.execute command ; Marshal.to_channel out_channel Ack [] with exn -> - Marshal.to_channel out_channel (Error (exn, Caml.Printexc.get_raw_backtrace ())) [] ) ; + Marshal.to_channel out_channel (Error (exn, Stdlib.Printexc.get_raw_backtrace ())) [] ) ; Out_channel.flush out_channel ; In_channel.close in_channel ; let useful_time = ExecutionDuration.add_duration_since useful_time now in @@ -693,7 +693,7 @@ module Server = struct | Ack -> () | Error (exn, exn_backtrace) -> - Caml.Printexc.raise_with_backtrace exn exn_backtrace ) ; + Stdlib.Printexc.raise_with_backtrace exn exn_backtrace ) ; In_channel.close in_channel diff --git a/infer/src/base/Die.ml b/infer/src/base/Die.ml index 5401698cf6a..e5b7cfacb11 100644 --- a/infer/src/base/Die.ml +++ b/infer/src/base/Die.ml @@ -23,7 +23,7 @@ let raise_error ?backtrace error ~msg = | None -> raise exn | Some backtrace -> - Caml.Printexc.raise_with_backtrace exn backtrace + Stdlib.Printexc.raise_with_backtrace exn backtrace in match error with | ExternalError -> diff --git a/infer/src/base/Die.mli b/infer/src/base/Die.mli index d0242f3a219..e35b9e3791c 100644 --- a/infer/src/base/Die.mli +++ b/infer/src/base/Die.mli @@ -33,7 +33,7 @@ val log_uncaught_exception : exn -> exitcode:int -> unit val die : error -> ('a, Format.formatter, unit, _) format4 -> 'a (** Raise the corresponding exception. *) -val raise_error : ?backtrace:Caml.Printexc.raw_backtrace -> error -> msg:string -> 'a +val raise_error : ?backtrace:Stdlib.Printexc.raw_backtrace -> error -> msg:string -> 'a type style = Error | Fatal | Normal | Warning diff --git a/infer/src/base/Epilogues.ml b/infer/src/base/Epilogues.ml index c322637c16f..58deb8e1d09 100644 --- a/infer/src/base/Epilogues.ml +++ b/infer/src/base/Epilogues.ml @@ -43,7 +43,7 @@ let run () = exception Sigint (* Raise a specific exception when we get SIGINT (Control-C). *) -let () = Caml.Sys.(set_signal sigint (Signal_handle (fun _ -> raise Sigint))) +let () = Stdlib.Sys.(set_signal sigint (Signal_handle (fun _ -> raise Sigint))) let reset () = (early_callback := fun () -> ()) ; diff --git a/infer/src/base/LineReader.ml b/infer/src/base/LineReader.ml index 30ff1e541a8..b29da89fa34 100644 --- a/infer/src/base/LineReader.ml +++ b/infer/src/base/LineReader.ml @@ -7,7 +7,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl (** Map a file name to an array of string, one for each line in the file. *) type t = (SourceFile.t, string array) Hashtbl.t diff --git a/infer/src/base/Logging.ml b/infer/src/base/Logging.ml index 1ea39c6f70a..f4ecb8116d6 100644 --- a/infer/src/base/Logging.ml +++ b/infer/src/base/Logging.ml @@ -331,10 +331,10 @@ let log_of_kind error fmt = let die error msg = - let backtrace = Caml.Printexc.get_raw_backtrace () in + let backtrace = Stdlib.Printexc.get_raw_backtrace () in F.kasprintf (fun msg -> - log_of_kind error "%s@\n%s@." msg (Caml.Printexc.raw_backtrace_to_string backtrace) ; + log_of_kind error "%s@\n%s@." msg (Stdlib.Printexc.raw_backtrace_to_string backtrace) ; raise_error ~backtrace error ~msg ) msg diff --git a/infer/src/base/SourceFile.ml b/infer/src/base/SourceFile.ml index 3dbcae67361..4cd5fffb2f2 100644 --- a/infer/src/base/SourceFile.ml +++ b/infer/src/base/SourceFile.ml @@ -30,9 +30,9 @@ module T = struct type nonrec t = t [@@deriving compare, equal, hash, sexp] end -module Map = Caml.Map.Make (T) -module Set = Caml.Set.Make (T) -module Hash = Caml.Hashtbl.Make (T) +module Map = Stdlib.Map.Make (T) +module Set = Stdlib.Set.Make (T) +module Hash = Stdlib.Hashtbl.Make (T) module HashSet = HashSet.Make (T) let realpath_if_exists path = try Utils.realpath path with Unix.Unix_error _ -> path @@ -239,7 +239,7 @@ let exists_cache = String.Table.create ~size:256 () let path_exists abs_path = try String.Table.find_exn exists_cache abs_path - with Not_found_s _ | Caml.Not_found -> + with Not_found_s _ | Stdlib.Not_found -> let result = ISys.file_exists abs_path in String.Table.set exists_cache ~key:abs_path ~data:result ; result @@ -338,7 +338,7 @@ let is_matching patterns source_file = let path = to_rel_path source_file in List.exists ~f:(fun pattern -> - try Int.equal (Str.search_forward pattern path 0) 0 with Caml.Not_found -> false ) + try Int.equal (Str.search_forward pattern path 0) 0 with Stdlib.Not_found -> false ) patterns diff --git a/infer/src/base/SourceFile.mli b/infer/src/base/SourceFile.mli index 8c5c637d0ae..a38c9f796c5 100644 --- a/infer/src/base/SourceFile.mli +++ b/infer/src/base/SourceFile.mli @@ -10,13 +10,13 @@ open! IStd type t [@@deriving compare, sexp, hash, normalize] (** Maps from source_file *) -module Map : Caml.Map.S with type key = t +module Map : Stdlib.Map.S with type key = t (** Set of source files *) -module Set : Caml.Set.S with type elt = t +module Set : Stdlib.Set.S with type elt = t (** Mutable hash tables and sets keyed on source files *) -module Hash : Caml.Hashtbl.S with type key = t +module Hash : Stdlib.Hashtbl.S with type key = t module HashSet : HashSet.S with type elt = t diff --git a/infer/src/base/Stats.ml b/infer/src/base/Stats.ml index 7ad6bcaf14a..16ede080f88 100644 --- a/infer/src/base/Stats.ml +++ b/infer/src/base/Stats.ml @@ -99,7 +99,7 @@ module PulseSummaryCountMap = struct let pp fmt map = let bindings = bindings map in - (* already sorted because we use Caml.Map *) + (* already sorted because we use Stdlib.Map *) let pp_binding fmt (key, value) = F.fprintf fmt "%d: %d" key value in let pp_sep fmt () = F.pp_print_string fmt ", " in F.fprintf fmt "{ %a }" (F.pp_print_list ~pp_sep pp_binding) bindings diff --git a/infer/src/base/Timeable.ml b/infer/src/base/Timeable.ml index 669a1d98e72..6861df7e230 100644 --- a/infer/src/base/Timeable.ml +++ b/infer/src/base/Timeable.ml @@ -20,9 +20,9 @@ let to_string = function Checker checker -> Checker.get_id checker | Preanalysis let pp fmt timeable = F.pp_print_string fmt @@ to_string timeable -module Map = Caml.Map.Make (struct +module Map = Stdlib.Map.Make (struct type nonrec t = t [@@deriving compare] end) let mk_map_of_all ~init = - all |> Caml.List.to_seq |> Seq.map (fun timeable -> (timeable, init)) |> Map.of_seq + all |> Stdlib.List.to_seq |> Seq.map (fun timeable -> (timeable, init)) |> Map.of_seq diff --git a/infer/src/base/Timeable.mli b/infer/src/base/Timeable.mli index 63322cd17c4..22975f80c47 100644 --- a/infer/src/base/Timeable.mli +++ b/infer/src/base/Timeable.mli @@ -17,7 +17,7 @@ val to_string : t -> string val pp : F.formatter -> t -> unit -module Map : Caml.Map.S with type key = t +module Map : Stdlib.Map.S with type key = t val mk_map_of_all : init:'a -> 'a Map.t (** [mk_map_of_all ~init] is a map [timeable -> init] for all [timeable] keys *) diff --git a/infer/src/base/Utils.ml b/infer/src/base/Utils.ml index ac3dc1eba89..37d289c9554 100644 --- a/infer/src/base/Utils.ml +++ b/infer/src/base/Utils.ml @@ -8,7 +8,7 @@ open! IStd open PolyVariantEqual module F = Format -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module L = Die let fold_file_tree ~init ~f_dir ~f_reg ~path = @@ -208,7 +208,7 @@ let directory_iter f path = if Sys.is_directory path = `Yes then loop [path] else f path -let string_crc_hex32 s = Caml.Digest.to_hex (Caml.Digest.string s) +let string_crc_hex32 s = Stdlib.Digest.to_hex (Stdlib.Digest.string s) let read_json_file path = try Ok (Yojson.Safe.from_file path) with Sys_error msg | Yojson.Json_error msg -> Error msg @@ -320,7 +320,7 @@ let realpath_cache = Hashtbl.create 1023 let realpath ?(warn_on_error = true) path = match Hashtbl.find realpath_cache path with - | exception Caml.Not_found -> ( + | exception Stdlib.Not_found -> ( match Filename.realpath path with | realpath -> Hashtbl.add realpath_cache path (Ok realpath) ; @@ -409,7 +409,7 @@ let rm_all_in_dir ?except name = rm_all_in_dir_ ?except name |> ignore let rmtree ?except name = rmtree_ ?except name |> ignore -let better_hash x = Marshal.to_string x [Marshal.No_sharing] |> Caml.Digest.string +let better_hash x = Marshal.to_string x [Marshal.No_sharing] |> Stdlib.Digest.string let unlink_file_on_exit temp_file = let description = "Cleaning temporary file " ^ temp_file in diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index dab2ec1cb27..265dc96d16c 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -112,7 +112,7 @@ val rm_all_in_dir : ?except:string list -> string -> unit val iter_dir : string -> f:(string -> unit) -> unit (** iterate on each entry in the directory except for "." and ".." *) -val better_hash : 'a -> Caml.Digest.t +val better_hash : 'a -> Stdlib.Digest.t (** Hashtbl.hash only hashes the first 10 meaningful values, [better_hash] uses everything. *) val unlink_file_on_exit : string -> unit diff --git a/infer/src/biabduction/Abs.ml b/infer/src/biabduction/Abs.ml index 2ecac084ef8..6ab965c3b46 100644 --- a/infer/src/biabduction/Abs.ml +++ b/infer/src/biabduction/Abs.ml @@ -63,7 +63,7 @@ let create_condition_ls ids_private id_base p_leftover (inst : Predicates.subst) let insts_of_public_ids = Predicates.sub_range inst_public in let inst_of_base = try Predicates.sub_find (Ident.equal id_base) inst_public - with Not_found_s _ | Caml.Not_found -> assert false + with Not_found_s _ | Stdlib.Not_found -> assert false in let insts_of_private_ids = Predicates.sub_range inst_private in (insts_of_private_ids, insts_of_public_ids, inst_of_base) @@ -216,7 +216,7 @@ let mk_rule_lsls_ls tenv k1 k2 impl_ok1 impl_ok2 para = let find x = sub_find (equal x) inst in try (find id_base, find id_next, find id_end) - with Not_found_s _ | Caml.Not_found -> assert false in + with Not_found_s _ | Stdlib.Not_found -> assert false in let spooky_case _ = (equal_lseg_kind Lseg_PE k_res) && (check_allocatedness p_leftover inst_end) @@ -1225,7 +1225,7 @@ let abstract_spec ({InterproceduralAnalysis.tenv; _} as analysis_data) spec = (* TODO(rgrigore): [Prover.check_implication] gives up immediately if the consequence contains a disequality. As a workaround, here we drop pure facts from the consequent that are known to be true. *) - let module AtomSet = Caml.Set.Make (struct + let module AtomSet = Stdlib.Set.Make (struct type t = Predicates.atom let compare = Predicates.compare_atom diff --git a/infer/src/biabduction/Absarray.ml b/infer/src/biabduction/Absarray.ml index f2e277edd72..ab4ec8c9f59 100644 --- a/infer/src/biabduction/Absarray.ml +++ b/infer/src/biabduction/Absarray.ml @@ -49,7 +49,7 @@ module StrexpMatch : sig type t val find_path : sigma -> path -> t - (** Find a strexp at the given path. Can raise [Not_found_s/Caml.Not_found] *) + (** Find a strexp at the given path. Can raise [Not_found_s/Stdlib.Not_found] *) val find : Tenv.t -> sigma -> (strexp_data -> bool) -> t list (** Find a strexp with the given property. *) @@ -166,14 +166,14 @@ end = struct (** Store hpred using physical equality, and offset list for an array *) type t = sigma * Predicates.hpred * syn_offset list - (** Find an array at the given path. Can raise [Not_found_s/Caml.Not_found] *) + (** Find an array at the given path. Can raise [Not_found_s/Stdlib.Not_found] *) let find_path sigma (root, syn_offs) : t = let filter = function Predicates.Hpointsto (e, _, _) -> Exp.equal root e | _ -> false in let hpred = List.find_exn ~f:filter sigma in (sigma, hpred, syn_offs) - (** Find a sub strexp with the given property. Can raise [Not_found_s/Caml.Not_found] *) + (** Find a sub strexp with the given property. Can raise [Not_found_s/Stdlib.Not_found] *) let find tenv (sigma : sigma) (pred : strexp_data -> bool) : t list = let found = ref [] in let rec find_offset_sexp sigma_other hpred root offs se (typ : Typ.t) = @@ -361,7 +361,7 @@ let generic_strexp_abstract tenv (abstraction_name : string) (p_in : Prop.normal let match_select_next (matchings_cur, matchings_fp) = match (matchings_cur, matchings_fp) with | [], [] -> - raise Caml.Not_found + raise Stdlib.Not_found | matched :: cur', fp' -> (matched, false, (cur', fp')) | [], matched :: fp' -> @@ -375,7 +375,7 @@ let generic_strexp_abstract tenv (abstraction_name : string) (p_in : Prop.normal let strexp_data = StrexpMatch.get_data tenv matched in let p1, changed = do_abstract footprint_part p0 strexp_data in if changed then (p1, true) else match_abstract p0 matchings_cur_fp' - with Caml.Not_found -> (p0, false) + with Stdlib.Not_found -> (p0, false) in let rec find_then_abstract bound p0 = if Int.equal bound 0 then p0 @@ -433,7 +433,7 @@ let blur_array_index tenv (p : Prop.normal Prop.t) (path : StrexpMatch.path) (in let sigma_fp' = StrexpMatch.replace_index tenv true matched_fp index fresh_index in Prop.set p ~sigma_fp:sigma_fp' else Prop.expose p - with Not_found_s _ | Caml.Not_found -> Prop.expose p + with Not_found_s _ | Stdlib.Not_found -> Prop.expose p in let p3 = let matched = StrexpMatch.find_path p.Prop.sigma path in @@ -447,7 +447,7 @@ let blur_array_index tenv (p : Prop.normal Prop.t) (path : StrexpMatch.path) (in prop_replace_path_index tenv p3 path map in Prop.normalize tenv p4 - with Not_found_s _ | Caml.Not_found -> p + with Not_found_s _ | Stdlib.Not_found -> p (** Given [p] containing an array at [root], blur [indices] in it *) @@ -476,7 +476,7 @@ let keep_only_indices tenv (p : Prop.normal Prop.t) (path : StrexpMatch.path) (i (sigma', true) | _ -> (sigma, false) - with Not_found_s _ | Caml.Not_found -> (sigma, false) + with Not_found_s _ | Stdlib.Not_found -> (sigma, false) in prop_update_sigma_and_fp_sigma tenv p prune_sigma diff --git a/infer/src/biabduction/BiabductionSummary.ml b/infer/src/biabduction/BiabductionSummary.ml index a6d935a12fd..4c3836e7e92 100644 --- a/infer/src/biabduction/BiabductionSummary.ml +++ b/infer/src/biabduction/BiabductionSummary.ml @@ -150,7 +150,7 @@ end (***** End of module Jprop *****) module Visitedset = struct - include Caml.Set.Make (struct + include Stdlib.Set.Make (struct type t = Procdesc.Node.id * int list let compare (node_id1, _) (node_id2, _) = Procdesc.Node.compare_id node_id1 node_id2 diff --git a/infer/src/biabduction/BiabductionSummary.mli b/infer/src/biabduction/BiabductionSummary.mli index 1848eb0dc6e..1048b88ae77 100644 --- a/infer/src/biabduction/BiabductionSummary.mli +++ b/infer/src/biabduction/BiabductionSummary.mli @@ -45,7 +45,7 @@ module Jprop : sig end (** set of visited nodes: node id and list of lines of all the instructions *) -module Visitedset : Caml.Set.S with type elt = Procdesc.Node.id * int list +module Visitedset : Stdlib.Set.S with type elt = Procdesc.Node.id * int list (** A spec consists of: diff --git a/infer/src/biabduction/Builtin.ml b/infer/src/biabduction/Builtin.ml index 4d0f2277547..d43f73b2d6d 100644 --- a/infer/src/biabduction/Builtin.ml +++ b/infer/src/biabduction/Builtin.ml @@ -38,7 +38,7 @@ let check_register_populated () = (** get the symbolic execution handler associated to the builtin function name *) let get name : t option = try Some (Procname.Hash.find builtin_functions name) - with Caml.Not_found -> + with Stdlib.Not_found -> check_register_populated () ; None diff --git a/infer/src/biabduction/BuiltinDefn.ml b/infer/src/biabduction/BuiltinDefn.ml index 62993f5f9b0..c77c4403a6f 100644 --- a/infer/src/biabduction/BuiltinDefn.ml +++ b/infer/src/biabduction/BuiltinDefn.ml @@ -726,7 +726,7 @@ let execute___split_get_nth let n_part = List.nth_exn parts n in let res = Exp.Const (Const.Cstr n_part) in [(return_result tenv res prop ret_id_typ, path)] - with Caml.Not_found -> assert false ) + with Stdlib.Not_found -> assert false ) | _ -> [(prop, path)] ) | _ -> diff --git a/infer/src/biabduction/Dom.ml b/infer/src/biabduction/Dom.ml index 62e2e228cfa..9c2d7196ed7 100644 --- a/infer/src/biabduction/Dom.ml +++ b/infer/src/biabduction/Dom.ml @@ -7,7 +7,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl (** Operators for the abstract domain. In particular, join and meet. *) @@ -95,7 +95,7 @@ end = struct match e with | Exp.Var _ -> ( try Hashtbl.find tbl e - with Caml.Not_found -> + with Stdlib.Not_found -> Hashtbl.replace tbl e default ; default ) | _ -> @@ -716,7 +716,7 @@ end = struct List.iter ~f:handle_triple !tbl ; let rep x = try H.find rep_cache (get x) - with Caml.Not_found -> L.die L.InternalError "Dom.Rename.get_unify_eqs broken" + with Stdlib.Not_found -> L.die L.InternalError "Dom.Rename.get_unify_eqs broken" in rep in diff --git a/infer/src/biabduction/Exceptions.ml b/infer/src/biabduction/Exceptions.ml index c8aa2e07aa8..63b16e9e685 100644 --- a/infer/src/biabduction/Exceptions.ml +++ b/infer/src/biabduction/Exceptions.ml @@ -163,7 +163,7 @@ let recognize_exception exn : IssueToReport.t = | exn -> { issue_type= IssueType.failure_exe ; description= - Localise.verbatim_desc (F.asprintf "%a: %s" Exn.pp exn (Caml.Printexc.get_backtrace ())) + Localise.verbatim_desc (F.asprintf "%a: %s" Exn.pp exn (Stdlib.Printexc.get_backtrace ())) ; ocaml_pos= None } diff --git a/infer/src/biabduction/Paths.ml b/infer/src/biabduction/Paths.ml index e0b93a7c5a4..9d79ca9a4ed 100644 --- a/infer/src/biabduction/Paths.ml +++ b/infer/src/biabduction/Paths.ml @@ -366,7 +366,7 @@ end = struct try let n = Procdesc.NodeMap.find node !map in map := Procdesc.NodeMap.add node (n + 1) !map - with Caml.Not_found -> map := Procdesc.NodeMap.add node 1 !map ) + with Stdlib.Not_found -> map := Procdesc.NodeMap.add node 1 !map ) | None -> () in @@ -390,7 +390,7 @@ end = struct Invariant.reset_stats path - module PathMap = Caml.Map.Make (struct + module PathMap = Stdlib.Map.Make (struct type nonrec t = t [@@deriving compare] end) @@ -399,7 +399,7 @@ end = struct let delayed = ref PathMap.empty in let add_path p = try ignore (PathMap.find p !delayed) - with Caml.Not_found -> + with Stdlib.Not_found -> incr delayed_num ; delayed := PathMap.add p !delayed_num !delayed in @@ -424,10 +424,10 @@ end = struct in let rec doit n fmt path = try - if n > 0 then raise Caml.Not_found ; + if n > 0 then raise Stdlib.Not_found ; let num = PathMap.find path !delayed in F.fprintf fmt "P%d" num - with Caml.Not_found -> ( + with Stdlib.Not_found -> ( match path with | Pstart (node, _) -> F.fprintf fmt "n%a" Procdesc.Node.pp node @@ -560,7 +560,7 @@ end (* =============== END of the Path module ===============*) -module PropMap = Caml.Map.Make (struct +module PropMap = Stdlib.Map.Make (struct type t = Prop.normal Prop.t let compare = Prop.compare_prop @@ -657,7 +657,7 @@ end = struct try let path_old = PropMap.find p ps in Path.join path_old path - with Caml.Not_found -> path + with Stdlib.Not_found -> path in PropMap.add p path_new ps @@ -681,7 +681,7 @@ end = struct let path_old = PropMap.find p !res in if path_nodes_subset path path_old (* do not propagate new path if it has no new nodes *) then res := PropMap.remove p !res - with Caml.Not_found -> res := PropMap.remove p !res + with Stdlib.Not_found -> res := PropMap.remove p !res in PropMap.iter rem ps2 ; !res diff --git a/infer/src/biabduction/Predicates.ml b/infer/src/biabduction/Predicates.ml index 329ae00843d..255d066186a 100644 --- a/infer/src/biabduction/Predicates.ml +++ b/infer/src/biabduction/Predicates.ml @@ -6,7 +6,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module F = Format module L = Logging @@ -137,7 +137,7 @@ let equal_hpara_dll = [%compare.equal: hpara_dll] let is_objc_object = function Hpointsto (_, _, Sizeof {typ}) -> Typ.is_objc_class typ | _ -> false (** Sets of heap predicates *) -module HpredSet = Caml.Set.Make (struct +module HpredSet = Stdlib.Set.Make (struct type t = hpred let compare = compare_hpred ~inst:false @@ -858,7 +858,7 @@ let sub_symmetric_difference sub1_in sub2_in = (** [sub_find filter sub] returns the expression associated to the first identifier that satisfies - [filter]. Raise [Not_found_s/Caml.Not_found] if there isn't one. *) + [filter]. Raise [Not_found_s/Stdlib.Not_found] if there isn't one. *) let sub_find filter (sub : subst) = snd (List.find_exn ~f:(fun (i, _) -> filter i) sub) (** [sub_filter filter sub] restricts the domain of [sub] to the identifiers satisfying [filter]. *) @@ -1053,7 +1053,7 @@ let create_sharing_env () = {exph= Exp.Hash.create 3; hpredh= HpredInstHash.crea (** Return a canonical representation of the exp *) let exp_compact sh e = try Exp.Hash.find sh.exph e - with Caml.Not_found -> + with Stdlib.Not_found -> Exp.Hash.add sh.exph e e ; e @@ -1084,7 +1084,7 @@ let hpred_compact_ sh hpred = let hpred_compact sh hpred = try HpredInstHash.find sh.hpredh hpred - with Caml.Not_found -> + with Stdlib.Not_found -> let hpred' = hpred_compact_ sh hpred in HpredInstHash.add sh.hpredh hpred' hpred' ; hpred' diff --git a/infer/src/biabduction/Predicates.mli b/infer/src/biabduction/Predicates.mli index e9c0fca1e74..b89cbb209a8 100644 --- a/infer/src/biabduction/Predicates.mli +++ b/infer/src/biabduction/Predicates.mli @@ -162,7 +162,7 @@ val equal_hpred : ?inst:bool -> hpred -> hpred -> bool be considered (false by default). *) (** Sets of heap predicates *) -module HpredSet : Caml.Set.S with type elt = hpred +module HpredSet : Stdlib.Set.S with type elt = hpred (** {2 Compaction} *) @@ -301,7 +301,7 @@ val sub_symmetric_difference : subst -> subst -> subst * subst * subst val sub_find : (Ident.t -> bool) -> subst -> Exp.t (** [sub_find filter sub] returns the expression associated to the first identifier that satisfies - [filter]. Raise [Not_found_s/Caml.Not_found] if there isn't one. *) + [filter]. Raise [Not_found_s/Stdlib.Not_found] if there isn't one. *) val sub_filter : (Ident.t -> bool) -> subst -> subst (** [sub_filter filter sub] restricts the domain of [sub] to the identifiers satisfying [filter]. *) diff --git a/infer/src/biabduction/Prop.ml b/infer/src/biabduction/Prop.ml index d52ac7a61b3..e1ded47adc0 100644 --- a/infer/src/biabduction/Prop.ml +++ b/infer/src/biabduction/Prop.ml @@ -226,7 +226,7 @@ let get_pure_extended p = let old_id = Ident.Map.find pid primed_map in let new_atom = Predicates.Aeq (Var id, Var old_id) in (new_atom :: atoms, primed_map) - with Caml.Not_found -> (atoms, Ident.Map.add pid id primed_map) + with Stdlib.Not_found -> (atoms, Ident.Map.add pid id primed_map) in match base_atom with | Predicates.Aeq (Exp.Var id0, Exp.Var id1) @@ -2105,14 +2105,14 @@ let compute_renaming free_vars = let rec idlist_assoc id = function | [] -> - raise Caml.Not_found + raise Stdlib.Not_found | (i, x) :: l -> if Ident.equal i id then x else idlist_assoc id l let ident_captured_ren ren id = (* If not defined in ren, id should be mapped to itself *) - try idlist_assoc id ren with Caml.Not_found -> id + try idlist_assoc id ren with Stdlib.Not_found -> id let rec exp_captured_ren ren (e : Exp.t) : Exp.t = diff --git a/infer/src/biabduction/Propset.ml b/infer/src/biabduction/Propset.ml index 63533b106ca..eb26642af5b 100644 --- a/infer/src/biabduction/Propset.ml +++ b/infer/src/biabduction/Propset.ml @@ -12,7 +12,7 @@ open! IStd (** {2 Sets of Propositions} *) -module PropSet = Caml.Set.Make (struct +module PropSet = Stdlib.Set.Make (struct type t = Prop.normal Prop.t let compare = Prop.compare_prop diff --git a/infer/src/biabduction/Prover.ml b/infer/src/biabduction/Prover.ml index ab92089ae1e..00185f5c913 100644 --- a/infer/src/biabduction/Prover.ml +++ b/infer/src/biabduction/Prover.ml @@ -321,13 +321,13 @@ end = struct try let old_upper = Exp.Map.find e umap in if IntLit.leq old_upper new_upper then umap else Exp.Map.add e new_upper umap - with Caml.Not_found -> Exp.Map.add e new_upper umap + with Stdlib.Not_found -> Exp.Map.add e new_upper umap in let lmap_add lmap e new_lower = try let old_lower = Exp.Map.find e lmap in if IntLit.geq old_lower new_lower then lmap else Exp.Map.add e new_lower lmap - with Caml.Not_found -> Exp.Map.add e new_lower lmap + with Stdlib.Not_found -> Exp.Map.add e new_lower lmap in let rec umap_create_from_leqs umap = function | [] -> @@ -357,7 +357,7 @@ end = struct let new_upper1 = upper2 ++ n in let new_umap = umap_add umap e1 new_upper1 in umap_improve_by_difference_constraints new_umap constrs_rest - with Caml.Not_found -> umap_improve_by_difference_constraints umap constrs_rest ) + with Stdlib.Not_found -> umap_improve_by_difference_constraints umap constrs_rest ) in let rec lmap_improve_by_difference_constraints lmap = function | [] -> @@ -370,7 +370,7 @@ end = struct let new_lower2 = lower1 -- n -- IntLit.one in let new_lmap = lmap_add lmap e2 new_lower2 in lmap_improve_by_difference_constraints new_lmap constrs_rest - with Caml.Not_found -> lmap_improve_by_difference_constraints lmap constrs_rest ) + with Stdlib.Not_found -> lmap_improve_by_difference_constraints lmap constrs_rest ) in let leqs_res = let umap = umap_create_from_leqs Exp.Map.empty leqs in @@ -832,7 +832,7 @@ let get_smt_key a p = let fmt_tmp = F.formatter_of_out_channel outc_tmp in let () = F.fprintf fmt_tmp "%a%a" (Predicates.pp_atom Pp.text) a (Prop.pp_prop Pp.text) p in Out_channel.close outc_tmp ; - Caml.Digest.to_hex (Caml.Digest.file tmp_filename) + Stdlib.Digest.to_hex (Stdlib.Digest.file tmp_filename) (** Check whether [prop |- a]. False means dont know. *) diff --git a/infer/src/biabduction/Rearrange.ml b/infer/src/biabduction/Rearrange.ml index 901274d17d3..60dded709ff 100644 --- a/infer/src/biabduction/Rearrange.ml +++ b/infer/src/biabduction/Rearrange.ml @@ -1134,7 +1134,7 @@ let attr_has_annot is_annotation tenv prop exp = None in try List.find_map ~f:attr_has_annot (Attribute.get_for_exp tenv prop exp) - with Not_found_s _ | Caml.Not_found -> None + with Not_found_s _ | Stdlib.Not_found -> None let is_strexp_pt_fld_with_annot tenv obj_str is_annotation typ deref_exp (fld, strexp) = diff --git a/infer/src/biabduction/RetainCyclesType.ml b/infer/src/biabduction/RetainCyclesType.ml index 4e43e4894b3..85793e17c39 100644 --- a/infer/src/biabduction/RetainCyclesType.ml +++ b/infer/src/biabduction/RetainCyclesType.ml @@ -49,7 +49,7 @@ let compare (rc1 : t) (rc2 : t) = List.compare compare_retain_cycle_edge rc1.rc_elements rc2.rc_elements -module Set = Caml.Set.Make (struct +module Set = Stdlib.Set.Make (struct type nonrec t = t [@@deriving compare] end) diff --git a/infer/src/biabduction/RetainCyclesType.mli b/infer/src/biabduction/RetainCyclesType.mli index ccfd1d60a9f..23895b1af0c 100644 --- a/infer/src/biabduction/RetainCyclesType.mli +++ b/infer/src/biabduction/RetainCyclesType.mli @@ -20,7 +20,7 @@ type retain_cycle_edge = Object of retain_cycle_edge_obj | Block of Procname.t * type t = {rc_head: retain_cycle_edge; rc_elements: retain_cycle_edge list} (** Set for retain cycles. *) -module Set : Caml.Set.S with type elt = t +module Set : Stdlib.Set.S with type elt = t val d_retain_cycle : t -> unit diff --git a/infer/src/biabduction/State.ml b/infer/src/biabduction/State.ml index ca6d9dce944..b3f8db0a9bc 100644 --- a/infer/src/biabduction/State.ml +++ b/infer/src/biabduction/State.ml @@ -54,7 +54,7 @@ let reset () = gs := initial () let get_failure_stats node = try NodeHash.find !gs.failure_map node - with Caml.Not_found -> + with Stdlib.Not_found -> let fs = {instr_fail= 0; instr_ok= 0; node_fail= 0; node_ok= 0; first_failure= None} in NodeHash.add !gs.failure_map node fs ; fs diff --git a/infer/src/biabduction/SymExec.ml b/infer/src/biabduction/SymExec.ml index 7d4e91b85b9..891d47cfe19 100644 --- a/infer/src/biabduction/SymExec.ml +++ b/infer/src/biabduction/SymExec.ml @@ -15,7 +15,7 @@ module F = Format let rec fldlist_assoc fld = function | [] -> - raise Caml.Not_found + raise Stdlib.Not_found | {Struct.name= fld'; typ= x} :: l -> if Fieldname.equal fld fld' then x else fldlist_assoc fld l @@ -33,7 +33,7 @@ let unroll_type tenv (typ : Typ.t) (off : Predicates.offset) = | Tstruct name, Off_fld (fld, _) -> ( match Tenv.lookup tenv name with | Some {fields; statics} -> ( - try fldlist_assoc fld (fields @ statics) with Caml.Not_found -> fail Fieldname.pp fld ) + try fldlist_assoc fld (fields @ statics) with Stdlib.Not_found -> fail Fieldname.pp fld ) | None -> fail Fieldname.pp fld ) | Tarray {elt}, Off_index _ -> diff --git a/infer/src/biabduction/Tabulation.ml b/infer/src/biabduction/Tabulation.ml index 152387e5f65..5f8a7773501 100644 --- a/infer/src/biabduction/Tabulation.ml +++ b/infer/src/biabduction/Tabulation.ml @@ -107,7 +107,7 @@ let spec_find_rename proc_attrs specs : List.map ~f:(fun (x, _, _) -> Pvar.mk_callee x proc_name) proc_attrs.ProcAttributes.formals in (List.map ~f:rename_vars specs, formal_parameters) - with Caml.Not_found -> + with Stdlib.Not_found -> L.d_printfln "ERROR: found no entry for procedure %a. Give up..." Procname.pp proc_name ; raise (Exceptions.Precondition_not_found diff --git a/infer/src/biabduction/Timeout.ml b/infer/src/biabduction/Timeout.ml index df6cc45d909..7e8bba54163 100644 --- a/infer/src/biabduction/Timeout.ml +++ b/infer/src/biabduction/Timeout.ml @@ -81,8 +81,8 @@ let register_timeout_handlers = already_registered := true ; (* Can't use Core since it wraps signal handlers and alarms with catch-all exception handlers that exit, while we need to propagate the timeout exceptions. *) - let module Gc = Caml.Gc in - let module Sys = Caml.Sys in + let module Gc = Stdlib.Gc in + let module Sys = Stdlib.Sys in match Config.os_type with | Config.Unix | Config.Cygwin -> Sys.set_signal Sys.sigvtalrm (Sys.Signal_handle timeout_action) ; diff --git a/infer/src/biabduction/interproc.ml b/infer/src/biabduction/interproc.ml index f09b0e6d234..6b654e6505a 100644 --- a/infer/src/biabduction/interproc.ml +++ b/infer/src/biabduction/interproc.ml @@ -7,7 +7,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl (** Interprocedural Analysis *) @@ -18,7 +18,7 @@ module F = Format type visitednode = {node: Procdesc.Node.t; visits: int} (** Set of nodes with number of visits *) -module NodeVisitSet = Caml.Set.Make (struct +module NodeVisitSet = Stdlib.Set.Make (struct type t = visitednode let compare_ids n1 n2 = @@ -75,7 +75,7 @@ end = struct let create () : t = Hashtbl.create 11 - let find table i = try Hashtbl.find table i with Caml.Not_found -> Paths.PathSet.empty + let find table i = try Hashtbl.find table i with Stdlib.Not_found -> Paths.PathSet.empty let add table i dset = Hashtbl.replace table i dset end @@ -102,7 +102,7 @@ module Worklist = struct let add (wl : t) (node : Procdesc.Node.t) : unit = let visits = (* recover visit count if it was visited before *) - try Procdesc.NodeMap.find node wl.visit_map with Caml.Not_found -> 0 + try Procdesc.NodeMap.find node wl.visit_map with Stdlib.Not_found -> 0 in wl.todo_set <- NodeVisitSet.add {node; visits} wl.todo_set @@ -115,7 +115,7 @@ module Worklist = struct wl.visit_map <- Procdesc.NodeMap.add min.node (min.visits + 1) wl.visit_map ; (* increase the visits *) min.node - with Caml.Not_found -> + with Stdlib.Not_found -> L.internal_error "@\n...Work list is empty! Impossible to remove edge...@\n" ; assert false end @@ -132,7 +132,7 @@ let path_set_create_worklist proc_cfg = let htable_retrieve (htable : (Procdesc.Node.id, Paths.PathSet.t) Hashtbl.t) (key : Procdesc.Node.id) : Paths.PathSet.t = try Hashtbl.find htable key - with Caml.Not_found -> + with Stdlib.Not_found -> Hashtbl.replace htable key Paths.PathSet.empty ; Paths.PathSet.empty @@ -160,7 +160,7 @@ let path_set_checkout_todo (wl : Worklist.t) (node : Procdesc.Node.t) : Paths.Pa let new_visited = Paths.PathSet.union visited todo in Hashtbl.replace wl.Worklist.path_set_visited node_id new_visited ; todo - with Caml.Not_found -> + with Stdlib.Not_found -> L.die InternalError "could not find todo for node %a" Procdesc.Node.pp node @@ -917,7 +917,7 @@ let report_custom_errors {InterproceduralAnalysis.proc_desc; err_log; tenv} summ List.iter ~f:report error_preconditions -module SpecMap = Caml.Map.Make (struct +module SpecMap = Stdlib.Map.Make (struct type t = Prop.normal BiabductionSummary.Jprop.t let compare = BiabductionSummary.Jprop.compare @@ -967,7 +967,7 @@ let update_specs analysis_data prev_summary_opt phase current_specs := SpecMap.add spec.BiabductionSummary.pre (new_post, new_visited) (SpecMap.remove spec.BiabductionSummary.pre !current_specs) ) - with Caml.Not_found -> + with Stdlib.Not_found -> changed := true ; current_specs := SpecMap.add spec.BiabductionSummary.pre diff --git a/infer/src/bufferoverrun/arrayBlk.ml b/infer/src/bufferoverrun/arrayBlk.ml index 4b88d81c782..d78d53c63dc 100644 --- a/infer/src/bufferoverrun/arrayBlk.ml +++ b/infer/src/bufferoverrun/arrayBlk.ml @@ -336,7 +336,7 @@ let diff : t -> t -> Itv.t = match find k arr1 with | a1 -> Itv.join acc (ArrInfo.diff a1 a2) - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> Itv.top in fold diff_join arr2 Itv.bot diff --git a/infer/src/bufferoverrun/bufferOverrunAnalysis.ml b/infer/src/bufferoverrun/bufferOverrunAnalysis.ml index 129599d90c2..5e1946e16b5 100644 --- a/infer/src/bufferoverrun/bufferOverrunAnalysis.ml +++ b/infer/src/bufferoverrun/bufferOverrunAnalysis.ml @@ -135,7 +135,7 @@ module TransferFunctions = struct Some loc | _ -> None - with Not_found_s _ | Caml.Not_found -> None ) + with Not_found_s _ | Stdlib.Not_found -> None ) in match Dom.Mem.find_ret_alias callee_exit_mem with | Bottom -> diff --git a/infer/src/bufferoverrun/bufferOverrunOndemandEnv.ml b/infer/src/bufferoverrun/bufferOverrunOndemandEnv.ml index 0aa7e013178..b5f235bd048 100644 --- a/infer/src/bufferoverrun/bufferOverrunOndemandEnv.ml +++ b/infer/src/bufferoverrun/bufferOverrunOndemandEnv.ml @@ -9,7 +9,7 @@ open! IStd module L = Logging module BoField = BufferOverrunField module SPath = Symb.SymbolPath -module FormalTyps = Caml.Map.Make (Pvar) +module FormalTyps = Stdlib.Map.Make (Pvar) type t = { tenv: Tenv.t diff --git a/infer/src/bufferoverrun/bufferOverrunSemantics.ml b/infer/src/bufferoverrun/bufferOverrunSemantics.ml index 3c5f8ed2600..86fe479dd8a 100644 --- a/infer/src/bufferoverrun/bufferOverrunSemantics.ml +++ b/infer/src/bufferoverrun/bufferOverrunSemantics.ml @@ -394,7 +394,7 @@ let rec eval_sympath_partial ~mode params p mem = match p with | BoField.Prim (Symb.SymbolPath.Pvar x) -> ( try ParamBindings.find (Pvar.get_name x) params - with Caml.Not_found -> + with Stdlib.Not_found -> L.d_printfln_escaped "Symbol %a is not found in parameters." (Pvar.pp Pp.text) x ; Val.Itv.top ) | BoField.Prim (Symb.SymbolPath.Callsite {ret_typ; cs; obj_path}) -> ( diff --git a/infer/src/checkers/ExternalConfigImpactData.ml b/infer/src/checkers/ExternalConfigImpactData.ml index aeedc989e80..dd7ab9802c1 100644 --- a/infer/src/checkers/ExternalConfigImpactData.ml +++ b/infer/src/checkers/ExternalConfigImpactData.ml @@ -8,7 +8,7 @@ open! IStd module L = Logging -module ConfigProcnameSet = Caml.Set.Make (struct +module ConfigProcnameSet = Stdlib.Set.Make (struct (* workaround: since there is no way to have @@deriving directive in atd declaration, we redefine the type *) type t = Config_impact_data_t.config_item = {method_name: string; class_name: string} diff --git a/infer/src/checkers/Lineage.ml b/infer/src/checkers/Lineage.ml index 97ae613d6d5..3081f0c9a86 100644 --- a/infer/src/checkers/Lineage.ml +++ b/infer/src/checkers/Lineage.ml @@ -1010,7 +1010,7 @@ module Out = struct of_sequence (Sequence.map ~f:(fun c -> Z.of_int (int_of_char c)) - (Sequence.of_seq (Caml.String.to_seq s)) ) + (Sequence.of_seq (Stdlib.String.to_seq s)) ) let of_procname procname : t = of_string (Procname.hashable_name procname) diff --git a/infer/src/checkers/LineageShape.ml b/infer/src/checkers/LineageShape.ml index 909d0d17d75..072d5b419a2 100644 --- a/infer/src/checkers/LineageShape.ml +++ b/infer/src/checkers/LineageShape.ml @@ -205,7 +205,7 @@ module Pp = struct let pp_binding = binding ~bind pp_key pp_value in Format.fprintf fmt "@[(%a)@]" (IFmt.Labelled.iter ~sep List.iter pp_binding) - ( Caml.Hashtbl.to_seq hashtbl |> Caml.List.of_seq + ( Stdlib.Hashtbl.to_seq hashtbl |> Stdlib.List.of_seq |> List.sort ~compare:(fun (k, _) (k', _) -> compare k k') ) @@ -549,8 +549,8 @@ end = struct let iter_hashtbl htbl f = Hashtbl.iteri ~f:(fun ~key ~data -> f (key, data)) htbl let caml_hashtbl_of_iter_exn iter = - let r = Caml.Hashtbl.create 42 in - iter (fun (key, data) -> Caml.Hashtbl.add r key data) ; + let r = Stdlib.Hashtbl.create 42 in + iter (fun (key, data) -> Stdlib.Hashtbl.add r key data) ; r @@ -951,7 +951,7 @@ end = struct module HashSet = struct include HashSet.Make (Shape_id) - let of_list li = of_seq (Caml.List.to_seq li) + let of_list li = of_seq (Stdlib.List.to_seq li) let pp = Fmt.iter ~sep:Fmt.comma (Fn.flip iter) pp end @@ -971,12 +971,12 @@ end = struct It also registers the formal and returned variables, to allow querying for their shapes using only the environment. *) type t = - { var_shapes: (Var.t, shape) Caml.Hashtbl.t - ; shape_structures: (Shape_id.t, structure) Caml.Hashtbl.t + { var_shapes: (Var.t, shape) Stdlib.Hashtbl.t + ; shape_structures: (Shape_id.t, structure) Stdlib.Hashtbl.t ; formals: shape array ; return: shape - ; argument_of: (Procname.t, Shape.HashSet.t array) Caml.Hashtbl.t - ; return_of: (Procname.t, Shape.HashSet.t) Caml.Hashtbl.t } + ; argument_of: (Procname.t, Shape.HashSet.t array) Stdlib.Hashtbl.t + ; return_of: (Procname.t, Shape.HashSet.t) Stdlib.Hashtbl.t } let pp fmt {var_shapes; shape_structures; formals; return; return_of} = (* TODO argument_of *) @@ -995,7 +995,7 @@ end = struct let find_var_shape {var_shapes; _} var = - match Caml.Hashtbl.find_opt var_shapes var with + match Stdlib.Hashtbl.find_opt var_shapes var with | Some shape -> shape | None -> @@ -1005,7 +1005,7 @@ end = struct (** Returns true iff the corresponding shape would be represented by several cells in a fully precise abstraction, ie. has known sub-fields. *) let has_sub_cells {shape_structures; _} shape = - match (Caml.Hashtbl.find_opt shape_structures shape : structure option) with + match (Stdlib.Hashtbl.find_opt shape_structures shape : structure option) with | None | Some Bottom | Some (Variant _) | Some LocalAbstract -> false | Some (Vector {all_map_value= Some _; _}) -> @@ -1018,7 +1018,7 @@ end = struct let find_field_table {shape_structures; _} shape = - match (Caml.Hashtbl.find_opt shape_structures shape : structure option) with + match (Stdlib.Hashtbl.find_opt shape_structures shape : structure option) with | Some (Vector {fields; _}) -> Some fields | Some LocalAbstract -> @@ -1111,7 +1111,7 @@ end = struct let find_shape_structure {shape_structures; _} shape = - Caml.Hashtbl.find_opt shape_structures shape + Stdlib.Hashtbl.find_opt shape_structures shape let find_var_path_structure summary var_path = @@ -1162,10 +1162,12 @@ end = struct let formals = Procdesc.get_pvar_formals proc_desc |> List.map ~f:(fun (pvar, _typ) -> Var.of_pvar pvar) - |> List.map ~f:(fun var -> Caml.Hashtbl.find var_shapes var) + |> List.map ~f:(fun var -> Stdlib.Hashtbl.find var_shapes var) |> List.to_array in - let return = Caml.Hashtbl.find var_shapes @@ Var.of_pvar @@ Procdesc.get_ret_var proc_desc in + let return = + Stdlib.Hashtbl.find var_shapes @@ Var.of_pvar @@ Procdesc.get_ret_var proc_desc + in let translate_shape_list shapes = List.map ~f:translate_shape shapes |> Shape.HashSet.of_list in @@ -1199,7 +1201,7 @@ end = struct recursively introducing its fields. *) let state_shape = State.Shape.Private.create () in Hashtbl.set id_translation_tbl ~key:shape_id ~data:state_shape ; - ( match (Caml.Hashtbl.find_opt shape_structures shape_id : structure option) with + ( match (Stdlib.Hashtbl.find_opt shape_structures shape_id : structure option) with | None | Some Bottom | Some LocalAbstract @@ -1238,7 +1240,7 @@ end = struct let introduce_var ~var id_translation_tbl {var_shapes; shape_structures; _} {State.shape_structures= state_shape_structures; _} = introduce_shape id_translation_tbl - (Caml.Hashtbl.find var_shapes var) + (Stdlib.Hashtbl.find var_shapes var) shape_structures state_shape_structures @@ -1269,9 +1271,9 @@ end = struct "@[Assertion fails: incompatible shapes.@ @[`%a`: %a={%a}@]@ vs@ @[`%a`: %a={%a}@]@]" VarPath.pp var_path_1 Shape_id.pp var_path_shape_1 (Fmt.option @@ Structure.pp pp_shape) - (Caml.Hashtbl.find_opt shape_structures var_path_shape_1) + (Stdlib.Hashtbl.find_opt shape_structures var_path_shape_1) VarPath.pp var_path_2 Shape_id.pp var_path_shape_2 (Fmt.option pp_structure) - (Caml.Hashtbl.find_opt shape_structures var_path_shape_2) + (Stdlib.Hashtbl.find_opt shape_structures var_path_shape_2) let finalise summary var_shape field_path = @@ -1446,7 +1448,7 @@ end = struct let fold_return_of summary_option procname field_path ~init ~f = match summary_option with | Some ({return_of; _} as summary) -> - let shape_hset = Caml.Hashtbl.find return_of procname in + let shape_hset = Stdlib.Hashtbl.find return_of procname in fold_shape_hset summary shape_hset field_path ~init ~f | None -> f init [] diff --git a/infer/src/checkers/SelfInBlock.ml b/infer/src/checkers/SelfInBlock.ml index 09c998dd3bc..c0040ac53f7 100644 --- a/infer/src/checkers/SelfInBlock.ml +++ b/infer/src/checkers/SelfInBlock.ml @@ -298,7 +298,7 @@ module Mem = struct {pvar; typ; loc; kind= UNCHECKED_STRONG_SELF; is_implicit= false} astate.vars else astate.vars - with Caml.Not_found -> astate.vars ) ) + with Stdlib.Not_found -> astate.vars ) ) in {astate with vars} @@ -328,7 +328,7 @@ module Mem = struct || Option.is_some strong_pvar_opt then StrongEqualToWeakCapturedVars.add pvar {checked= false; loc} astate.strongVars else astate.strongVars - with Caml.Not_found -> astate.strongVars + with Stdlib.Not_found -> astate.strongVars in {astate with strongVars} end diff --git a/infer/src/checkers/annotationReachability.ml b/infer/src/checkers/annotationReachability.ml index 53c30319ad9..da41f83ef25 100644 --- a/infer/src/checkers/annotationReachability.ml +++ b/infer/src/checkers/annotationReachability.ml @@ -309,7 +309,7 @@ let find_paths_to_snk ({InterproceduralAnalysis.proc_desc; tenv} as analysis_dat let fst_call_site = (* Just pick one path forward (per sink procedure) to avoid path explosion *) try Domain.CallSites.min_elt call_sites - with Caml.Not_found -> L.die InternalError "Callsite map should not be empty" + with Stdlib.Not_found -> L.die InternalError "Callsite map should not be empty" in (* Report the issue where the source makes the first call *) let report_loc = CallSite.loc fst_call_site.call_site in diff --git a/infer/src/checkers/liveness.ml b/infer/src/checkers/liveness.ml index 808eaaa3ecc..976bdc3a503 100644 --- a/infer/src/checkers/liveness.ml +++ b/infer/src/checkers/liveness.ml @@ -349,7 +349,7 @@ let get_passed_by_ref_invariant_map proc_desc = PassedByRefAnalyzer.exec_cfg cfg () ~initial:VarSet.empty -module IntLitSet = Caml.Set.Make (IntLit) +module IntLitSet = Stdlib.Set.Make (IntLit) let ignored_constants = let int_lit_constants = diff --git a/infer/src/checkers/loopInvariant.ml b/infer/src/checkers/loopInvariant.ml index 88871537a8c..432cb656a92 100644 --- a/infer/src/checkers/loopInvariant.ml +++ b/infer/src/checkers/loopInvariant.ml @@ -112,7 +112,7 @@ module ProcessedPair = struct type t = Var.t * Procdesc.Node.t [@@deriving compare] end -module ProcessedPairSet = Caml.Set.Make (ProcessedPair) +module ProcessedPairSet = Stdlib.Set.Make (ProcessedPair) (* get all the ptr variables (and their dependencies) occurring on the RHS of the definition of a given variable. *) diff --git a/infer/src/checkers/purityModels.ml b/infer/src/checkers/purityModels.ml index a7306eeddef..10e73e87c29 100644 --- a/infer/src/checkers/purityModels.ml +++ b/infer/src/checkers/purityModels.ml @@ -6,7 +6,7 @@ *) open! IStd -module BuiltinPureMethods = Caml.Set.Make (String) +module BuiltinPureMethods = Stdlib.Set.Make (String) let pure_builtins = List.map ~f:Procname.get_method diff --git a/infer/src/checkers/scopeLeakage.ml b/infer/src/checkers/scopeLeakage.ml index 70fba0a2837..3d95025cd62 100644 --- a/infer/src/checkers/scopeLeakage.ml +++ b/infer/src/checkers/scopeLeakage.ml @@ -8,7 +8,7 @@ open! IStd module L = Logging module F = Format -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module VarMap = Hashtbl.Make (Var) let pp_loc_opt fmt loc_opt = diff --git a/infer/src/clang/CType_decl.ml b/infer/src/clang/CType_decl.ml index fa8dea28325..8701c006b27 100644 --- a/infer/src/clang/CType_decl.ml +++ b/infer/src/clang/CType_decl.ml @@ -315,7 +315,7 @@ let get_translate_as_friend_decl decl_list = Some t_ptr | _ -> None - | exception (Not_found_s _ | Caml.Not_found) -> + | exception (Not_found_s _ | Stdlib.Not_found) -> None diff --git a/infer/src/clang/cContext.ml b/infer/src/clang/cContext.ml index 6fa1ac32a52..8e9aa737a07 100644 --- a/infer/src/clang/cContext.ml +++ b/infer/src/clang/cContext.ml @@ -7,7 +7,7 @@ open! IStd module F = Format -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module StmtMap = ClangPointers.Map type cxx_temporary = @@ -138,7 +138,7 @@ let add_block_static_var context block_name static_var_typ = static_vars static_var_typ then (static_vars, true) else (static_var_typ :: static_vars, false) - with Caml.Not_found -> ([static_var_typ], false) + with Stdlib.Not_found -> ([static_var_typ], false) in if not duplicate then let blocks_static_vars = diff --git a/infer/src/clang/cContext.mli b/infer/src/clang/cContext.mli index 0839634b905..874e320b434 100644 --- a/infer/src/clang/cContext.mli +++ b/infer/src/clang/cContext.mli @@ -32,7 +32,7 @@ val pp_var_to_destroy : Format.formatter -> var_to_destroy -> unit type curr_class = ContextClsDeclPtr of int | ContextNoCls [@@deriving compare] -type str_node_map = (string, Procdesc.Node.t) Caml.Hashtbl.t +type str_node_map = (string, Procdesc.Node.t) Stdlib.Hashtbl.t type t = { translation_unit_context: CFrontend_config.translation_unit_context @@ -48,7 +48,7 @@ type t = ; vars_to_destroy: var_to_destroy list StmtMap.t (** mapping from a statement to a list of variables, that go out of scope after the end of the statement *) - ; temporary_names: (Clang_ast_t.pointer, Pvar.t * Typ.t) Caml.Hashtbl.t + ; temporary_names: (Clang_ast_t.pointer, Pvar.t * Typ.t) Stdlib.Hashtbl.t ; temporaries_constructor_markers: (Pvar.t * Typ.t) Pvar.Map.t (** In order to know when to destruct C++ temporaries created in expressions containing conditionals (e.g. to hold the object created by [X()] in [b?foo(X()):goo()]), we diff --git a/infer/src/clang/cEnum_decl.ml b/infer/src/clang/cEnum_decl.ml index 97deb166478..c9c00a818e0 100644 --- a/infer/src/clang/cEnum_decl.ml +++ b/infer/src/clang/cEnum_decl.ml @@ -18,7 +18,7 @@ let add_enum_constant_to_map_if_needed decl_pointer pred_decl_opt = try ignore (CAst_utils.get_enum_constant_exp_exn decl_pointer) ; true - with Not_found_s _ | Caml.Not_found -> + with Not_found_s _ | Stdlib.Not_found -> CAst_utils.add_enum_constant decl_pointer pred_decl_opt ; false diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index bd0ca28559a..940d5c3b8ab 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -126,7 +126,7 @@ let should_create_procdesc cfg procname ~defined ~set_objc_accessor_attr = Procname.Hash.remove cfg procname ; true ) else false - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> true @@ -292,7 +292,7 @@ let create_local_procdesc ?loc_instantiated ?(set_objc_accessor_attr = false) match Procname.Hash.find cfg proc_name with | procdesc_prev -> Procdesc.get_captured procdesc_prev - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> captured_mangled else captured_mangled in @@ -333,7 +333,7 @@ let create_local_procdesc ?loc_instantiated ?(set_objc_accessor_attr = false) {(Procdesc.get_attributes procdesc_prev) with captured= captured_mangled} in Procdesc.set_attributes procdesc_prev new_attributes - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> () ) ; false ) diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index 02f6e06ff7b..5a0783e845c 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -1003,7 +1003,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s let exp = enum_const_eval context enum_constant_pointer prev_enum_constant_opt zero in CAst_utils.update_enum_map_exn enum_constant_pointer exp ; exp - with Not_found_s _ | Caml.Not_found -> zero + with Not_found_s _ | Stdlib.Not_found -> zero and enum_constant_trans trans_state decl_ref = diff --git a/infer/src/clang/cTrans_utils.ml b/infer/src/clang/cTrans_utils.ml index 8d985318d13..63e2aee3c49 100644 --- a/infer/src/clang/cTrans_utils.ml +++ b/infer/src/clang/cTrans_utils.ml @@ -7,7 +7,7 @@ open! IStd module F = Format -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl (** Utility methods to support the translation of clang ast constructs into sil instructions. *) @@ -88,7 +88,7 @@ end module GotoLabel = struct let find_goto_label context label sil_loc = try Hashtbl.find context.CContext.label_map label - with Caml.Not_found -> + with Stdlib.Not_found -> let node_name = Format.sprintf "GotoLabel_%s" label in let new_node = Procdesc.create_node context.CContext.procdesc sil_loc (Procdesc.Node.Skip_node node_name) diff --git a/infer/src/clang/cType_to_sil_type.ml b/infer/src/clang/cType_to_sil_type.ml index 659958f1020..335cbb7e285 100644 --- a/infer/src/clang/cType_to_sil_type.ml +++ b/infer/src/clang/cType_to_sil_type.ml @@ -246,7 +246,7 @@ and decl_ptr_to_type_desc translate_decl tenv decl_ptr : Typ.desc = let open Clang_ast_t in let typ = Clang_ast_extend.DeclPtr decl_ptr in try Clang_ast_extend.TypePointerMap.find typ !CFrontend_config.sil_types_map - with Caml.Not_found -> ( + with Stdlib.Not_found -> ( match CAst_utils.get_decl decl_ptr with | Some (CXXRecordDecl _ as d) | Some (RecordDecl _ as d) @@ -272,7 +272,7 @@ and decl_ptr_to_type_desc translate_decl tenv decl_ptr : Typ.desc = and clang_type_ptr_to_type_desc ?attr_info ?from_block translate_decl tenv type_ptr = try Clang_ast_extend.TypePointerMap.find type_ptr !CFrontend_config.sil_types_map - with Caml.Not_found -> ( + with Stdlib.Not_found -> ( match CAst_utils.get_type type_ptr with | Some c_type -> let type_desc = type_desc_of_c_type ?attr_info ?from_block translate_decl tenv c_type in diff --git a/infer/src/clang/cVar_decl.ml b/infer/src/clang/cVar_decl.ml index a7f12bb9025..70ed4b9620a 100644 --- a/infer/src/clang/cVar_decl.ml +++ b/infer/src/clang/cVar_decl.ml @@ -62,13 +62,13 @@ let mk_temp_sil_var procdesc ~name = let mk_temp_sil_var_for_qual_type context ~name ~clang_pointer qual_type = - match Caml.Hashtbl.find_opt context.CContext.temporary_names clang_pointer with + match Stdlib.Hashtbl.find_opt context.CContext.temporary_names clang_pointer with | Some pvar_typ -> pvar_typ | None -> let typ = CType_decl.qual_type_to_sil_type context.CContext.tenv qual_type in let pvar_typ = (mk_temp_sil_var context.CContext.procdesc ~name, typ) in - Caml.Hashtbl.add context.CContext.temporary_names clang_pointer pvar_typ ; + Stdlib.Hashtbl.add context.CContext.temporary_names clang_pointer pvar_typ ; pvar_typ @@ -302,14 +302,14 @@ let captured_vars_from_block_info context source_range captured_vars = let mk_temp_sil_var_for_expr context ~name ~clang_pointer expr_info = - match Caml.Hashtbl.find_opt context.CContext.temporary_names clang_pointer with + match Stdlib.Hashtbl.find_opt context.CContext.temporary_names clang_pointer with | Some pvar_typ -> pvar_typ | None -> let qual_type = expr_info.Clang_ast_t.ei_qual_type in let typ = CType_decl.qual_type_to_sil_type context.CContext.tenv qual_type in let pvar_typ = (mk_temp_sil_var context.CContext.procdesc ~name, typ) in - Caml.Hashtbl.add context.CContext.temporary_names clang_pointer pvar_typ ; + Stdlib.Hashtbl.add context.CContext.temporary_names clang_pointer pvar_typ ; pvar_typ diff --git a/infer/src/clang/clang_ast_extend.ml b/infer/src/clang/clang_ast_extend.ml index 3ceda5297ee..dc990d887d5 100644 --- a/infer/src/clang/clang_ast_extend.ml +++ b/infer/src/clang/clang_ast_extend.ml @@ -116,4 +116,4 @@ module TypePointerOrd = struct if restrict_cmp <> 0 then restrict_cmp else Bool.compare v1 v2 end -module TypePointerMap = Caml.Map.Make (TypePointerOrd) +module TypePointerMap = Stdlib.Map.Make (TypePointerOrd) diff --git a/infer/src/concurrency/RacerDFileAnalysis.ml b/infer/src/concurrency/RacerDFileAnalysis.ml index cf4b6b69cd0..0429f3dc3ba 100644 --- a/infer/src/concurrency/RacerDFileAnalysis.ml +++ b/infer/src/concurrency/RacerDFileAnalysis.ml @@ -105,7 +105,7 @@ end = struct else update reported_access (reported_set, f reported_access issue_log) end -module PathModuloThis : Caml.Map.OrderedType with type t = AccessPath.t = struct +module PathModuloThis : Stdlib.Map.OrderedType with type t = AccessPath.t = struct type t = AccessPath.t type var_ = Var.t @@ -145,7 +145,7 @@ end = struct Call pname end - module M = Caml.Map.Make (Key) + module M = Stdlib.Map.Make (Key) type t = reported_access list M.t diff --git a/infer/src/inferppx-tests/HashNormInlinedCode.ml b/infer/src/inferppx-tests/HashNormInlinedCode.ml index 6b2d218e4ec..47fc454dc34 100644 --- a/infer/src/inferppx-tests/HashNormInlinedCode.ml +++ b/infer/src/inferppx-tests/HashNormInlinedCode.ml @@ -18,7 +18,7 @@ include struct let _ = fun (_ : record) -> () let hash_normalize_find_opt_record, hash_normalize_add_record = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = record let equal = equal_record @@ -82,7 +82,7 @@ include struct let _ = fun (_ : tuple) -> () let hash_normalize_find_opt_tuple, hash_normalize_add_tuple = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = tuple let equal = equal_tuple @@ -152,7 +152,7 @@ include struct let _ = fun (_ : variant) -> () let hash_normalize_find_opt_variant, hash_normalize_add_variant = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = variant let equal = equal_variant @@ -243,7 +243,7 @@ module SourceFile = struct let _ = fun (_ : t) -> () let hash_normalize_find_opt, hash_normalize_add = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = t let equal = equal @@ -334,7 +334,7 @@ module Location = struct let _ = fun (_ : t) -> () let hash_normalize_find_opt, hash_normalize_add = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = t let equal = equal @@ -401,7 +401,7 @@ module CSharpClassName = struct let _ = fun (_ : t) -> () let hash_normalize_find_opt, hash_normalize_add = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = t let equal = equal @@ -468,7 +468,7 @@ module JavaClassName = struct let _ = fun (_ : t) -> () let hash_normalize_find_opt, hash_normalize_add = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = t let equal = equal @@ -537,7 +537,7 @@ include struct let _ = fun (_ : recursive2) -> () let hash_normalize_find_opt_recursive1, hash_normalize_add_recursive1 = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = recursive1 let equal = equal_recursive1 @@ -558,7 +558,7 @@ include struct and _ = hash_normalize_add_recursive1 let hash_normalize_find_opt_recursive2, hash_normalize_add_recursive2 = - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = recursive2 let equal = equal_recursive2 diff --git a/infer/src/inferppx/Hashnorm.ml b/infer/src/inferppx/Hashnorm.ml index 8f95958cf4e..8639667cff9 100644 --- a/infer/src/inferppx/Hashnorm.ml +++ b/infer/src/inferppx/Hashnorm.ml @@ -250,7 +250,7 @@ let maybe_make_hashtable_api ~loc td = let ct = Ast_helper.Typ.constr ~loc (Common.make_longident ~loc td.ptype_name.txt) [] in let body = [%expr - let module H = Caml.Hashtbl.Make (struct + let module H = Stdlib.Hashtbl.Make (struct type nonrec t = [%t ct] let equal = [%e equal_name_expr] diff --git a/infer/src/integration/CaptureSILJson.ml b/infer/src/integration/CaptureSILJson.ml index 6aea0c32b09..61ba5d66a26 100644 --- a/infer/src/integration/CaptureSILJson.ml +++ b/infer/src/integration/CaptureSILJson.ml @@ -13,7 +13,7 @@ open Yojson.Safe.Util OCaml's basic integers *) module L = Logging -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module Safe = Yojson.Safe module IntHash = struct diff --git a/infer/src/integration/CostIssuesTest.ml b/infer/src/integration/CostIssuesTest.ml index 01db9797f0f..eab6b42c279 100644 --- a/infer/src/integration/CostIssuesTest.ml +++ b/infer/src/integration/CostIssuesTest.ml @@ -34,7 +34,7 @@ let pp_custom_of_cost_report fmt report cost_fields = let cost_tests_jsonbug_compare (cost1 : Jsoncost_t.item) (cost2 : Jsoncost_t.item) = let open Jsonbug_t in - [%compare: string * string * string * Caml.Digest.t * bool] + [%compare: string * string * string * Stdlib.Digest.t * bool] ( cost1.loc.file , cost1.procedure_id , cost1.exec_cost.hum.hum_polynomial diff --git a/infer/src/integration/Differential.ml b/infer/src/integration/Differential.ml index cf2d0d84ff5..351fc5c810b 100644 --- a/infer/src/integration/Differential.ml +++ b/infer/src/integration/Differential.ml @@ -11,7 +11,7 @@ module L = Logging (** set of lists of locations for remembering what trace ends have been reported *) module LocListSet = struct - include Caml.Set.Make (struct + include Stdlib.Set.Make (struct type t = Location.t list [@@deriving compare] end) diff --git a/infer/src/integration/DifferentialFilters.ml b/infer/src/integration/DifferentialFilters.ml index db2e183ed7b..01bc6c4bd6b 100644 --- a/infer/src/integration/DifferentialFilters.ml +++ b/infer/src/integration/DifferentialFilters.ml @@ -11,7 +11,7 @@ module L = Logging module FileRenamings = struct type renaming = {current: string; previous: string} - module CurrentToPreviousMap = Caml.Map.Make (String) + module CurrentToPreviousMap = Stdlib.Map.Make (String) type t = string CurrentToPreviousMap.t [@@deriving compare, equal] @@ -61,7 +61,7 @@ module FileRenamings = struct let from_json_file file : t = from_json (In_channel.read_all file) let find_previous (t : t) current = - try CurrentToPreviousMap.find current t with Caml.Not_found -> current + try CurrentToPreviousMap.find current t with Stdlib.Not_found -> current module VISIBLE_FOR_TESTING_DO_NOT_USE_DIRECTLY = struct @@ -117,7 +117,7 @@ let relative_complements ~compare ~pred l1 l2 = let skip_duplicated_types_on_filenames renamings (diff : Differential.t) : Differential.t = let compare (issue1, previous_file1) (issue2, previous_file2) = - [%compare: Caml.Digest.t option * string * string] + [%compare: Stdlib.Digest.t option * string * string] (issue1.Jsonbug_t.node_key, issue1.Jsonbug_t.bug_type, previous_file1) (issue2.Jsonbug_t.node_key, issue2.Jsonbug_t.bug_type, previous_file2) in diff --git a/infer/src/integration/Erlang.ml b/infer/src/integration/Erlang.ml index b0baad19d4a..4a606348be8 100644 --- a/infer/src/integration/Erlang.ml +++ b/infer/src/integration/Erlang.ml @@ -175,7 +175,7 @@ let process_beams ~project_root beam_list_path = let parse_buck_arguments args = - let is_option s = Caml.String.starts_with ~prefix:"--" s in + let is_option s = Stdlib.String.starts_with ~prefix:"--" s in let global_options, args = List.split_while args ~f:is_option in let args = match args with @@ -209,9 +209,11 @@ let simplify_targets targets = let targets = Set.elements (String.Set.of_list targets) in let ellipsis_suffix = "/..." in let ellipsis_patterns, targets = - List.partition_tf ~f:(Caml.String.ends_with ~suffix:ellipsis_suffix) targets + List.partition_tf ~f:(Stdlib.String.ends_with ~suffix:ellipsis_suffix) targets + in + let colon_patterns, targets = + List.partition_tf ~f:(Stdlib.String.ends_with ~suffix:":") targets in - let colon_patterns, targets = List.partition_tf ~f:(Caml.String.ends_with ~suffix:":") targets in let make_regex len patterns = match patterns with | [] -> diff --git a/infer/src/integration/Hack.ml b/infer/src/integration/Hack.ml index 639ac4ec23d..f2a9b65cf7a 100644 --- a/infer/src/integration/Hack.ml +++ b/infer/src/integration/Hack.ml @@ -388,7 +388,7 @@ let process_output_in_parallel ic = let process_output_sequentially hackc_stdout = let _, units = Unit.extract_units hackc_stdout in - let units = Caml.List.of_seq units in + let units = Stdlib.List.of_seq units in let acc_tenv = Tenv.create () in let n_captured, n_error = List.fold units ~init:(0, 0) ~f:(fun (n_captured, n_error) unit -> diff --git a/infer/src/integration/InferCommandImplementation.ml b/infer/src/integration/InferCommandImplementation.ml index 9d489a2034d..19a8f4c1a5d 100644 --- a/infer/src/integration/InferCommandImplementation.ml +++ b/infer/src/integration/InferCommandImplementation.ml @@ -146,7 +146,7 @@ let help () = module ReportSet = struct module type JsonReport = sig - include Caml.Hashtbl.HashedType + include Stdlib.Hashtbl.HashedType val json_loader : Yojson.lexer_state -> Lexing.lexbuf -> t list @@ -157,7 +157,7 @@ module ReportSet = struct (** functor producing a json report set module (using the provided equality relation) *) module MakeSet (R : JsonReport) = struct - module HT = Caml.Hashtbl.Make (R) + module HT = Stdlib.Hashtbl.Make (R) type t = unit HT.t diff --git a/infer/src/integration/IssuesTest.ml b/infer/src/integration/IssuesTest.ml index 2848246ddef..a9b89ff98c4 100644 --- a/infer/src/integration/IssuesTest.ml +++ b/infer/src/integration/IssuesTest.ml @@ -81,9 +81,9 @@ let pp_custom_of_report fmt report fields = | BugTrace -> pp_trace fmt issue.bug_trace (comma_separator index) | Key -> - F.fprintf fmt "%s%s" (comma_separator index) (Caml.Digest.to_hex issue.key) + F.fprintf fmt "%s%s" (comma_separator index) (Stdlib.Digest.to_hex issue.key) | Hash -> - F.fprintf fmt "%s%s" (comma_separator index) (Caml.Digest.to_hex issue.hash) + F.fprintf fmt "%s%s" (comma_separator index) (Stdlib.Digest.to_hex issue.hash) | LineOffset -> F.fprintf fmt "%s%d" (comma_separator index) (issue.line - issue.procedure_start_line) | QualifierContainsPotentialExceptionNote -> diff --git a/infer/src/integration/JsonReports.ml b/infer/src/integration/JsonReports.ml index bfb37849226..8d94463822e 100644 --- a/infer/src/integration/JsonReports.ml +++ b/infer/src/integration/JsonReports.ml @@ -70,7 +70,7 @@ let compute_hash = , location_independent_proc_name , base_filename , location_independent_qualifier ) - |> Caml.Digest.to_hex + |> Stdlib.Digest.to_hex let loc_trace_to_jsonbug_record trace_list = diff --git a/infer/src/integration/SarifReport.ml b/infer/src/integration/SarifReport.ml index 1156bf9c9ca..0420e41ca4e 100644 --- a/infer/src/integration/SarifReport.ml +++ b/infer/src/integration/SarifReport.ml @@ -7,7 +7,7 @@ open! IStd module F = Format -module IssueHash = Caml.Hashtbl.Make (String) +module IssueHash = Stdlib.Hashtbl.Make (String) module ReportSummary = struct type t = {mutable n_issues: int; issue_type_counts: (int * string) IssueHash.t} diff --git a/infer/src/integration/TextReport.ml b/infer/src/integration/TextReport.ml index 544e7a91a05..7eba3929708 100644 --- a/infer/src/integration/TextReport.ml +++ b/infer/src/integration/TextReport.ml @@ -13,7 +13,7 @@ module L = Logging (* how many lines of context around each report *) let source_context = 2 -module IssueHash = Caml.Hashtbl.Make (String) +module IssueHash = Stdlib.Hashtbl.Make (String) let pp_n_spaces n fmt = for _ = 1 to n do diff --git a/infer/src/istd/ARList.ml b/infer/src/istd/ARList.ml index d5ff217a8b8..2c702927b0c 100644 --- a/infer/src/istd/ARList.ml +++ b/infer/src/istd/ARList.ml @@ -26,12 +26,12 @@ type +'a t = Empty | Cons of 'a * 'a t | Snoc of 'a t * 'a | Concat of 'a t * 'a let () = (* This is a pretty simple test to check that the runtime representation of OCaml lists is compatible with our lists and hence using [Obj.magic] for [of_list] is legit *) let exception RuntimeValue in - assert (Poly.(Caml.Obj.repr [RuntimeValue] = Caml.Obj.repr (Cons (RuntimeValue, Empty)))) + assert (Poly.(Stdlib.Obj.repr [RuntimeValue] = Stdlib.Obj.repr (Cons (RuntimeValue, Empty)))) (* Constructors *) -let of_list = Caml.Obj.magic +let of_list = Stdlib.Obj.magic let empty = Empty @@ -72,7 +72,7 @@ let is_singleton_or_more = function let rec hd_tl_exn : 'a t -> 'a * 'a t = function | Empty -> - raise Caml.Not_found + raise Stdlib.Not_found | Cons (hd, tl) -> (hd, tl) | Snoc (front, last) -> @@ -88,7 +88,7 @@ let rec hd_tl_exn : 'a t -> 'a * 'a t = function and front_last_exn : 'a t -> 'a t * 'a = function | Empty -> - raise Caml.Not_found + raise Stdlib.Not_found | Cons (hd, tl) -> let front, last = front_last_exn tl in (cons hd front, last) @@ -104,7 +104,7 @@ and front_last_exn : 'a t -> 'a t * 'a = function let rec hd_exn : 'a t -> 'a = function | Empty -> - raise Caml.Not_found + raise Stdlib.Not_found | Cons (hd, _) -> hd | Snoc (front, _) | Concat (front, _) -> @@ -115,7 +115,7 @@ let rec hd_exn : 'a t -> 'a = function and last_exn : 'a t -> 'a = function | Empty -> - raise Caml.Not_found + raise Stdlib.Not_found | Snoc (_, last) -> last | Cons (_, tl) | Concat (_, tl) -> diff --git a/infer/src/istd/HashNormalizer.ml b/infer/src/istd/HashNormalizer.ml index 89fcaa9e11d..eda402f7144 100644 --- a/infer/src/istd/HashNormalizer.ml +++ b/infer/src/istd/HashNormalizer.ml @@ -7,7 +7,7 @@ open! Core module type NormalizedT = sig - include Caml.Hashtbl.HashedType + include Stdlib.Hashtbl.HashedType val normalize : t -> t end @@ -30,7 +30,7 @@ module Make (T : NormalizedT) = struct type t = T.t let hash_normalize = - let module H = Caml.Hashtbl.Make (T) in + let module H = Stdlib.Hashtbl.Make (T) in let table : t H.t = H.create 11 in let () = register_reset (fun () -> H.reset table) in fun t -> diff --git a/infer/src/istd/HashNormalizer.mli b/infer/src/istd/HashNormalizer.mli index 6675b505a3b..f5ecbb27b19 100644 --- a/infer/src/istd/HashNormalizer.mli +++ b/infer/src/istd/HashNormalizer.mli @@ -9,7 +9,7 @@ open! Core (** a hashed type with a normalization function which respects equality *) module type NormalizedT = sig - include Caml.Hashtbl.HashedType + include Stdlib.Hashtbl.HashedType val normalize : t -> t end diff --git a/infer/src/istd/HashSet.ml b/infer/src/istd/HashSet.ml index 4b22f172d29..0d867ac3fda 100644 --- a/infer/src/istd/HashSet.ml +++ b/infer/src/istd/HashSet.ml @@ -6,8 +6,8 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl -module Seq = Caml.Seq +module Hashtbl = Stdlib.Hashtbl +module Seq = Stdlib.Seq module type S = sig type elt diff --git a/infer/src/istd/HashSet.mli b/infer/src/istd/HashSet.mli index fab5c1b5743..8d71bf31dca 100644 --- a/infer/src/istd/HashSet.mli +++ b/infer/src/istd/HashSet.mli @@ -43,4 +43,4 @@ module type S = sig val is_empty : t -> bool end -module Make (Key : Caml.Hashtbl.HashedType) : S with type elt = Key.t +module Make (Key : Stdlib.Hashtbl.HashedType) : S with type elt = Key.t diff --git a/infer/src/istd/IExn.ml b/infer/src/istd/IExn.ml index 03e8439ba96..e83e26673dd 100644 --- a/infer/src/istd/IExn.ml +++ b/infer/src/istd/IExn.ml @@ -8,11 +8,11 @@ open! Core let reraise_after ~f exn = - let backtrace = Caml.Printexc.get_raw_backtrace () in + let backtrace = Stdlib.Printexc.get_raw_backtrace () in let () = f () in - Caml.Printexc.raise_with_backtrace exn backtrace + Stdlib.Printexc.raise_with_backtrace exn backtrace let reraise_if ~f exn = - let backtrace = Caml.Printexc.get_raw_backtrace () in - if f () then Caml.Printexc.raise_with_backtrace exn backtrace + let backtrace = Stdlib.Printexc.get_raw_backtrace () in + if f () then Stdlib.Printexc.raise_with_backtrace exn backtrace diff --git a/infer/src/istd/IInt.ml b/infer/src/istd/IInt.ml index a4dd04f6c33..b25cb26922b 100644 --- a/infer/src/istd/IInt.ml +++ b/infer/src/istd/IInt.ml @@ -7,12 +7,12 @@ open! Core module F = Format -module Map = Caml.Map.Make (Int) +module Map = Stdlib.Map.Make (Int) module Set = struct - include Caml.Set.Make (Int) + include Stdlib.Set.Make (Int) let pp fmt set = Fmt.braces (Fmt.iter iter ~sep:Fmt.comma F.pp_print_int) fmt set end -module Hash = Caml.Hashtbl.Make (Int) +module Hash = Stdlib.Hashtbl.Make (Int) diff --git a/infer/src/istd/IInt.mli b/infer/src/istd/IInt.mli index 140354a34cb..a923225cc47 100644 --- a/infer/src/istd/IInt.mli +++ b/infer/src/istd/IInt.mli @@ -7,12 +7,12 @@ module F = Format -module Map : Caml.Map.S with type key = int +module Map : Stdlib.Map.S with type key = int module Set : sig - include Caml.Set.S with type elt = int + include Stdlib.Set.S with type elt = int val pp : F.formatter -> t -> unit end -module Hash : Caml.Hashtbl.S with type key = int +module Hash : Stdlib.Hashtbl.S with type key = int diff --git a/infer/src/istd/ImperativeUnionFind.ml b/infer/src/istd/ImperativeUnionFind.ml index e477c7b5673..87415bbd19c 100644 --- a/infer/src/istd/ImperativeUnionFind.ml +++ b/infer/src/istd/ImperativeUnionFind.ml @@ -21,7 +21,7 @@ end module Make (Set : Set) = struct module H = struct - include Caml.Hashtbl + include Stdlib.Hashtbl let fold : (('a, 'b) t, 'a * 'b, 'accum) Container.fold = fun h ~init ~f -> diff --git a/infer/src/istd/LRUHashtbl.ml b/infer/src/istd/LRUHashtbl.ml index ee55b3e9cb2..c93a338f6fd 100644 --- a/infer/src/istd/LRUHashtbl.ml +++ b/infer/src/istd/LRUHashtbl.ml @@ -7,7 +7,7 @@ open! IStd module F = Format -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module type S = sig type key diff --git a/infer/src/istd/LRUHashtbl.mli b/infer/src/istd/LRUHashtbl.mli index f3c338b1158..4703cf0aca7 100644 --- a/infer/src/istd/LRUHashtbl.mli +++ b/infer/src/istd/LRUHashtbl.mli @@ -35,4 +35,4 @@ module type S = sig (** visible for testing mainly; makes linear number of hashtable lookups *) end -module Make (Key : Caml.Hashtbl.HashedType) : S with type key = Key.t +module Make (Key : Stdlib.Hashtbl.HashedType) : S with type key = Key.t diff --git a/infer/src/istd/PrettyPrintable.ml b/infer/src/istd/PrettyPrintable.ml index 246e5e19742..ff7fcc12b88 100644 --- a/infer/src/istd/PrettyPrintable.ml +++ b/infer/src/istd/PrettyPrintable.ml @@ -23,13 +23,13 @@ module type PrintableEquatableType = sig end module type PrintableOrderedType = sig - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include PrintableType with type t := t end module type HashableSexpablePrintableOrderedType = sig - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include PrintableType with type t := t @@ -39,13 +39,13 @@ module type HashableSexpablePrintableOrderedType = sig end module type PrintableEquatableOrderedType = sig - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include PrintableEquatableType with type t := t end module type PPSet = sig - include Caml.Set.S + include Stdlib.Set.S val is_singleton_or_more : t -> elt IContainer.singleton_or_more @@ -153,7 +153,7 @@ module type MonoMap = sig end module type PPMap = sig - include Caml.Map.S + include Stdlib.Map.S val fold_map : 'a t -> init:'b -> f:('b -> 'a -> 'b * 'c) -> 'b * 'c t @@ -187,7 +187,7 @@ let pp_collection_common ?hov ~pp_item fmt c = let pp_collection ~pp_item fmt c = pp_collection_common ~pp_item fmt c module MakePPSet (Ord : PrintableOrderedType) = struct - include Caml.Set.Make (Ord) + include Stdlib.Set.Make (Ord) let is_singleton_or_more s = if is_empty s then IContainer.Empty @@ -223,7 +223,7 @@ module MakeHashSexpPPSet (Ord : HashableSexpablePrintableOrderedType) = struct end module MakePPMap (Ord : PrintableOrderedType) = struct - include Caml.Map.Make (Ord) + include Stdlib.Map.Make (Ord) let fold_mapi m ~init ~f = let acc = ref init in diff --git a/infer/src/istd/PrettyPrintable.mli b/infer/src/istd/PrettyPrintable.mli index ac97410c4d6..b737e738d3d 100644 --- a/infer/src/istd/PrettyPrintable.mli +++ b/infer/src/istd/PrettyPrintable.mli @@ -25,13 +25,13 @@ module type PrintableEquatableType = sig end module type PrintableOrderedType = sig - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include PrintableType with type t := t end module type HashableSexpablePrintableOrderedType = sig - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include PrintableType with type t := t @@ -41,13 +41,13 @@ module type HashableSexpablePrintableOrderedType = sig end module type PrintableEquatableOrderedType = sig - include Caml.Set.OrderedType + include Stdlib.Set.OrderedType include PrintableEquatableType with type t := t end module type PPSet = sig - include Caml.Set.S + include Stdlib.Set.S val is_singleton_or_more : t -> elt IContainer.singleton_or_more @@ -155,7 +155,7 @@ module type MonoMap = sig end module type PPMap = sig - include Caml.Map.S + include Stdlib.Map.S val fold_map : 'a t -> init:'b -> f:('b -> 'a -> 'b * 'c) -> 'b * 'c t diff --git a/infer/src/istd/RecencyMap.ml b/infer/src/istd/RecencyMap.ml index 199abdf5520..fbd9e639161 100644 --- a/infer/src/istd/RecencyMap.ml +++ b/infer/src/istd/RecencyMap.ml @@ -146,9 +146,9 @@ module Make let to_seq map = - Seq.append (Caml.List.to_seq map.new_) + Seq.append (Stdlib.List.to_seq map.new_) ( (* this is quadratic time but the lists are at most [Config.limit] long, assumed small *) - Caml.List.to_seq map.old + Stdlib.List.to_seq map.old |> Seq.filter (fun binding -> not (List.Assoc.mem ~equal:Key.equal map.new_ (fst binding))) ) @@ -156,7 +156,7 @@ module Make let iter map ~f = fold map ~init:() ~f:(fun () x -> f x) - let bindings map = to_seq map |> Caml.List.of_seq + let bindings map = to_seq map |> Stdlib.List.of_seq let exists map ~f = List.exists map.new_ ~f diff --git a/infer/src/istd/UnionFind.ml b/infer/src/istd/UnionFind.ml index b6d1c7b9730..4fb8b1ea55e 100644 --- a/infer/src/istd/UnionFind.ml +++ b/infer/src/istd/UnionFind.ml @@ -16,8 +16,8 @@ end module Make (X : Element) - (XSet : Caml.Set.S with type elt = X.t) - (XMap : Caml.Map.S with type key = X.t) = + (XSet : Stdlib.Set.S with type elt = X.t) + (XMap : Stdlib.Map.S with type key = X.t) = struct module XSet = Iter.Set.Adapt (XSet) @@ -41,7 +41,7 @@ struct [uf], assuming the [repr] is correct and the class does not intersect with any existing elements of [uf] *) - module Map : Caml.Map.S with type key = repr + module Map : Stdlib.Map.S with type key = repr end = struct type repr = X.t diff --git a/infer/src/istd/UnionFind.mli b/infer/src/istd/UnionFind.mli index ae6f360977d..d335a9214f6 100644 --- a/infer/src/istd/UnionFind.mli +++ b/infer/src/istd/UnionFind.mli @@ -19,8 +19,8 @@ end module Make (X : Element) - (XSet : Caml.Set.S with type elt = X.t) - (XMap : Caml.Map.S with type key = X.t) : sig + (XSet : Stdlib.Set.S with type elt = X.t) + (XMap : Stdlib.Map.S with type key = X.t) : sig type t [@@deriving compare, equal] val pp : (F.formatter -> X.t -> unit) -> F.formatter -> t -> unit diff --git a/infer/src/java/jClasspath.ml b/infer/src/java/jClasspath.ml index 9dd9f62b1aa..32007066da7 100644 --- a/infer/src/java/jClasspath.ml +++ b/infer/src/java/jClasspath.ml @@ -135,9 +135,9 @@ let load_from_verbose_output = | Some line when Str.string_match class_filename_re line 0 -> ( let path = try Str.matched_group 5 line - with Caml.Not_found -> ( + with Stdlib.Not_found -> ( try Config.javac_classes_out ^/ Str.matched_group 2 line - with Caml.Not_found -> + with Stdlib.Not_found -> (* either matched group 5, 6, or 2 is found, see doc for [class_filename_re] above *) Str.matched_group 6 line ) in diff --git a/infer/src/java/jContext.ml b/infer/src/java/jContext.ml index 2526cc2d6c9..c3535a224d9 100644 --- a/infer/src/java/jContext.ml +++ b/infer/src/java/jContext.ml @@ -7,7 +7,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl open Javalib_pack open Sawja_pack module NodeTbl = Procdesc.NodeHash @@ -53,7 +53,7 @@ let get_or_set_pvar_type context var typ = set_var_map context (JBir.VarMap.add var (pvar, otyp, typ) var_map) else set_var_map context (JBir.VarMap.add var (pvar, typ, typ) var_map) ; (pvar, typ) - with Caml.Not_found -> + with Stdlib.Not_found -> let procname = Procdesc.get_proc_name context.procdesc in let varname = Mangled.from_string (JBir.var_name_g var) in let pvar = Pvar.mk varname procname in @@ -77,7 +77,7 @@ let get_var_type context var = try let _, _, otyp = JBir.VarMap.find var context.var_map in Some otyp - with Caml.Not_found -> None + with Stdlib.Not_found -> None let get_if_jumps context = context.if_jumps @@ -91,12 +91,12 @@ let get_if_jump context node = NodeTbl.find_opt (get_if_jumps context) node let add_goto_jump context pc jump = Hashtbl.add (get_goto_jumps context) pc jump let get_goto_jump context pc = - try Hashtbl.find (get_goto_jumps context) pc with Caml.Not_found -> Next + try Hashtbl.find (get_goto_jumps context) pc with Stdlib.Not_found -> Next let is_goto_jump context pc = try match Hashtbl.find (get_goto_jumps context) pc with Jump _ -> true | _ -> false - with Caml.Not_found -> false + with Stdlib.Not_found -> false let exn_node_table = Procname.Hash.create 100 diff --git a/infer/src/java/jContext.mli b/infer/src/java/jContext.mli index fd37ea136b9..185c0ca602b 100644 --- a/infer/src/java/jContext.mli +++ b/infer/src/java/jContext.mli @@ -16,7 +16,7 @@ type jump_kind = Next | Jump of int | Exit (** Hastable for storing nodes that correspond to if-instructions. These are used when adding the edges in the contrl flow graph. *) -module NodeTbl : Caml.Hashtbl.S with type key = Procdesc.Node.t +module NodeTbl : Stdlib.Hashtbl.S with type key = Procdesc.Node.t (** data structure for saving the three structures tht contain the intermediate representation of a file: the type environment, the control graph and the control flow graph *) @@ -29,7 +29,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) Caml.Hashtbl.t + ; goto_jumps: (int, jump_kind) Stdlib.Hashtbl.t ; cn: JBasics.class_name ; source_file: SourceFile.t ; program: JProgramDesc.t } diff --git a/infer/src/java/jProgramDesc.ml b/infer/src/java/jProgramDesc.ml index 86fa24f80d8..65003ecc45e 100644 --- a/infer/src/java/jProgramDesc.ml +++ b/infer/src/java/jProgramDesc.ml @@ -23,7 +23,7 @@ let javalib_get_class classpath cn = type callee_status = Translated | Missing of JBasics.class_name * JBasics.method_signature -module Classmap = Caml.Hashtbl.Make (struct +module Classmap = Stdlib.Hashtbl.Make (struct type t = JBasics.class_name let equal = JBasics.cn_equal @@ -33,7 +33,7 @@ end) type classmap = JCode.jcode Javalib.interface_or_class Classmap.t -module Sourcemap = Caml.Hashtbl.Make (String) +module Sourcemap = Stdlib.Hashtbl.Make (String) type sourcemap = JBasics.class_name list Sourcemap.t @@ -52,7 +52,7 @@ type t = let get_classmap program = program.classmap let get_matching_class_names program source_file = - try Sourcemap.find program.sourcemap source_file with Caml.Not_found -> [] + try Sourcemap.find program.sourcemap source_file with Stdlib.Not_found -> [] let set_java_location program cn loc = @@ -60,7 +60,7 @@ let set_java_location program cn loc = let get_java_location program cn = - try Some (JBasics.ClassMap.find cn program.java_location_map) with Caml.Not_found -> None + try Some (JBasics.ClassMap.find cn program.java_location_map) with Stdlib.Not_found -> None let set_callee_translated program pname = Procname.Hash.replace program.callees pname Translated @@ -77,7 +77,7 @@ let iter_missing_callees program ~f = let lookup_node cn program = try Some (Classmap.find program.classmap cn) - with Caml.Not_found -> ( + with Stdlib.Not_found -> ( match javalib_get_class program.classpath_channel cn with | Some jclass -> Classmap.add program.classmap cn jclass ; @@ -94,7 +94,7 @@ let create_sourcemap classes program = () | Some source_file -> let class_names = - try Sourcemap.find program.sourcemap source_file with Caml.Not_found -> [] + try Sourcemap.find program.sourcemap source_file with Stdlib.Not_found -> [] in Sourcemap.replace program.sourcemap source_file (cn :: class_names) in diff --git a/infer/src/java/jProgramDesc.mli b/infer/src/java/jProgramDesc.mli index 36ea1c000d9..66d075bb8f9 100644 --- a/infer/src/java/jProgramDesc.mli +++ b/infer/src/java/jProgramDesc.mli @@ -9,7 +9,7 @@ open! IStd open Javalib_pack -module Classmap : Caml.Hashtbl.S with type key = JBasics.class_name +module Classmap : Stdlib.Hashtbl.S with type key = JBasics.class_name type classmap = JCode.jcode Javalib.interface_or_class Classmap.t diff --git a/infer/src/java/jTrans.ml b/infer/src/java/jTrans.ml index 5f9d6c7e34f..bad3feb9a21 100644 --- a/infer/src/java/jTrans.ml +++ b/infer/src/java/jTrans.ml @@ -412,7 +412,7 @@ let create_callee_attributes tenv program cn ms procname = ; ret_type ; ret_annots ; is_abstract } - with Caml.Not_found -> None + with Stdlib.Not_found -> None in Option.bind ~f (JProgramDesc.lookup_node cn program) diff --git a/infer/src/java/jTransExn.ml b/infer/src/java/jTransExn.ml index 1df59e02722..369969fa570 100644 --- a/infer/src/java/jTransExn.ml +++ b/infer/src/java/jTransExn.ml @@ -7,7 +7,7 @@ *) open! IStd -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl open Javalib_pack open Sawja_pack @@ -17,7 +17,7 @@ let create_handler_table impl = try let handlers = Hashtbl.find handler_tb pc in Hashtbl.replace handler_tb pc (exn_handler :: handlers) - with Caml.Not_found -> Hashtbl.add handler_tb pc [exn_handler] + with Stdlib.Not_found -> Hashtbl.add handler_tb pc [exn_handler] in List.iter ~f:collect (JBir.exception_edges impl) ; handler_tb @@ -53,7 +53,7 @@ let translate_exceptions (context : JContext.t) exit_nodes get_body_nodes handle in let create_entry_block handler_list = try ignore (Hashtbl.find catch_block_table handler_list) - with Caml.Not_found -> + with Stdlib.Not_found -> let collect succ_nodes rethrow_exception handler = let catch_nodes = get_body_nodes handler.JBir.e_handler in let loc = @@ -183,4 +183,4 @@ let create_exception_handlers context exit_nodes get_body_nodes impl = try let handler_list = Hashtbl.find handler_table pc in Hashtbl.find catch_block_table handler_list - with Caml.Not_found -> exit_nodes ) + with Stdlib.Not_found -> exit_nodes ) diff --git a/infer/src/java/jTransType.ml b/infer/src/java/jTransType.ml index 6009dc0039e..ff0e865e2fe 100644 --- a/infer/src/java/jTransType.ml +++ b/infer/src/java/jTransType.ml @@ -201,7 +201,7 @@ let add_model_fields classpath_fields cn = Javalib.cf_fold (collect_models_class_fields classpath_field_map cn) jclass classpath_fields | _ -> classpath_fields - with Caml.Not_found -> classpath_fields + with Stdlib.Not_found -> classpath_fields let get_method_kind m = diff --git a/infer/src/llvm/llvm_sil.ml b/infer/src/llvm/llvm_sil.ml index 1ef57f3d05c..8fdb1e8d087 100644 --- a/infer/src/llvm/llvm_sil.ml +++ b/infer/src/llvm/llvm_sil.ml @@ -21,7 +21,7 @@ let main ~input ~output = Format.fprintf ff "%a@." Llair.fmt program ) ) ; Format.printf "@\nRESULT: Success@." with exn -> - let bt = Caml.Printexc.get_raw_backtrace () in + let bt = Stdlib.Printexc.get_raw_backtrace () in ( match exn with | Frontend.Invalid_llvm msg -> Format.printf "@\nRESULT: Invalid input: %s@." msg @@ -30,9 +30,9 @@ let main ~input ~output = | Failure msg -> Format.printf "@\nRESULT: Internal error: %s@." msg | _ -> - Format.printf "@\nRESULT: Unknown error: %s@." (Caml.Printexc.to_string exn) ) ; - Caml.Printexc.raise_with_backtrace exn bt + Format.printf "@\nRESULT: Unknown error: %s@." (Stdlib.Printexc.to_string exn) ) ; + Stdlib.Printexc.raise_with_backtrace exn bt ;; -main ~input:Caml.Sys.argv.(1) ~output:(Some "-") +main ~input:Stdlib.Sys.argv.(1) ~output:(Some "-") diff --git a/infer/src/pulse/PulseAccess.ml b/infer/src/pulse/PulseAccess.ml index d39529bad65..4c759ade96f 100644 --- a/infer/src/pulse/PulseAccess.ml +++ b/infer/src/pulse/PulseAccess.ml @@ -49,7 +49,7 @@ module type S = sig val yojson_of_t : t -> Yojson.Safe.t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t end module T = struct @@ -71,4 +71,4 @@ module T = struct end include T -module Set = Caml.Set.Make (T) +module Set = Stdlib.Set.Make (T) diff --git a/infer/src/pulse/PulseAccess.mli b/infer/src/pulse/PulseAccess.mli index 3e54be70f48..df2b8583a1d 100644 --- a/infer/src/pulse/PulseAccess.mli +++ b/infer/src/pulse/PulseAccess.mli @@ -36,7 +36,7 @@ module type S = sig val yojson_of_t : t -> Yojson.Safe.t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t end include S with type key := AbstractValue.t diff --git a/infer/src/pulse/PulseFormula.ml b/infer/src/pulse/PulseFormula.ml index fb24ebb16fc..9967f71a9b0 100644 --- a/infer/src/pulse/PulseFormula.ml +++ b/infer/src/pulse/PulseFormula.ml @@ -1433,7 +1433,7 @@ module Term = struct module VarMap = struct - include Caml.Map.Make (struct + include Stdlib.Map.Make (struct type nonrec t = t [@@deriving compare] end) @@ -1852,7 +1852,7 @@ module Atom = struct let simplify_linear atom = map_terms atom ~f:Term.simplify_linear module Set = struct - include Caml.Set.Make (struct + include Stdlib.Set.Make (struct type nonrec t = t [@@deriving compare] end) @@ -1868,7 +1868,7 @@ module Atom = struct end module Map = struct - include Caml.Map.Make (struct + include Stdlib.Map.Make (struct type nonrec t = t [@@deriving compare] end) @@ -1905,7 +1905,7 @@ let pp_new_eqs fmt new_eqs = module MakeOccurrences (In : sig type t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t val pp_set : (F.formatter -> Var.t -> unit) -> F.formatter -> Set.t -> unit end) = @@ -1952,7 +1952,7 @@ module TermDomainOrRange = struct type t = Term.t * domain_or_range [@@deriving compare] - module Set = Caml.Set.Make (struct + module Set = Stdlib.Set.Make (struct type nonrec t = t [@@deriving compare] end) @@ -4394,20 +4394,20 @@ module DeadVariables = struct (* a map where a vertex maps to the set of destination vertices *) (* unused but can be useful for debugging *) let _pp_graph fmt graph = - Caml.Hashtbl.iter (fun v vs -> F.fprintf fmt "%a->{%a}" Var.pp v Var.Set.pp vs) graph + Stdlib.Hashtbl.iter (fun v vs -> F.fprintf fmt "%a->{%a}" Var.pp v Var.Set.pp vs) graph in (* 16 because why not *) - let graph = Caml.Hashtbl.create 16 in + let graph = Stdlib.Hashtbl.create 16 in (* add [src->vs] to [graph] (but not the symmetric edges) *) let add_set src vs = let dest = - match Caml.Hashtbl.find_opt graph src with + match Stdlib.Hashtbl.find_opt graph src with | None -> vs | Some dest0 -> Var.Set.union vs dest0 in - Caml.Hashtbl.replace graph src dest + Stdlib.Hashtbl.replace graph src dest in (* add edges between all pairs of [vs] *) let add_all vs = Var.Set.iter (fun v -> add_set v vs) vs in @@ -4451,8 +4451,8 @@ module DeadVariables = struct in [graph]. *) let get_reachable_from graph vs = (* HashSet represented as a [Hashtbl.t] mapping items to [()], start with the variables in [vs] *) - let reachable = Caml.Hashtbl.create (Var.Set.cardinal vs) in - Var.Set.iter (fun v -> Caml.Hashtbl.add reachable v ()) vs ; + let reachable = Stdlib.Hashtbl.create (Var.Set.cardinal vs) in + Var.Set.iter (fun v -> Stdlib.Hashtbl.add reachable v ()) vs ; (* Do a Dijkstra-style graph transitive closure in [graph] starting from [vs]. At each step, [new_vs] contains the variables to explore next. Iterative to avoid blowing the stack. *) let new_vs = ref (Var.Set.elements vs) in @@ -4460,17 +4460,17 @@ module DeadVariables = struct (* pop [new_vs] *) let[@warning "-partial-match"] (v :: rest) = !new_vs in new_vs := rest ; - Caml.Hashtbl.find_opt graph v + Stdlib.Hashtbl.find_opt graph v |> Option.iter ~f:(fun vs' -> Var.Set.iter (fun v' -> - if not (Caml.Hashtbl.mem reachable v') then ( + if not (Stdlib.Hashtbl.mem reachable v') then ( (* [v'] seen for the first time: we need to explore it *) - Caml.Hashtbl.replace reachable v' () ; + Stdlib.Hashtbl.replace reachable v' () ; new_vs := v' :: !new_vs ) ) vs' ) done ; - Caml.Hashtbl.to_seq_keys reachable |> Var.Set.of_seq + Stdlib.Hashtbl.to_seq_keys reachable |> Var.Set.of_seq (** Get rid of atoms when they contain only variables that do not appear in atoms mentioning diff --git a/infer/src/pulse/PulseModelsCSharp.ml b/infer/src/pulse/PulseModelsCSharp.ml index 165da610315..308b2389c5b 100644 --- a/infer/src/pulse/PulseModelsCSharp.ml +++ b/infer/src/pulse/PulseModelsCSharp.ml @@ -10,7 +10,7 @@ open PulseBasicInterface open PulseDomainInterface open PulseOperationResult.Import open PulseModelsImport -module StringSet = Caml.Set.Make (String) +module StringSet = Stdlib.Set.Make (String) let mk_csharp_field namespace clazz field = Fieldname.make diff --git a/infer/src/pulse/PulseModelsJava.ml b/infer/src/pulse/PulseModelsJava.ml index 07ef08a1c55..1adcb373dcd 100644 --- a/infer/src/pulse/PulseModelsJava.ml +++ b/infer/src/pulse/PulseModelsJava.ml @@ -13,7 +13,7 @@ open PulseModelsImport module DSL = PulseModelsDSL module Cplusplus = PulseModelsCpp module GenericArrayBackedCollection = PulseModelsGenericArrayBackedCollection -module StringSet = Caml.Set.Make (String) +module StringSet = Stdlib.Set.Make (String) let mk_java_field pkg clazz field = Fieldname.make (Typ.JavaClass (JavaClassName.make ~package:(Some pkg) ~classname:clazz)) field diff --git a/infer/src/pulse/PulseOperations.ml b/infer/src/pulse/PulseOperations.ml index 7aeaebdd5ee..135f252491c 100644 --- a/infer/src/pulse/PulseOperations.ml +++ b/infer/src/pulse/PulseOperations.ml @@ -118,7 +118,7 @@ end let conservatively_initialize_args arg_values astate = let reachable_values = - AbductiveDomain.reachable_addresses_from (Caml.List.to_seq arg_values) astate `Post + AbductiveDomain.reachable_addresses_from (Stdlib.List.to_seq arg_values) astate `Post in AbstractValue.Set.fold AddressAttributes.initialize reachable_values astate diff --git a/infer/src/pulse/PulseSatUnsat.ml b/infer/src/pulse/PulseSatUnsat.ml index 19a4a760d2a..25102a8ffb9 100644 --- a/infer/src/pulse/PulseSatUnsat.ml +++ b/infer/src/pulse/PulseSatUnsat.ml @@ -50,7 +50,7 @@ let filter l = List.filter_map l ~f:sat let seq_fold seq ~init ~f = let open Import in - Caml.Seq.fold_left + Stdlib.Seq.fold_left (fun accum x -> let* accum in f accum x ) diff --git a/infer/src/pulse/PulseSatUnsat.mli b/infer/src/pulse/PulseSatUnsat.mli index f67eb91a427..a5e199f2634 100644 --- a/infer/src/pulse/PulseSatUnsat.mli +++ b/infer/src/pulse/PulseSatUnsat.mli @@ -34,7 +34,7 @@ val to_list : 'a t -> 'a list val filter : 'a t list -> 'a list (** keep only [Sat _] elements *) -val seq_fold : 'a Caml.Seq.t -> init:'accum -> f:('accum -> 'a -> 'accum t) -> 'accum t +val seq_fold : 'a Stdlib.Seq.t -> init:'accum -> f:('accum -> 'a -> 'accum t) -> 'accum t module Import : sig include module type of Types diff --git a/infer/src/pulse/PulseTaintItemMatcher.ml b/infer/src/pulse/PulseTaintItemMatcher.ml index 0cab2e8b6aa..d865dc76768 100644 --- a/infer/src/pulse/PulseTaintItemMatcher.ml +++ b/infer/src/pulse/PulseTaintItemMatcher.ml @@ -84,7 +84,7 @@ let check_regex name_regex elem ?source_file exclude_in exclude_names = | _ -> L.d_printfln " Matching regex wrt %s, found match!" elem ; true - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> false diff --git a/infer/src/pulse/PulseTaintOperations.ml b/infer/src/pulse/PulseTaintOperations.ml index ed013ea3bc5..3da9c95d0b2 100644 --- a/infer/src/pulse/PulseTaintOperations.ml +++ b/infer/src/pulse/PulseTaintOperations.ml @@ -179,7 +179,7 @@ let exclude_in_loc source_file exclude_in exclude_matching = match Str.search_forward exclude_matching source_file 0 with | _ -> true - | exception Caml.Not_found -> + | exception Stdlib.Not_found -> false ) | _ -> false diff --git a/infer/src/pulse/PulseTransitiveAccessChecker.ml b/infer/src/pulse/PulseTransitiveAccessChecker.ml index f23bed61951..6f126fc4386 100644 --- a/infer/src/pulse/PulseTransitiveAccessChecker.ml +++ b/infer/src/pulse/PulseTransitiveAccessChecker.ml @@ -89,7 +89,7 @@ end = struct class_name ) in let regexp_match regexp name = - match Str.search_forward regexp name 0 with _ -> true | exception Caml.Not_found -> false + match Str.search_forward regexp name 0 with _ -> true | exception Stdlib.Not_found -> false in let match_class_name_regex regexp = Option.exists class_name ~f:(fun class_name -> diff --git a/infer/src/pulse/PulseValueHistory.ml b/infer/src/pulse/PulseValueHistory.ml index c51ba4524ae..d6832d2f365 100644 --- a/infer/src/pulse/PulseValueHistory.ml +++ b/infer/src/pulse/PulseValueHistory.ml @@ -64,7 +64,7 @@ and t = | UnknownCall of {f: CallEvent.t; actuals: t list; location: Location.t; timestamp: Timestamp.t} [@@deriving compare, equal] -module EventSet = Caml.Set.Make (struct +module EventSet = Stdlib.Set.Make (struct type t = event [@@deriving compare] end) diff --git a/infer/src/pulse/PulseValueHistory.mli b/infer/src/pulse/PulseValueHistory.mli index 272d20c8724..ecb57a51204 100644 --- a/infer/src/pulse/PulseValueHistory.mli +++ b/infer/src/pulse/PulseValueHistory.mli @@ -19,9 +19,9 @@ module CellId : sig val next : unit -> t - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t end type event = diff --git a/infer/src/pulse/unit/PulseFormulaTest.ml b/infer/src/pulse/unit/PulseFormulaTest.ml index 9f1d3411a86..be4b15385a2 100644 --- a/infer/src/pulse/unit/PulseFormulaTest.ml +++ b/infer/src/pulse/unit/PulseFormulaTest.ml @@ -135,11 +135,11 @@ let ( && ) f1 f2 phi = f1 phi >>= f2 (* we remember a mapping [Var.t -> string] to print more readable results that mention the user-defined variables by their readable names instead of [v123] *) -let var_names = Caml.Hashtbl.create 4 +let var_names = Stdlib.Hashtbl.create 4 let mk_var name = let v = AbstractValue.mk_fresh () in - Caml.Hashtbl.add var_names v name ; + Stdlib.Hashtbl.add var_names v name ; v @@ -169,7 +169,7 @@ let () = PulseContext.set_tenv_global_for_testing dummy_tenv let global_state = AnalysisGlobalState.save () let pp_var fmt v = - match Caml.Hashtbl.find_opt var_names v with + match Stdlib.Hashtbl.find_opt var_names v with | Some name -> F.pp_print_string fmt name | None -> diff --git a/infer/src/python/PyIR.ml b/infer/src/python/PyIR.ml index 6fb885d7ca7..653c797eb58 100644 --- a/infer/src/python/PyIR.ml +++ b/infer/src/python/PyIR.ml @@ -39,7 +39,7 @@ module rec Ident : sig val print : t end - module Hashtbl : Caml.Hashtbl.S with type key = t + module Hashtbl : Stdlib.Hashtbl.S with type key = t end = struct type t = string [@@deriving equal, compare, hash] @@ -63,7 +63,7 @@ end = struct let print = "print" end - module Hashtbl = Caml.Hashtbl.Make (struct + module Hashtbl = Stdlib.Hashtbl.Make (struct type nonrec t = t let equal = equal @@ -81,7 +81,7 @@ and QualName : sig val pp : F.formatter -> t -> unit - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t end = struct type t = {module_name: string; function_name: string} [@@deriving compare, equal] @@ -101,7 +101,7 @@ end = struct {function_name; module_name} - module Map = Caml.Map.Make (struct + module Map = Stdlib.Map.Make (struct type nonrec t = t let compare = compare @@ -133,7 +133,7 @@ module NodeName : sig val pp : F.formatter -> t -> unit module Map : sig - include Caml.Map.S with type key = t + include Stdlib.Map.S with type key = t val map_result : f:(key -> 'a -> ('b, 'c) result) -> 'a t -> ('b t, 'c) result end @@ -151,7 +151,7 @@ end = struct let get_offset {offset} = offset module Map = struct - include Caml.Map.Make (struct + include Stdlib.Map.Make (struct type nonrec t = t let compare = compare @@ -177,7 +177,7 @@ module SSA = struct let next n = 1 + n - module Hashtbl = Caml.Hashtbl.Make (struct + module Hashtbl = Stdlib.Hashtbl.Make (struct type nonrec t = t let equal = equal @@ -2635,7 +2635,7 @@ module Module = struct F.fprintf fmt "@]@\n" end -module CodeMap : Caml.Map.S with type key = FFI.Code.t = Caml.Map.Make (FFI.Code) +module CodeMap : Stdlib.Map.S with type key = FFI.Code.t = Stdlib.Map.Make (FFI.Code) let build_code_object_unique_name module_name code = let rec visit map outer_name ({FFI.Code.co_consts} as code) = diff --git a/infer/src/python/PyIR.mli b/infer/src/python/PyIR.mli index 7553b343e92..62e9705315b 100644 --- a/infer/src/python/PyIR.mli +++ b/infer/src/python/PyIR.mli @@ -25,7 +25,7 @@ end module NodeName : sig type t [@@deriving equal] - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t val pp : Format.formatter -> t -> unit end @@ -37,7 +37,7 @@ module SSA : sig val pp : Format.formatter -> t -> unit - module Hashtbl : Caml.Hashtbl.S with type key = t + module Hashtbl : Stdlib.Hashtbl.S with type key = t end module Ident : sig @@ -47,7 +47,7 @@ module Ident : sig val pp : Format.formatter -> t -> unit - module Hashtbl : Caml.Hashtbl.S with type key = t + module Hashtbl : Stdlib.Hashtbl.S with type key = t module Special : sig val name : t @@ -67,7 +67,7 @@ module QualName : sig val pp : Format.formatter -> t -> unit - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t end module UnaryOp : sig diff --git a/infer/src/python/PyIRExec.ml b/infer/src/python/PyIRExec.ml index 6d57eebc1b0..0133dee7643 100644 --- a/infer/src/python/PyIRExec.ml +++ b/infer/src/python/PyIRExec.ml @@ -11,7 +11,7 @@ open PyIR let todo msg = L.die InternalError "TODO: %s" msg -module GenericUnsafeHashtbl (H : Caml.Hashtbl.S) = struct +module GenericUnsafeHashtbl (H : Stdlib.Hashtbl.S) = struct let get hashtbl mk_error_msg key = match H.find_opt hashtbl key with | Some v -> diff --git a/infer/src/python/unit/PySemTest.ml b/infer/src/python/unit/PySemTest.ml index c726703422a..3bc946e577c 100644 --- a/infer/src/python/unit/PySemTest.ml +++ b/infer/src/python/unit/PySemTest.ml @@ -7,7 +7,7 @@ open! IStd module F = Format -module StringHashtble = Caml.Hashtbl.Make (String) +module StringHashtble = Stdlib.Hashtbl.Make (String) let newbindings () = StringHashtble.create 17 diff --git a/infer/src/textual/Textual.ml b/infer/src/textual/Textual.ml index 2dda5f51622..d6d4081a859 100644 --- a/infer/src/textual/Textual.ml +++ b/infer/src/textual/Textual.ml @@ -8,7 +8,7 @@ open! IStd module F = Format module L = Logging -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module Lang = struct type t = Java | Hack | Python [@@deriving equal] @@ -53,7 +53,7 @@ module Location = struct F.fprintf fmt "" - module Set = Caml.Set.Make (T) + module Set = Stdlib.Set.Make (T) end module SourceFile = struct @@ -90,9 +90,9 @@ module type NAME = sig module HashSet : HashSet.S with type elt = t - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t end module Name : NAME = struct @@ -116,8 +116,8 @@ module Name : NAME = struct module Hashtbl = Hashtbl.Make (T) module HashSet = HashSet.Make (T) - module Map = Caml.Map.Make (T) - module Set = Caml.Set.Make (T) + module Map = Stdlib.Map.Make (T) + module Set = Stdlib.Set.Make (T) end module ProcName : NAME = Name @@ -327,9 +327,9 @@ module Ident : sig val pp : F.formatter -> t -> unit - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t (* We assume idents are totally ordered. [next id] returns an ident that is strictly greater than [id] wrt this order. *) diff --git a/infer/src/textual/Textual.mli b/infer/src/textual/Textual.mli index 520efad9c45..4f28a74ba3f 100644 --- a/infer/src/textual/Textual.mli +++ b/infer/src/textual/Textual.mli @@ -7,7 +7,7 @@ open! IStd module F = Format -module Hashtbl = Caml.Hashtbl +module Hashtbl = Stdlib.Hashtbl module Lang : sig type t = Java | Hack | Python [@@deriving equal] @@ -43,9 +43,9 @@ module type NAME = sig module HashSet : HashSet.S with type elt = t - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t end module ProcName : NAME (* procedure names, without their attachement type *) @@ -161,9 +161,9 @@ end module Ident : sig type t [@@deriving equal] - module Set : Caml.Set.S with type elt = t + module Set : Stdlib.Set.S with type elt = t - module Map : Caml.Map.S with type key = t + module Map : Stdlib.Map.S with type key = t val of_int : int -> t diff --git a/infer/src/textual/TextualTransform.ml b/infer/src/textual/TextualTransform.ml index 02554dc7e97..2091f201334 100644 --- a/infer/src/textual/TextualTransform.ml +++ b/infer/src/textual/TextualTransform.ml @@ -724,7 +724,7 @@ let remove_if_terminator module_ = let let_propagation module_ = let get id ident_map = try Ident.Map.find id ident_map - with Caml.Not_found -> + with Stdlib.Not_found -> L.die InternalError "Textual.let_propagation.get failed: unknown identifier %a" Ident.pp id in let build_equations pdesc : Exp.t Ident.Map.t = @@ -809,7 +809,7 @@ let out_of_ssa module_ = in fun node -> try NodeName.Map.find node map - with Caml.Not_found -> L.die InternalError "Textual.remove_ssa_params internal error" + with Stdlib.Not_found -> L.die InternalError "Textual.remove_ssa_params internal error" in (* Compute which nodes are handlers. This should *really* be done upfront in hackc but for now just see which ones are listed as handlers for some other other node. We'll assume that handlers are disjoint from diff --git a/infer/src/unit/analyzerTester.ml b/infer/src/unit/analyzerTester.ml index b81c4e1368d..aa0a3fa9770 100644 --- a/infer/src/unit/analyzerTester.ml +++ b/infer/src/unit/analyzerTester.ml @@ -285,7 +285,7 @@ struct try let {AbstractInterpreter.State.post} = M.find node_id inv_map in F.asprintf "%a" pp_state post - with Caml.Not_found -> "_|_" + with Stdlib.Not_found -> "_|_" in if not (String.equal inv_str post_str) then let error_msg = diff --git a/infer/src/unit/schedulerTests.ml b/infer/src/unit/schedulerTests.ml index 9c3964d4f4e..4302256150b 100644 --- a/infer/src/unit/schedulerTests.ml +++ b/infer/src/unit/schedulerTests.ml @@ -65,7 +65,7 @@ module MockProcCfg = struct ~f:(fun (_, succs) -> List.exists ~f:(fun node -> equal_id (Node.id node) node_id) succs) t |> List.map ~f:fst |> List.fold ~init ~f - with Not_found_s _ | Caml.Not_found -> init + with Not_found_s _ | Stdlib.Not_found -> init let fold_nodes t ~init ~f = List.map ~f:fst t |> List.fold ~init ~f