[reporting] Skip traces for functions outside of project root

Summary:
Most of the time code outside of project root is not interesting to the user - it's either system library or infer C++ model. Skip all of them.
Previous logic was doing something similar, but in more selective way.
I also need this change for D4313428

Reviewed By: jvillard

Differential Revision: D4339298

fbshipit-source-id: c7b5544
master
Andrzej Kotulski 8 years ago committed by Facebook Github Bot
parent d044809b32
commit 29c42e5fe8

@ -136,10 +136,10 @@ let get_correct_type_from_objc_class_name type_name =>
Some (Typ.Tstruct type_name);
/** Returns true if the method is defined as a C++ model */
let pname_is_cpp_model callee_pname =>
/** Returns true if the method is defined under project root */
let pname_is_under_project_root callee_pname =>
switch (load_attributes callee_pname) {
| Some attrs => SourceFile.is_cpp_model attrs.ProcAttributes.loc.Location.file
| Some attrs => SourceFile.is_under_project_root attrs.ProcAttributes.loc.Location.file
| None => false
};

@ -29,8 +29,8 @@ let load_defined_attributes: cache_none::bool => Procname.t => option ProcAttrib
let get_correct_type_from_objc_class_name: Typename.t => option Typ.t;
/** Returns true if the method is defined as a C++ model */
let pname_is_cpp_model: Procname.t => bool;
/** Returns true if the method is defined under project root */
let pname_is_under_project_root: Procname.t => bool;
/* Find the file where the procedure was captured, if a cfg for that file exists.
Return also a boolean indicating whether the procedure is defined in an

@ -664,9 +664,7 @@ let prop_set_exn tenv pname prop se_exn =
(** Include a subtrace for a procedure call if the callee is not a model. *)
let include_subtrace callee_pname =
not (Specs.is_model callee_pname) &&
not (AttributesTable.pname_is_cpp_model callee_pname) &&
not (AttributesTable.is_whitelisted_cpp_method (Procname.to_string callee_pname))
not (Specs.is_model callee_pname) && (AttributesTable.pname_is_under_project_root callee_pname)
(** combine the spec's post with a splitting and actual precondition *)
let combine tenv

Loading…
Cancel
Save