From 515ce95a98cc915ca3a26b4ff9a5afd7ef007eab Mon Sep 17 00:00:00 2001 From: Dulma Rodriguez Date: Wed, 9 Dec 2015 07:38:20 -0800 Subject: [PATCH] Remove unused code in ObjCProperty_decl Summary: public These methods are now unsused. Reviewed By: akotulski Differential Revision: D2739163 fb-gh-sync-id: 1f68e89 --- infer/src/clang/objcProperty_decl.ml | 40 --------------------------- infer/src/clang/objcProperty_decl.mli | 11 -------- 2 files changed, 51 deletions(-) diff --git a/infer/src/clang/objcProperty_decl.ml b/infer/src/clang/objcProperty_decl.ml index 3dd1df652..47728e6d6 100644 --- a/infer/src/clang/objcProperty_decl.ml +++ b/infer/src/clang/objcProperty_decl.ml @@ -167,14 +167,6 @@ let print_property_table () = Property.print_property_table () let find_properties_class = Property.find_properties_class -let get_ivarname_property pidi = - match pidi.Clang_ast_t.opidi_ivar_decl with - | Some dr -> (match dr.Clang_ast_t.dr_name with - | Some n -> n - | _ -> assert false) - | _ -> (* If ivar is not defined than we need to take the name of the property to define ivar*) - Ast_utils.property_name pidi - let upgrade_property_accessor property_key property_type meth_decl new_defined is_getter = let is_defined meth_decl = match meth_decl with @@ -208,29 +200,12 @@ let check_for_property curr_class method_name meth_decl body = check_property_accessor curr_class method_name true; check_property_accessor curr_class method_name false -let method_is_property_accesor cls method_name = - let properties_class = find_properties_class cls in - let method_is_getter (property_name, property_type) res_opt = - match res_opt with - | Some res -> res_opt - | None -> - match property_type with (_, _, _, (getter_name, _), (setter_name, _), _) -> - if method_name = getter_name then Some (property_name, property_type, true) - else if method_name = setter_name then Some (property_name, property_type, false) - else None in - IList.fold_right method_is_getter properties_class None - let is_strong_property property_type = let _, attrs, _, _, _, _ = property_type in IList.exists (fun a -> match a with | `Strong -> true | _ -> false) attrs -let property_loc property_type = - let _, attrs, decl_info, _, _, _ = property_type in - let src_range = decl_info.Clang_ast_t.di_source_range in - CLocation.get_sil_location_from_range src_range true - let prepare_dynamic_property curr_class decl_info property_impl_decl_info = let pname = Ast_utils.property_name property_impl_decl_info in let prop_name = pname.Clang_ast_t.ni_name in @@ -259,21 +234,6 @@ let prepare_dynamic_property curr_class decl_info property_impl_decl_info = (* No names of fields/method to collect from ObjCPropertyImplDecl when Synthesized *) [] -let is_property_read_only attributes = - IList.mem (Ast_utils.property_attribute_eq) `Readonly attributes - -let get_memory_management_attribute attributes = - let memory_management_attributes = Ast_utils.get_memory_management_attributes () in - try Some (IList.find ( - fun att -> IList.mem (Ast_utils.property_attribute_eq) - att memory_management_attributes) attributes) - with Not_found -> None - -let get_ivar_name prop_name ivar_opt = - match ivar_opt with - | Some ivar_name -> ivar_name - | None -> Ast_utils.generated_ivar_name prop_name - let add_properties_to_table curr_class decl_list = let add_property_to_table dec = match dec with diff --git a/infer/src/clang/objcProperty_decl.mli b/infer/src/clang/objcProperty_decl.mli index 5e1859477..79fdcff23 100644 --- a/infer/src/clang/objcProperty_decl.mli +++ b/infer/src/clang/objcProperty_decl.mli @@ -60,23 +60,12 @@ val reset_property_table : unit -> unit val print_property_table : unit -> unit -val is_property_read_only : Clang_ast_t.property_attribute list -> bool - val find_properties_class : CContext.curr_class -> (Clang_ast_t.named_decl_info * property_type) list -val method_is_property_accesor : CContext.curr_class -> string -> - (Clang_ast_t.named_decl_info * property_type * bool) option - -val get_ivar_name : Clang_ast_t.named_decl_info -> Clang_ast_t.named_decl_info option -> - Clang_ast_t.named_decl_info - (* Given a property type returns whether the property is strong *) val is_strong_property : property_type -> bool -(* Given a property type returns whether the property line *) -val property_loc : property_type -> Location.t - (* Checks whether mname is a getter or setter of the ivar given in dr_name *) val is_getter_setter : CContext.curr_class -> Procname.t -> Clang_ast_t.named_decl_info option -> bool