Restore printing of html for procedures

Reviewed By: dulmarod

Differential Revision: D3018362

fb-gh-sync-id: be07cd0
shipit-source-id: be07cd0
master
Cristiano Calcagno 9 years ago committed by Facebook Github Bot 6
parent 730a2afaaf
commit 71f81f102c

@ -117,7 +117,7 @@ let restore_global_state st =
let do_analysis ~propagate_exceptions curr_pdesc callee_pname = let do_analysis ~propagate_exceptions curr_pdesc callee_pname =
let curr_pname = Cfg.Procdesc.get_proc_name curr_pdesc in let curr_pname = Cfg.Procdesc.get_proc_name curr_pdesc in
let really_do_analysis analyze_proc = let really_do_analysis callee_pdesc analyze_proc =
if trace () then L.stderr "[%d] really_do_analysis %a -> %a@." if trace () then L.stderr "[%d] really_do_analysis %a -> %a@."
!nesting !nesting
Procname.pp curr_pname Procname.pp curr_pname
@ -150,7 +150,8 @@ let do_analysis ~propagate_exceptions curr_pdesc callee_pname =
Specs.status = Specs.INACTIVE; Specs.status = Specs.INACTIVE;
timestamp = summary.Specs.timestamp + 1 } in timestamp = summary.Specs.timestamp + 1 } in
Specs.add_summary callee_pname summary'; Specs.add_summary callee_pname summary';
Checkers.ST.store_summary callee_pname in Checkers.ST.store_summary callee_pname;
Printer.proc_write_log false callee_pdesc in
let log_error_and_continue exn kind = let log_error_and_continue exn kind =
Reporting.log_error callee_pname exn; Reporting.log_error callee_pname exn;
@ -194,8 +195,10 @@ let do_analysis ~propagate_exceptions curr_pdesc callee_pname =
when procedure_should_be_analyzed callee_pname -> when procedure_should_be_analyzed callee_pname ->
begin begin
match callbacks.get_proc_desc callee_pname with match callbacks.get_proc_desc callee_pname with
| Some _ -> really_do_analysis callbacks.analyze_ondemand | Some callee_pdesc ->
| None -> () really_do_analysis callee_pdesc callbacks.analyze_ondemand
| None ->
()
end end
| _ -> | _ ->
() (* skipping *) () (* skipping *)

@ -258,9 +258,10 @@ let finish_session node =
end end
(** Write log file for the proc *) (** Write log file for the proc *)
let _proc_write_log whole_seconds cfg pname = let proc_write_log whole_seconds pdesc =
match Cfg.Procdesc.find_from_name cfg pname with if !Config.write_html then
| Some pdesc -> begin
let pname = Cfg.Procdesc.get_proc_name pdesc in
let nodes = IList.sort Cfg.Node.compare (Cfg.Procdesc.get_nodes pdesc) in let nodes = IList.sort Cfg.Node.compare (Cfg.Procdesc.get_nodes pdesc) in
let linenum = (Cfg.Node.get_loc (IList.hd nodes)).Location.line in let linenum = (Cfg.Node.get_loc (IList.hd nodes)).Location.line in
let fd, fmt = let fd, fmt =
@ -281,10 +282,7 @@ let _proc_write_log whole_seconds cfg pname =
| Some summary -> | Some summary ->
Specs.pp_summary (pe_html Black) whole_seconds fmt summary; Specs.pp_summary (pe_html Black) whole_seconds fmt summary;
Io_infer.Html.close (fd, fmt)) Io_infer.Html.close (fd, fmt))
| None -> () end
let proc_write_log whole_seconds cfg pname =
if !Config.write_html then _proc_write_log whole_seconds cfg pname
(** Creare a hash table mapping line numbers to the set of errors occurring on that line *) (** Creare a hash table mapping line numbers to the set of errors occurring on that line *)
let create_errors_per_line err_log = let create_errors_per_line err_log =

@ -29,7 +29,7 @@ val start_session : Cfg.node -> Location.t -> Procname.t -> int -> unit
val finish_session : Cfg.node -> unit val finish_session : Cfg.node -> unit
(** Write log file for the proc, the boolean indicates whether to print whole seconds only *) (** Write log file for the proc, the boolean indicates whether to print whole seconds only *)
val proc_write_log : bool -> Cfg.cfg -> Procname.t -> unit val proc_write_log : bool -> Cfg.Procdesc.t -> unit
(** Module to read specific lines from files. (** Module to read specific lines from files.
The data from any file will stay in memory until the handle is collected by the gc *) The data from any file will stay in memory until the handle is collected by the gc *)

Loading…
Cancel
Save