[attrs] look at capture DB only -- cost

Summary:
`AnalysisCallbacks.proc_resolve_attributes` introduces non-determinism because it first looks for the attributes in a (procdesc in a) summary and if it doesn't find it then returns the value in the attribute column from the capture DB.

The problem is:
- the main factor affecting the existence of a summary on-disk is timing;
- the two proc descs are generally different, as the one in the summary is preanalysed and the one in the capture DB is not;
- this extends to the attributes included in the proc desc in some cases.

The plan is to eliminate these calls one by one, replacing with `Attributes.load` which only looks at the capture DB attribute column.

Reviewed By: skcho

Differential Revision: D29816458

fbshipit-source-id: 681c55f4c
master
Nikos Gorogiannis 3 years ago committed by Facebook GitHub Bot
parent 1afd05a689
commit 567fa3f955

@ -435,9 +435,7 @@ let checker ({InterproceduralAnalysis.proc_desc; exe_env; analyze_dependency} as
let* _cost_summary, inferbo_summary, _ = get_summary_common callee_pname in
inferbo_summary
in
let get_formals callee_pname =
AnalysisCallbacks.proc_resolve_attributes callee_pname >>| Pvar.get_pvar_formals
in
let get_formals callee_pname = Attributes.load callee_pname >>| Pvar.get_pvar_formals in
let instr_cfg = InstrCFG.from_pdesc proc_desc in
let extras =
{ inferbo_invariant_map
@ -447,7 +445,7 @@ let checker ({InterproceduralAnalysis.proc_desc; exe_env; analyze_dependency} as
; get_summary
; get_formals
; get_proc_desc= AnalysisCallbacks.get_proc_desc
; proc_resolve_attributes= AnalysisCallbacks.proc_resolve_attributes }
; proc_resolve_attributes= Attributes.load }
in
AnalysisCallbacks.html_debug_new_node_session (NodeCFG.start_node node_cfg)
~pp_name:(fun f -> F.pp_print_string f "cost(worst-case)")

Loading…
Cancel
Save