diff --git a/infer/lib/linter_rules/linters.al b/infer/lib/linter_rules/linters.al index 4bf094591..0b168dc7a 100644 --- a/infer/lib/linter_rules/linters.al +++ b/infer/lib/linter_rules/linters.al @@ -137,11 +137,11 @@ DEFINE-CHECKER REGISTERED_OBSERVER_BEING_DEALLOCATED = { DEFINE-CHECKER STRONG_DELEGATE_WARNING = { - LET name_contains_delegate = property_named(REGEXP("[dD]elegate")); + LET name_contains_delegate = declaration_has_name(REGEXP("[dD]elegate")); LET name_does_not_contain_delegates = - NOT property_named(REGEXP("[dD]elegates")); + NOT declaration_has_name(REGEXP("[dD]elegates")); LET name_does_not_contains_queue = - NOT property_named(REGEXP("[qQ]ueue")); + NOT declaration_has_name(REGEXP("[qQ]ueue")); SET report_when = WHEN diff --git a/infer/src/clang/cPredicates.ml b/infer/src/clang/cPredicates.ml index af1772add..c6d5c0615 100644 --- a/infer/src/clang/cPredicates.ml +++ b/infer/src/clang/cPredicates.ml @@ -141,15 +141,6 @@ let call_instance_method an cname mname = compare_str_with_alexp omei.omei_selector mname | _ -> false -let property_named an name = - match an with - | Ctl_parser_types.Decl decl -> - (match Clang_ast_proj.get_named_decl_tuple decl with - | Some (_, n) -> - compare_str_with_alexp n.Clang_ast_t.ni_name name - | _ -> false) - | _ -> false - let is_objc_extension lcxt = CGeneral_utils.is_objc_extension lcxt.CLintersContext.translation_unit_context diff --git a/infer/src/clang/cPredicates.mli b/infer/src/clang/cPredicates.mli index be1c959d9..db2dfc629 100644 --- a/infer/src/clang/cPredicates.mli +++ b/infer/src/clang/cPredicates.mli @@ -21,8 +21,6 @@ val call_instance_method : Ctl_parser_types.ast_node -> ALVar.alexp -> ALVar.al val is_objc_interface_named : Ctl_parser_types.ast_node -> ALVar.alexp -> bool -val property_named : Ctl_parser_types.ast_node -> ALVar.alexp -> bool - val is_objc_extension : CLintersContext.context -> bool val is_syntactically_global_var : Ctl_parser_types.ast_node -> bool diff --git a/infer/src/clang/cTL.ml b/infer/src/clang/cTL.ml index 3ce5dac3e..39866572b 100644 --- a/infer/src/clang/cTL.ml +++ b/infer/src/clang/cTL.ml @@ -626,7 +626,6 @@ let rec eval_Atomic _pred_name args an lcxt = | "is_strong_property", [], an -> CPredicates.is_strong_property an | "is_unop_with_kind", [kind], an -> CPredicates.is_unop_with_kind an kind | "method_return_type", [typ], an -> CPredicates.method_return_type an typ - | "property_named", [word], an -> CPredicates.property_named an word | "within_responds_to_selector_block", [], an -> CPredicates.within_responds_to_selector_block lcxt an | _ -> failwith