[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
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent a5129e57db
commit 0da5435d9d

@ -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

@ -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)

@ -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")

@ -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)

@ -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

Loading…
Cancel
Save