From 426ddb5e1c40329a3d2bf92fc118efc3d0ce4bb1 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Thu, 23 Aug 2018 18:14:15 -0700 Subject: [PATCH] [nullable] make the Eradicate flag use_models to be the default mode Summary: There no clear alternative to using models of the standard library at this point so we can simplify the code a little bit Reviewed By: mbouaziz Differential Revision: D9491062 fbshipit-source-id: 9e5a6eeea --- infer/src/eradicate/models.ml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/infer/src/eradicate/models.ml b/infer/src/eradicate/models.ml index c5b9913f7..9b2497ae5 100644 --- a/infer/src/eradicate/models.ml +++ b/infer/src/eradicate/models.ml @@ -12,9 +12,6 @@ module L = Logging (** Module for standard library models. *) -(* use model annotations for library functions *) -let use_models = true - (** Module for inference of parameter and return annotations. *) module Inference = struct let enabled = false @@ -142,20 +139,16 @@ let get_modelled_annotated_signature proc_attributes = if mark_r then AnnotatedSignature.mark_return AnnotatedSignature.Nullable ann_sig else ann_sig in let lookup_models_nullable ann_sig = - if use_models then try let mark = Hashtbl.find annotated_table_nullable proc_id in AnnotatedSignature.mark proc_name AnnotatedSignature.Nullable ann_sig mark with Caml.Not_found -> ann_sig - else ann_sig in let lookup_models_present ann_sig = - if use_models then try let mark = Hashtbl.find annotated_table_present proc_id in AnnotatedSignature.mark proc_name AnnotatedSignature.Present ann_sig mark with Caml.Not_found -> ann_sig - else ann_sig in annotated_signature |> lookup_models_nullable |> lookup_models_present |> infer_return |> infer_parameters @@ -163,13 +156,11 @@ let get_modelled_annotated_signature proc_attributes = (** Return true when the procedure has been modelled for nullable. *) let is_modelled_nullable proc_name = - if use_models then let proc_id = Typ.Procname.to_unique_id proc_name in try ignore (Hashtbl.find annotated_table_nullable proc_id) ; true with Caml.Not_found -> false - else false (** Check if the procedure is one of the known Preconditions.checkNotNull. *)