[pulse] remove pulse-specific matchers from PatternMatch

Summary: We even have matchers in PulseModels that can do the same thing.

Reviewed By: skcho

Differential Revision: D28540278

fbshipit-source-id: 4bfd8a13e
master
Jules Villard 4 years ago committed by Facebook GitHub Bot
parent 7b5bfa1796
commit caad455e42

@ -341,22 +341,6 @@ module ObjectiveC = struct
String.is_prefix ~prefix:"CG" procname && String.is_suffix ~suffix:"Release" procname
let is_modelled_as_alloc _ procname =
match Config.pulse_model_alloc_pattern with
| Some regex ->
Str.string_match regex procname 0
| None ->
false
let is_modelled_as_release _ procname =
match Config.pulse_model_release_pattern with
| Some regex ->
Str.string_match regex procname 0
| None ->
false
let implements_ns_string_variants tenv procname =
implements "NSString" tenv procname || implements "NSAttributedString" tenv procname
end

@ -215,10 +215,6 @@ module ObjectiveC : sig
val is_core_foundation_create_or_copy : Tenv.t -> string -> bool
val is_core_graphics_release : Tenv.t -> string -> bool
val is_modelled_as_alloc : Tenv.t -> string -> bool
val is_modelled_as_release : Tenv.t -> string -> bool
end
val is_entry_point : Procname.t -> bool

@ -1718,12 +1718,11 @@ module ProcNameDispatcher = struct
; +map_context_tenv PatternMatch.ObjectiveC.is_core_foundation_create_or_copy
&--> C.malloc_no_param
; +BuiltinDecl.(match_builtin malloc_no_fail) <>$ capt_exp $--> C.malloc_not_null
; +map_context_tenv PatternMatch.ObjectiveC.is_modelled_as_alloc
&--> C.malloc_not_null_no_param
; +match_regexp_opt Config.pulse_model_alloc_pattern &--> C.malloc_not_null_no_param
; +map_context_tenv PatternMatch.ObjectiveC.is_core_graphics_release
<>$ capt_arg_payload $--> ObjCCoreFoundation.cf_bridging_release
; -"CFRelease" <>$ capt_arg_payload $--> ObjCCoreFoundation.cf_bridging_release
; +map_context_tenv PatternMatch.ObjectiveC.is_modelled_as_release
; +match_regexp_opt Config.pulse_model_release_pattern
<>$ capt_arg_payload $--> ObjCCoreFoundation.cf_bridging_release
; -"CFAutorelease" <>$ capt_arg_payload $--> ObjCCoreFoundation.cf_bridging_release
; -"CFBridgingRelease" <>$ capt_arg_payload $--> ObjCCoreFoundation.cf_bridging_release

Loading…
Cancel
Save