From 42470d8809be6a35310a4a7373a5e007aea24d30 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Mon, 14 Oct 2019 10:07:02 -0700 Subject: [PATCH] [hmm] sexp_{option,list} -> {option,list} Summary: By some unfortunate logic, OCaml often decides to use `sexp_list`/`sexp_option` instead of just `list`/`option`. Sometimes these get copy/pasted in interface files. It would be good to tell OCaml not to do that in the first place but in the meantime: this diff. Reviewed By: ngorogiannis Differential Revision: D17907938 fbshipit-source-id: 7546834a2 --- infer/src/backend/CallGraph.mli | 2 +- infer/src/backend/callbacks.mli | 2 +- infer/src/bufferoverrun/bounds.mli | 6 +++--- infer/src/checkers/impurityDomain.mli | 6 +++--- infer/src/checkers/loopInvariant.mli | 5 ++--- infer/src/concurrency/ConcurrencyModels.mli | 6 +++--- infer/src/nullsafe/Initializers.mli | 12 ++++++------ infer/src/topl/ToplUtils.mli | 3 +-- sledge/src/symbheap/exec.mli | 2 +- 9 files changed, 21 insertions(+), 23 deletions(-) diff --git a/infer/src/backend/CallGraph.mli b/infer/src/backend/CallGraph.mli index 8716ca47d..bcf5d1583 100644 --- a/infer/src/backend/CallGraph.mli +++ b/infer/src/backend/CallGraph.mli @@ -60,7 +60,7 @@ val add_edge : t -> pname:Typ.Procname.t -> successor_pname:Typ.Procname.t -> un (** add an edge from [pname] to [successor_pname] in the graph, creating a node for [pname] if there isn't one already *) -val create_node : t -> Typ.Procname.t -> Typ.Procname.t sexp_list -> unit +val create_node : t -> Typ.Procname.t -> Typ.Procname.t list -> unit (** create a new node with edges from [pname] to [successor_pnames] in the graph *) val fold_flagged : t -> f:(Node.t -> 'a -> 'a) -> 'a -> 'a diff --git a/infer/src/backend/callbacks.mli b/infer/src/backend/callbacks.mli index 2bd11018d..e26d2550a 100644 --- a/infer/src/backend/callbacks.mli +++ b/infer/src/backend/callbacks.mli @@ -34,5 +34,5 @@ val register_cluster_callback : name:string -> Language.t -> cluster_callback_t val iterate_procedure_callbacks : Exe_env.t -> Summary.t -> Summary.t (** Invoke all registered procedure callbacks on the given procedure. *) -val iterate_cluster_callbacks : Typ.Procname.t sexp_list -> Exe_env.t -> SourceFile.t -> unit +val iterate_cluster_callbacks : Typ.Procname.t list -> Exe_env.t -> SourceFile.t -> unit (** Invoke all registered cluster callbacks on a cluster of procedures. *) diff --git a/infer/src/bufferoverrun/bounds.mli b/infer/src/bufferoverrun/bounds.mli index 1b30fc464..d614e971a 100644 --- a/infer/src/bufferoverrun/bounds.mli +++ b/infer/src/bufferoverrun/bounds.mli @@ -84,7 +84,7 @@ module Bound : sig val widen_u_thresholds : thresholds:Z.t list -> t -> t -> t - val is_const : t -> Z.t sexp_option + val is_const : t -> Z.t option val plus_l : weak:bool -> t -> t -> t @@ -96,9 +96,9 @@ module Bound : sig val neg : t -> t - val div_const_l : t -> Ints.NonZeroInt.t -> t sexp_option + val div_const_l : t -> Ints.NonZeroInt.t -> t option - val div_const_u : t -> Ints.NonZeroInt.t -> t sexp_option + val div_const_u : t -> Ints.NonZeroInt.t -> t option val get_symbols : t -> Symb.SymbolSet.t diff --git a/infer/src/checkers/impurityDomain.mli b/infer/src/checkers/impurityDomain.mli index 8c8bca1c8..fc1c34784 100644 --- a/infer/src/checkers/impurityDomain.mli +++ b/infer/src/checkers/impurityDomain.mli @@ -12,7 +12,7 @@ type trace = [@@deriving compare] module ModifiedVar : sig - type nonempty_action_type = trace * trace sexp_list + type nonempty_action_type = trace * trace list type t = {var: Var.t; trace_list: nonempty_action_type} end @@ -31,7 +31,7 @@ val add_to_errlog : nesting:int -> str:string -> ModifiedVar.t - -> Errlog.loc_trace_elem sexp_list - -> Errlog.loc_trace_elem sexp_list + -> Errlog.loc_trace_elem list + -> Errlog.loc_trace_elem list val join : t -> t -> t diff --git a/infer/src/checkers/loopInvariant.mli b/infer/src/checkers/loopInvariant.mli index 72d57e7b8..6389d0365 100644 --- a/infer/src/checkers/loopInvariant.mli +++ b/infer/src/checkers/loopInvariant.mli @@ -29,15 +29,14 @@ val get_inv_vars_in_loop : -> is_pure_by_default:bool -> get_callee_purity:( Typ.Procname.t -> PurityDomain.ModifiedParamIndices.t AbstractDomain.Types.top_lifted - sexp_option) + option) -> Procdesc.Node.t -> LoopNodes.t -> VarSet.t val get_loop_inv_var_map : Tenv.t - -> ( Typ.Procname.t - -> PurityDomain.ModifiedParamIndices.t AbstractDomain.Types.top_lifted sexp_option) + -> (Typ.Procname.t -> PurityDomain.ModifiedParamIndices.t AbstractDomain.Types.top_lifted option) -> ReachingDefs.invariant_map -> LoopNodes.t LoopHeadToInvVars.t -> invariant_map diff --git a/infer/src/concurrency/ConcurrencyModels.mli b/infer/src/concurrency/ConcurrencyModels.mli index 2d3db6062..ac3c91e0b 100644 --- a/infer/src/concurrency/ConcurrencyModels.mli +++ b/infer/src/concurrency/ConcurrencyModels.mli @@ -54,19 +54,19 @@ val find_override_or_superclass_annotated : -> (Annot.Item.t -> bool) -> Tenv.t -> Typ.Procname.t - -> annotation_trail sexp_option + -> annotation_trail option (** check if a method's transitive annotations satisfy the given predicate *) val annotated_as_worker_thread : attrs_of_pname:(BuiltinDecl.t -> ProcAttributes.t option) -> Tenv.t -> Typ.Procname.t - -> annotation_trail sexp_option + -> annotation_trail option (** check if a method is transitively annotated @WorkerThread *) val annotated_as_uithread_equivalent : attrs_of_pname:(BuiltinDecl.t -> ProcAttributes.t option) -> Tenv.t -> Typ.Procname.t - -> annotation_trail sexp_option + -> annotation_trail option (** check if a method is transitively annotated @UIThread or equivalent *) diff --git a/infer/src/nullsafe/Initializers.mli b/infer/src/nullsafe/Initializers.mli index 2e3645791..f4453cc4d 100644 --- a/infer/src/nullsafe/Initializers.mli +++ b/infer/src/nullsafe/Initializers.mli @@ -22,15 +22,15 @@ val final_initializer_typestates_lazy : Tenv.t -> Typ.Procname.t -> Procdesc.t - -> (Typ.Procname.t -> Typ.Procname.t sexp_list) - -> (bool -> Typ.Procname.t -> Procdesc.t -> 'a sexp_option -> 'b * 'c sexp_option) - -> (Typ.Procname.t * 'c) sexp_list lazy_t + -> (Typ.Procname.t -> Typ.Procname.t list) + -> (bool -> Typ.Procname.t -> Procdesc.t -> 'a option -> 'b * 'c option) + -> (Typ.Procname.t * 'c) list lazy_t (** Typestates after the current constructor and all initializer procedures. *) val final_constructor_typestates_lazy : Tenv.t -> Typ.Procname.t - -> (Typ.Procname.t -> Typ.Procname.t sexp_list) - -> (bool -> Typ.Procname.t -> Procdesc.t -> 'a sexp_option -> 'b * 'c sexp_option) - -> (Typ.Procname.t * 'c) sexp_list lazy_t + -> (Typ.Procname.t -> Typ.Procname.t list) + -> (bool -> Typ.Procname.t -> Procdesc.t -> 'a option -> 'b * 'c option) + -> (Typ.Procname.t * 'c) list lazy_t (** Typestates after all constructors. *) diff --git a/infer/src/topl/ToplUtils.mli b/infer/src/topl/ToplUtils.mli index edd568b7a..258f17be6 100644 --- a/infer/src/topl/ToplUtils.mli +++ b/infer/src/topl/ToplUtils.mli @@ -23,8 +23,7 @@ val local_var : Typ.Procname.t -> string -> Exp.t val constant_int : int -> Exp.t -val topl_call : - Ident.t -> Typ.desc -> Location.t -> string -> (Exp.t * Typ.t) sexp_list -> Sil.instr +val topl_call : Ident.t -> Typ.desc -> Location.t -> string -> (Exp.t * Typ.t) list -> Sil.instr (** Call a TOPL function; that is, a static member of "topl.Property" with java.lang.Object arguments and return [ret_id] of type [ret_typ].*) diff --git a/sledge/src/symbheap/exec.mli b/sledge/src/symbheap/exec.mli index 03dea716c..7a5d9a557 100644 --- a/sledge/src/symbheap/exec.mli +++ b/sledge/src/symbheap/exec.mli @@ -17,7 +17,7 @@ val memcpy : Sh.t -> dst:Term.t -> src:Term.t -> len:Term.t -> Sh.t option val memmov : Sh.t -> dst:Term.t -> src:Term.t -> len:Term.t -> Sh.t option val alloc : Sh.t -> reg:Var.var -> num:Term.t -> len:Term.t -> Sh.t option val free : Sh.t -> ptr:Term.t -> Sh.t option -val nondet : Sh.t -> Var.var sexp_option -> Sh.t +val nondet : Sh.t -> Var.var option -> Sh.t val abort : Sh.t -> Sh.t option val intrinsic :