diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 36dfe2fe7..dd39a31ed 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -418,7 +418,6 @@ OPTIONS Failure_exe (enabled by default), GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL (disabled by default), - GRAPHQL_FIELD_ACCESS (enabled by default), GUARDEDBY_VIOLATION (enabled by default), IMPURE_FUNCTION (enabled by default), INEFFICIENT_KEYSET_ITERATOR (enabled by default), diff --git a/infer/man/man1/infer-report.txt b/infer/man/man1/infer-report.txt index 609027274..1d9aefb55 100644 --- a/infer/man/man1/infer-report.txt +++ b/infer/man/man1/infer-report.txt @@ -160,7 +160,6 @@ OPTIONS Failure_exe (enabled by default), GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL (disabled by default), - GRAPHQL_FIELD_ACCESS (enabled by default), GUARDEDBY_VIOLATION (enabled by default), IMPURE_FUNCTION (enabled by default), INEFFICIENT_KEYSET_ITERATOR (enabled by default), diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index ba7e467a8..e2cd59d15 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -418,7 +418,6 @@ OPTIONS Failure_exe (enabled by default), GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL (disabled by default), - GRAPHQL_FIELD_ACCESS (enabled by default), GUARDEDBY_VIOLATION (enabled by default), IMPURE_FUNCTION (enabled by default), INEFFICIENT_KEYSET_ITERATOR (enabled by default), diff --git a/infer/src/IR/Typ.ml b/infer/src/IR/Typ.ml index a543e78af..e0b281fae 100644 --- a/infer/src/IR/Typ.ml +++ b/infer/src/IR/Typ.ml @@ -904,8 +904,6 @@ module Procname = struct let is_cpp_lambda {method_name} = String.is_substring ~substring:"operator()" method_name - let is_operator_equal {method_name} = String.is_substring ~substring:"operator=" method_name - let pp_verbose_kind fmt = function | CPPMethod {mangled} | CPPDestructor {mangled} -> F.fprintf fmt "(%s)" (Option.value ~default:"" mangled) diff --git a/infer/src/IR/Typ.mli b/infer/src/IR/Typ.mli index eb04ed905..2bf60f097 100644 --- a/infer/src/IR/Typ.mli +++ b/infer/src/IR/Typ.mli @@ -478,9 +478,6 @@ being the name of the struct, [None] means the parameter is of some other type. val is_cpp_lambda : t -> bool (** Return whether the procname is a cpp lambda. *) - - val is_operator_equal : t -> bool - (** Return true if the procname is operator= *) end module C : sig diff --git a/infer/src/absint/PatternMatch.ml b/infer/src/absint/PatternMatch.ml index 04d1352cd..c073e2efa 100644 --- a/infer/src/absint/PatternMatch.ml +++ b/infer/src/absint/PatternMatch.ml @@ -240,8 +240,6 @@ let get_vararg_type_names tenv (call_node : Procdesc.Node.t) (ivar : Pvar.t) : s type_names [] call_node -let is_getter pname_java = String.is_prefix ~prefix:"get" (Typ.Procname.Java.get_method pname_java) - let type_is_class typ = match typ.Typ.desc with | Tptr ({desc= Tstruct _}, _) -> diff --git a/infer/src/absint/PatternMatch.mli b/infer/src/absint/PatternMatch.mli index c10d1be45..9aeb92cfd 100644 --- a/infer/src/absint/PatternMatch.mli +++ b/infer/src/absint/PatternMatch.mli @@ -22,9 +22,6 @@ val get_vararg_type_names : Tenv.t -> Procdesc.Node.t -> Pvar.t -> string list val method_is_initializer : Tenv.t -> ProcAttributes.t -> bool (** Check if the method is one of the known initializer methods. *) -val is_getter : Typ.Procname.Java.t -> bool -(** Is this a getter proc name? *) - val is_subtype : Tenv.t -> Typ.Name.t -> Typ.Name.t -> bool (** Is the type a transitive subtype of the typename? *) diff --git a/infer/src/al/ALIssues.mli b/infer/src/al/ALIssues.mli index bb4ed4f47..08a152071 100644 --- a/infer/src/al/ALIssues.mli +++ b/infer/src/al/ALIssues.mli @@ -42,11 +42,3 @@ val expand_checkers : macros_map -> paths_map -> CTL.ctl_checker list -> CTL.ctl val create_parsed_linters : string -> CTL.ctl_checker list -> linter list val remove_new_lines_and_whitespace : string -> string - -val fill_issue_desc_info_and_log : - CLintersContext.context - -> witness:Ctl_parser_types.ast_node - -> current_node:Ctl_parser_types.ast_node - -> CIssue.issue_desc - -> Location.t - -> unit diff --git a/infer/src/al/CTLTypes.ml b/infer/src/al/CTLTypes.ml index dcce61dcd..9efcace30 100644 --- a/infer/src/al/CTLTypes.ml +++ b/infer/src/al/CTLTypes.ml @@ -70,8 +70,6 @@ type t = | InObjCClass of t * t [@@deriving compare] -let equal = [%compare.equal: t] - let has_transition phi = match phi with | True diff --git a/infer/src/al/CTLTypes.mli b/infer/src/al/CTLTypes.mli index 2f511c901..e0ba6c4d8 100644 --- a/infer/src/al/CTLTypes.mli +++ b/infer/src/al/CTLTypes.mli @@ -68,8 +68,6 @@ val is_transition_to_successor : transitions -> bool val has_transition : t -> bool -val equal : t -> t -> bool - val pp_transition : Format.formatter -> transitions option -> unit val pp_formula : Format.formatter -> t -> unit diff --git a/infer/src/al/ctl_parser_types.mli b/infer/src/al/ctl_parser_types.mli index c85363017..aefe7b54d 100644 --- a/infer/src/al/ctl_parser_types.mli +++ b/infer/src/al/ctl_parser_types.mli @@ -21,8 +21,6 @@ val ast_node_type : ast_node -> string val ast_node_kind : ast_node -> string -val ast_node_pointer : ast_node -> int - val ast_node_has_kind : ALVar.alexp list -> ast_node -> bool val ast_node_unique_string_id : ast_node -> string diff --git a/infer/src/base/IssueType.ml b/infer/src/base/IssueType.ml index 9c9dc19cd..742ce2d3c 100644 --- a/infer/src/base/IssueType.ml +++ b/infer/src/base/IssueType.ml @@ -298,8 +298,6 @@ let _global_variable_initialized_with_function_or_method_call = register_from_string ~enabled:false "GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL" -let graphql_field_access = register_from_string "GRAPHQL_FIELD_ACCESS" - let guardedby_violation_racerd = register_from_string "GUARDEDBY_VIOLATION" ~hum:"GuardedBy Violation" diff --git a/infer/src/base/IssueType.mli b/infer/src/base/IssueType.mli index 6a047c3ef..ace92c273 100644 --- a/infer/src/base/IssueType.mli +++ b/infer/src/base/IssueType.mli @@ -173,8 +173,6 @@ val failure_exe : t val field_not_null_checked : t -val graphql_field_access : t - val guardedby_violation_racerd : t val impure_function : t diff --git a/infer/src/bufferoverrun/absLoc.mli b/infer/src/bufferoverrun/absLoc.mli index 1aaa151ae..a5eb4d955 100644 --- a/infer/src/bufferoverrun/absLoc.mli +++ b/infer/src/bufferoverrun/absLoc.mli @@ -39,8 +39,6 @@ module Allocsite : sig val literal_string : string -> t - val get_literal_string : t -> string option - val get_param_path : t -> Symb.SymbolPath.partial option val eq : t -> t -> Boolean.t diff --git a/infer/src/bufferoverrun/bufferOverrunModels.ml b/infer/src/bufferoverrun/bufferOverrunModels.ml index 165956880..fd67819cb 100644 --- a/infer/src/bufferoverrun/bufferOverrunModels.ml +++ b/infer/src/bufferoverrun/bufferOverrunModels.ml @@ -16,11 +16,6 @@ module Sem = BufferOverrunSemantics module Relation = BufferOverrunDomainRelation module Trace = BufferOverrunTrace open BoUtils.ModelEnv - -module Val = struct - type t = unit -end - open ProcnameDispatcher.Call.FuncArg type exec_fun = model_env -> ret:Ident.t * Typ.t -> Dom.Mem.t -> Dom.Mem.t diff --git a/infer/src/bufferoverrun/itv.ml b/infer/src/bufferoverrun/itv.ml index 24887542e..1392bfa45 100644 --- a/infer/src/bufferoverrun/itv.ml +++ b/infer/src/bufferoverrun/itv.ml @@ -662,8 +662,6 @@ let of_big_int : Z.t -> t = fun n -> NonBottom (ItvPure.of_big_int n) let of_int_lit : IntLit.t -> t = fun n -> NonBottom (ItvPure.of_int_lit n) -let of_pulse_value : PulseAbstractValue.t -> t = fun v -> NonBottom (ItvPure.of_pulse_value v) - let is_false : t -> bool = function NonBottom x -> ItvPure.is_false x | Bottom -> false let le : lhs:t -> rhs:t -> bool = leq @@ -681,14 +679,6 @@ let lift1 : (ItvPure.t -> ItvPure.t) -> t -> t = fun f -> function Bottom -> Bottom | NonBottom x -> NonBottom (f x) -let lift1opt : (ItvPure.t -> ItvPure.t option) -> t -> t option = - fun f -> function - | Bottom -> - Some Bottom - | NonBottom x -> - f x |> Option.map ~f:(fun v -> NonBottom v) - - let bind1_gen : bot:'a -> (ItvPure.t -> 'a) -> t -> 'a = fun ~bot f x -> match x with Bottom -> bot | NonBottom x -> f x @@ -787,10 +777,6 @@ let max_sem : ?use_minmax_bound:bool -> t -> t -> t = fun ?use_minmax_bound -> lift2 (ItvPure.max_sem ?use_minmax_bound) -let arith_binop : Binop.t -> t -> t -> t = fun bop -> lift2 (ItvPure.arith_binop bop) - -let arith_unop : Unop.t -> t -> t option = fun unop -> lift1opt (ItvPure.arith_unop unop) - let prune_eq_zero : t -> t = bind1 ItvPure.prune_eq_zero let prune_ne_zero : t -> t = bind1 ItvPure.prune_ne_zero diff --git a/infer/src/bufferoverrun/itv.mli b/infer/src/bufferoverrun/itv.mli index 0ad2da821..bfa013d33 100644 --- a/infer/src/bufferoverrun/itv.mli +++ b/infer/src/bufferoverrun/itv.mli @@ -159,8 +159,6 @@ val of_big_int : Z.t -> t val of_int_lit : IntLit.t -> t -val of_pulse_value : PulseAbstractValue.t -> t - val get_const : t -> Z.t option val is_zero : t -> bool @@ -237,10 +235,6 @@ val mod_sem : t -> t -> t val ne_sem : t -> t -> Boolean.t -val arith_binop : Binop.t -> t -> t -> t - -val arith_unop : Unop.t -> t -> t option - val prune_eq_zero : t -> t val prune_ne_zero : t -> t diff --git a/infer/src/bufferoverrun/symb.ml b/infer/src/bufferoverrun/symb.ml index 25275f1af..97190a475 100644 --- a/infer/src/bufferoverrun/symb.ml +++ b/infer/src/bufferoverrun/symb.ml @@ -359,13 +359,6 @@ module Symbol = struct SymbolPath.is_global path - let is_pulse_value : t -> bool = function - | PulseValue _ -> - true - | OneValue _ | BoundEnd _ -> - false - - let get_pulse_value_exn : t -> PulseAbstractValue.t = function | PulseValue v -> v diff --git a/infer/src/bufferoverrun/symb.mli b/infer/src/bufferoverrun/symb.mli index 958bec99f..58a1eda07 100644 --- a/infer/src/bufferoverrun/symb.mli +++ b/infer/src/bufferoverrun/symb.mli @@ -120,8 +120,6 @@ module Symbol : sig val exists_str : f:(string -> bool) -> t -> bool - val is_pulse_value : t -> bool - val get_pulse_value_exn : t -> PulseAbstractValue.t end diff --git a/infer/src/checkers/LithoDomain.ml b/infer/src/checkers/LithoDomain.ml index 941fd9214..97190a6a4 100644 --- a/infer/src/checkers/LithoDomain.ml +++ b/infer/src/checkers/LithoDomain.ml @@ -453,8 +453,6 @@ module NewDomain = struct ; return_called= Mem.widen ~prev:prev.return_called ~next:next.return_called ~num_iters } - let empty = {no_return_called= Mem.empty; return_called= Mem.empty} - let init tenv pname formals = {no_return_called= Mem.init tenv pname formals; return_called= Mem.empty} @@ -493,8 +491,6 @@ include struct let map_new f (o, n) = (o, f n) - let empty = (OldDomain.empty, NewDomain.empty) - let init tenv pname formals = (OldDomain.empty, NewDomain.init tenv pname formals) let add k v = map_old (OldDomain.add k v) diff --git a/infer/src/checkers/LithoDomain.mli b/infer/src/checkers/LithoDomain.mli index a17443ead..20d06746d 100644 --- a/infer/src/checkers/LithoDomain.mli +++ b/infer/src/checkers/LithoDomain.mli @@ -16,8 +16,6 @@ module LocalAccessPath : sig val make_from_access_expression : HilExp.AccessExpression.t -> Typ.Procname.t -> t - val make_from_pvar : Pvar.t -> Typ.t -> Typ.Procname.t -> t - val to_formal_option : t -> FormalMap.t -> t option val pp : F.formatter -> t -> unit @@ -42,10 +40,6 @@ module MethodCallPrefix : sig val make : LocalAccessPath.t -> Typ.Procname.t -> Location.t -> t - val pp : F.formatter -> t -> unit - - val procname_to_string : t -> string - val to_method_call : t -> MethodCall.t end @@ -76,8 +70,6 @@ include module type of AbstractDomain.Pair (OldDomain) (NewDomain) (** type for saving in summary payload *) type summary = OldDomain.t * NewDomain.Mem.t -val empty : t - val init : Tenv.t -> Typ.Procname.t -> (Pvar.t * Typ.t) list -> t val add : LocalAccessPath.t -> CallSet.t -> t -> t diff --git a/infer/src/checkers/LithoFramework.ml b/infer/src/checkers/LithoFramework.ml index 7c16b9146..e1770dc38 100644 --- a/infer/src/checkers/LithoFramework.ml +++ b/infer/src/checkers/LithoFramework.ml @@ -53,13 +53,6 @@ let is_component_create_method procname tenv = match Typ.Procname.get_method procname with "create" -> is_component procname tenv | _ -> false -let is_on_create_layout = function - | Typ.Procname.Java java_pname -> ( - match Typ.Procname.Java.get_method java_pname with "onCreateLayout" -> true | _ -> false ) - | _ -> - false - - let get_component_create_typ_opt procname tenv = match procname with | Typ.Procname.Java java_pname when is_component_create_method procname tenv -> diff --git a/infer/src/checkers/uninit.ml b/infer/src/checkers/uninit.ml index 7bd49420e..f28bc0f69 100644 --- a/infer/src/checkers/uninit.ml +++ b/infer/src/checkers/uninit.ml @@ -7,7 +7,6 @@ open! IStd module F = Format -module L = Logging module D = UninitDomain.Domain (** Forward analysis to compute uninitialized variables at each program point *) diff --git a/infer/src/concurrency/RacerDDomain.mli b/infer/src/concurrency/RacerDDomain.mli index bcd03e775..d13da4e57 100644 --- a/infer/src/concurrency/RacerDDomain.mli +++ b/infer/src/concurrency/RacerDDomain.mli @@ -139,8 +139,6 @@ module OwnershipAbstractValue : sig val owned : t - val unowned : t - val make_owned_if : int -> t end diff --git a/infer/src/concurrency/starvationDomain.ml b/infer/src/concurrency/starvationDomain.ml index c6aef5dfe..ee18f38a8 100644 --- a/infer/src/concurrency/starvationDomain.ml +++ b/infer/src/concurrency/starvationDomain.ml @@ -504,10 +504,6 @@ module AttributeDomain = struct find_opt acc_exp t |> Option.exists ~f:(function Attribute.ThreadGuard -> true | _ -> false) - let get_scheduler_constraint acc_exp t = - find_opt acc_exp t |> Option.bind ~f:(function Attribute.WorkScheduler c -> Some c | _ -> None) - - let is_future_done_guard acc_exp t = find_opt acc_exp t |> Option.exists ~f:(function Attribute.FutureDoneGuard _ -> true | _ -> false) diff --git a/infer/src/concurrency/starvationDomain.mli b/infer/src/concurrency/starvationDomain.mli index 943967718..5d63b9e54 100644 --- a/infer/src/concurrency/starvationDomain.mli +++ b/infer/src/concurrency/starvationDomain.mli @@ -128,9 +128,6 @@ module AttributeDomain : sig val is_thread_guard : HilExp.AccessExpression.t -> t -> bool - val get_scheduler_constraint : - HilExp.AccessExpression.t -> t -> StarvationModels.scheduler_thread_constraint option - val is_future_done_guard : HilExp.AccessExpression.t -> t -> bool (** does the given expr has attribute [FutureDone x] return [Some x] else [None] *) diff --git a/infer/src/deadcode/Makefile b/infer/src/deadcode/Makefile index 9e42bff04..3addccdd3 100644 --- a/infer/src/deadcode/Makefile +++ b/infer/src/deadcode/Makefile @@ -36,9 +36,11 @@ default: detect_dead_code ml_src_files_from_mlly:=$(shell find .. -not -path "../*clang_stubs/*" -not -path "../*java_stubs/*" -not -path "../_build/*" -regex '\.\./[a-zA-Z].*\.ml[ly]') -ml_src_files:=$(shell find .. -not -path "../*clang_stubs/*" -not -path "../*java_stubs/*" -not -path "../_build/*" -regex '\.\./[a-zA-Z].*\.mli') +ml_src_files:=$(shell for i in $$(find .. -not -path "../*clang_stubs/*" -not -path "../*java_stubs/*" -not -path "../_build/*" -regex '\.\./[a-zA-Z].*\.ml'); do echo $${i\#"../"}; done) -ml_src_files_without_mli:=$(shell cd .. && for i in $$(find . -not -path "../*clang_stubs/*" -not -path "../*java_stubs/*" -not -path "../_build/*" -regex '\./[a-zA-Z].*\.ml'); do [ -f $${i}i ] || echo $$i; done) +mli_src_files:=$(shell for i in $$(find .. -not -path "../*clang_stubs/*" -not -path "../*java_stubs/*" -not -path "../_build/*" -regex '\.\./[a-zA-Z].*\.mli'); do echo $${i\#"../"}; done) + +ml_src_files_without_mli:=$(shell for i in $$(find .. -not -path "../*clang_stubs/*" -not -path "../*java_stubs/*" -not -path "../_build/*" -regex '\.\./[a-zA-Z].*\.ml'); do [ -f $${i}i ] || echo $${i\#"../"}; done) .PHONY: depend depend: @@ -48,7 +50,7 @@ depend: -I c_stubs -I checkers -I clang -I concurrency -I facebook -I integration -I istd -I java \ -I labs -I nullsafe -I pulse -I scuba -I quandary -I topl -I unit -I unit/clang -I unit/nullsafe -I deadcode \ -I test_determinator \ - $(ml_src_files) > deadcode/.depend + $(ml_src_files) $(mli_src_files) > deadcode/.depend # circular dependency... not sure how to fix properly %.cmi: %.cmx diff --git a/infer/src/deadcode/dune.in b/infer/src/deadcode/dune.in index 8976cfedb..8f6352618 100644 --- a/infer/src/deadcode/dune.in +++ b/infer/src/deadcode/dune.in @@ -21,5 +21,5 @@ Format.sprintf |} (String.concat " " common_cflags) (String.concat " " common_optflags) - (String.concat " " common_libraries) + (String.concat " " ("InferCStubs" :: common_libraries)) |> Jbuild_plugin.V1.send diff --git a/infer/src/pulse/PulseBaseMemory.ml b/infer/src/pulse/PulseBaseMemory.ml index 8c38a5374..cc605e836 100644 --- a/infer/src/pulse/PulseBaseMemory.ml +++ b/infer/src/pulse/PulseBaseMemory.ml @@ -128,8 +128,6 @@ let find_opt addr memory = let fold_attrs f memory init = Graph.fold f (snd memory) init -let set_attrs addr attrs memory = (fst memory, Graph.add addr attrs (snd memory)) - let set_edges addr edges memory = (Graph.add addr edges (fst memory), snd memory) let set_cell addr (edges, attrs) memory = diff --git a/infer/src/pulse/PulseBaseMemory.mli b/infer/src/pulse/PulseBaseMemory.mli index 087a45f17..1cfba2b90 100644 --- a/infer/src/pulse/PulseBaseMemory.mli +++ b/infer/src/pulse/PulseBaseMemory.mli @@ -32,8 +32,6 @@ val find_opt : AbstractValue.t -> t -> cell option val fold_attrs : (AbstractValue.t -> Attributes.t -> 'acc -> 'acc) -> t -> 'acc -> 'acc -val set_attrs : AbstractValue.t -> Attributes.t -> t -> t - val set_edges : AbstractValue.t -> edges -> t -> t val set_cell : AbstractValue.t -> cell -> t -> t diff --git a/infer/src/pulse/PulseOperations.ml b/infer/src/pulse/PulseOperations.ml index 47457a7a8..3ea81a80c 100644 --- a/infer/src/pulse/PulseOperations.ml +++ b/infer/src/pulse/PulseOperations.ml @@ -365,10 +365,6 @@ let write_field location addr_trace_ref field addr_trace_obj astate = write_access location addr_trace_ref (FieldAccess field) addr_trace_obj astate -let havoc_deref location addr_trace trace_obj astate = - write_deref location ~ref:addr_trace ~obj:(AbstractValue.mk_fresh (), trace_obj) astate - - let havoc_field location addr_trace field trace_obj astate = write_field location addr_trace field (AbstractValue.mk_fresh (), trace_obj) astate diff --git a/infer/src/pulse/PulseOperations.mli b/infer/src/pulse/PulseOperations.mli index 6850e4aee..21779b80f 100644 --- a/infer/src/pulse/PulseOperations.mli +++ b/infer/src/pulse/PulseOperations.mli @@ -58,9 +58,6 @@ val eval_binop : val havoc_id : Ident.t -> ValueHistory.t -> t -> t -val havoc_deref : - Location.t -> AbstractValue.t * ValueHistory.t -> ValueHistory.t -> t -> t access_result - val havoc_field : Location.t -> AbstractValue.t * ValueHistory.t