[infer][backend] simplify the resolution of the attributes

Summary: If the procedure is defined, then the attributes should be the same on the specs files or on the attributes table.

Reviewed By: sblackshear

Differential Revision: D6910086

fbshipit-source-id: 709b290
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent 5f3c3ee3f9
commit 06406eae4e

@ -662,20 +662,11 @@ let proc_is_library proc_attributes =
If no attributes can be found, return None. If no attributes can be found, return None.
*) *)
let proc_resolve_attributes proc_name = let proc_resolve_attributes proc_name =
let from_attributes_table () = Attributes.load proc_name in match get_summary proc_name with
let from_specs () = Option.map ~f:get_attributes (get_summary proc_name) in | Some summary ->
match from_specs () with Some (get_attributes summary)
| Some attributes
-> (
if attributes.ProcAttributes.is_defined then Some attributes
else
match from_attributes_table () with
| Some attributes' ->
Some attributes'
| None ->
Some attributes )
| None -> | None ->
from_attributes_table () Attributes.load proc_name
(** Like proc_resolve_attributes but start from a proc_desc. *) (** Like proc_resolve_attributes but start from a proc_desc. *)

Loading…
Cancel
Save