[impurity] Read pulse from Payload

Summary: In impurity analysis, pick up the pulse summary rather than re-analyzing. Re-order the checkers so that we first analyze pulse.

Reviewed By: jvillard

Differential Revision: D19448296

fbshipit-source-id: 2987fa848
master
Ezgi Çiçek 5 years ago committed by Facebook Github Bot
parent a28ccbb180
commit 95bf0d3c98

@ -144,11 +144,11 @@ let report_errors summary modified_opt =
summary
let checker ({Callbacks.summary} as callback) : Summary.t =
let pulse_summary = Pulse.checker callback in
pulse_summary.payloads.pulse
|> Option.map ~f:(fun pre_posts ->
let checker {Callbacks.summary} : Summary.t =
let pdesc = Summary.get_proc_desc summary in
summary.payloads.pulse
|> Option.map ~f:(fun (pre_posts : PulseSummary.t) ->
List.fold pre_posts ~init:ImpurityDomain.pure ~f:(fun acc pre_post ->
let modified = extract_impurity (Summary.get_proc_desc summary) pre_post in
let modified = extract_impurity pdesc pre_post in
ImpurityDomain.join acc modified ) )
|> report_errors summary

@ -81,6 +81,11 @@ let all_checkers =
; callbacks=
[ (Procedure NullabilitySuggest.checker, Language.Java)
; (Procedure NullabilitySuggest.checker, Language.Clang) ] }
; { name= "impurity"
; active= Config.impurity
; callbacks=
[(Procedure Impurity.checker, Language.Java); (Procedure Impurity.checker, Language.Clang)]
}
; { name= "pulse"
; active= Config.pulse || Config.impurity
; callbacks=
@ -129,11 +134,6 @@ let all_checkers =
; (Cluster Starvation.reporting, Language.Java)
; (Procedure Starvation.analyze_procedure, Language.Clang)
; (Cluster Starvation.reporting, Language.Clang) ] }
; { name= "impurity"
; active= Config.impurity
; callbacks=
[(Procedure Impurity.checker, Language.Java); (Procedure Impurity.checker, Language.Clang)]
}
; { name= "purity"
; active= Config.purity || Config.loop_hoisting
; callbacks=

Loading…
Cancel
Save