[attrs] look at capture DB only -- annotreach

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: D29816181

fbshipit-source-id: e7a2f809c
master
Nikos Gorogiannis 3 years ago committed by Facebook GitHub Bot
parent 8f797bab84
commit ac158b26ea

@ -115,8 +115,7 @@ let report_annotation_stack ({InterproceduralAnalysis.proc_desc; err_log} as ana
let report_call_stack end_of_stack lookup_next_calls report call_site sink_map =
let lookup_location pname =
Option.value_map ~f:ProcAttributes.get_loc ~default:Location.dummy
(AnalysisCallbacks.proc_resolve_attributes pname)
Option.value_map ~f:ProcAttributes.get_loc ~default:Location.dummy (Attributes.load pname)
in
let rec loop fst_call_loc visited_pnames trace (callee_pname, call_loc) =
if end_of_stack callee_pname then report fst_call_loc trace callee_pname call_loc
@ -206,7 +205,7 @@ end
module CxxAnnotationSpecs = struct
let src_path_of pname =
match AnalysisCallbacks.proc_resolve_attributes pname with
match Attributes.load pname with
| Some proc_attrs ->
let loc = ProcAttributes.get_loc proc_attrs in
SourceFile.to_string loc.file

Loading…
Cancel
Save