From 0da5435d9d2f88c9054cc935595f4900b4870c2c Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Thu, 7 Jun 2018 21:33:49 -0700 Subject: [PATCH] [infer][backend] remove unecessary function Summary.pdesc_resolve_attributes Summary: I don't understand what this function is for. Let's remove it. Reviewed By: mbouaziz Differential Revision: D8320839 fbshipit-source-id: eeb14f7 --- infer/src/backend/Summary.ml | 11 ----------- infer/src/backend/Summary.mli | 3 --- infer/src/backend/reporting.ml | 2 +- infer/src/biabduction/Rearrange.ml | 2 +- infer/src/eradicate/eradicate.ml | 4 ++-- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/infer/src/backend/Summary.ml b/infer/src/backend/Summary.ml index d77d1a60e..5550ff70c 100644 --- a/infer/src/backend/Summary.ml +++ b/infer/src/backend/Summary.ml @@ -224,17 +224,6 @@ let proc_resolve_attributes proc_name = Attributes.load proc_name -(** Like proc_resolve_attributes but start from a proc_desc. *) -let pdesc_resolve_attributes proc_desc = - let proc_name = Procdesc.get_proc_name proc_desc in - match proc_resolve_attributes proc_name with - | Some proc_attributes -> - proc_attributes - | None -> - (* this should not happen *) - assert false - - (** Save summary for the procedure into the spec database *) let store (summ: t) = let final_summary = {summ with status= Status.Analyzed} in diff --git a/infer/src/backend/Summary.mli b/infer/src/backend/Summary.mli index 22646a625..81f67ec31 100644 --- a/infer/src/backend/Summary.mli +++ b/infer/src/backend/Summary.mli @@ -101,9 +101,6 @@ val pp_html : SourceFile.t -> Pp.color -> Format.formatter -> t -> unit val pp_text : Format.formatter -> t -> unit (** Print the summary in text format *) -val pdesc_resolve_attributes : Procdesc.t -> ProcAttributes.t -(** Like proc_resolve_attributes but start from a proc_desc. *) - val proc_resolve_attributes : Typ.Procname.t -> ProcAttributes.t option (** Try to find the attributes for a defined proc. First look at specs (to get attributes computed by analysis) diff --git a/infer/src/backend/reporting.ml b/infer/src/backend/reporting.ml index 54eca440a..0106ab311 100644 --- a/infer/src/backend/reporting.ml +++ b/infer/src/backend/reporting.ml @@ -102,7 +102,7 @@ let log_issue_external procname ?clang_method_kind err_kind ?loc ?node_id ?sessi let is_suppressed ?(field_name= None) tenv proc_desc kind = let lookup = Tenv.lookup tenv in - let proc_attributes = Summary.pdesc_resolve_attributes proc_desc in + let proc_attributes = Procdesc.get_attributes proc_desc in (* Errors can be suppressed with annotations. An error of kind CHECKER_ERROR_NAME can be suppressed with the following annotations: - @android.annotation.SuppressLint("checker-error-name") diff --git a/infer/src/biabduction/Rearrange.ml b/infer/src/biabduction/Rearrange.ml index ebae0820b..ed90a3b43 100644 --- a/infer/src/biabduction/Rearrange.ml +++ b/infer/src/biabduction/Rearrange.ml @@ -1505,7 +1505,7 @@ let is_weak_captured_var pdesc var_name = let var_has_annotation ?(check_weak_captured_var= false) pdesc is_annotation pvar = let is_weak_captured_var = is_weak_captured_var pdesc (Pvar.to_string pvar) in - let ann_sig = Models.get_modelled_annotated_signature (Summary.pdesc_resolve_attributes pdesc) in + let ann_sig = Models.get_modelled_annotated_signature (Procdesc.get_attributes pdesc) in AnnotatedSignature.param_has_annot is_annotation pvar ann_sig || (check_weak_captured_var && is_weak_captured_var) diff --git a/infer/src/eradicate/eradicate.ml b/infer/src/eradicate/eradicate.ml index 358c5326f..3cbd673d4 100644 --- a/infer/src/eradicate/eradicate.ml +++ b/infer/src/eradicate/eradicate.ml @@ -335,11 +335,11 @@ module MkCallback (Extension : ExtensionT) : CallBackT = struct Typ.Procname.Java.is_access_method java_pname | _ -> false ) - || (Summary.pdesc_resolve_attributes proc_desc).ProcAttributes.is_bridge_method + || (Procdesc.get_attributes proc_desc).ProcAttributes.is_bridge_method then None else let annotated_signature = - Models.get_modelled_annotated_signature (Summary.pdesc_resolve_attributes proc_desc) + Models.get_modelled_annotated_signature (Procdesc.get_attributes proc_desc) in Some annotated_signature in