From 06406eae4e5074ff0172065662035293c7264b5c Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Wed, 7 Feb 2018 17:19:42 -0800 Subject: [PATCH] [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 --- infer/src/backend/specs.ml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/infer/src/backend/specs.ml b/infer/src/backend/specs.ml index efd351a6f..27a932bd9 100644 --- a/infer/src/backend/specs.ml +++ b/infer/src/backend/specs.ml @@ -662,20 +662,11 @@ let proc_is_library proc_attributes = If no attributes can be found, return None. *) let proc_resolve_attributes proc_name = - let from_attributes_table () = Attributes.load proc_name in - let from_specs () = Option.map ~f:get_attributes (get_summary proc_name) in - match from_specs () with - | Some attributes - -> ( - if attributes.ProcAttributes.is_defined then Some attributes - else - match from_attributes_table () with - | Some attributes' -> - Some attributes' - | None -> - Some attributes ) + match get_summary proc_name with + | Some summary -> + Some (get_attributes summary) | None -> - from_attributes_table () + Attributes.load proc_name (** Like proc_resolve_attributes but start from a proc_desc. *)