|
|
@ -370,8 +370,8 @@ let write_html_file linereader filename procs =
|
|
|
|
Io_infer.Html.close (fd, fmt)
|
|
|
|
Io_infer.Html.close (fd, fmt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(** Create filename.ext.html for each file in the cluster. *)
|
|
|
|
(** Create the HTML debug file for the source file. *)
|
|
|
|
let write_all_html_files cluster =
|
|
|
|
let write_all_html_files source_file =
|
|
|
|
let opt_whitelist_regex =
|
|
|
|
let opt_whitelist_regex =
|
|
|
|
match Config.write_html_whitelist_regex with
|
|
|
|
match Config.write_html_whitelist_regex with
|
|
|
|
| [] ->
|
|
|
|
| [] ->
|
|
|
@ -385,20 +385,22 @@ let write_all_html_files cluster =
|
|
|
|
Str.string_match regex fname 0 )
|
|
|
|
Str.string_match regex fname 0 )
|
|
|
|
in
|
|
|
|
in
|
|
|
|
let linereader = LineReader.create () in
|
|
|
|
let linereader = LineReader.create () in
|
|
|
|
let cfg = Cfg.load cluster in
|
|
|
|
let procs_in_source = SourceFiles.proc_names_of_source source_file in
|
|
|
|
Option.iter cfg ~f:(fun cfg ->
|
|
|
|
let source_files_in_cfg, pdescs_in_cfg =
|
|
|
|
let source_files_in_cfg, pdescs_in_cfg =
|
|
|
|
List.fold procs_in_source ~init:(SourceFile.Set.empty, [])
|
|
|
|
Typ.Procname.Hash.fold
|
|
|
|
~f:(fun ((files, pdescs) as acc) proc_name ->
|
|
|
|
(fun _ proc_desc (files, pdescs) ->
|
|
|
|
match Procdesc.load proc_name with
|
|
|
|
|
|
|
|
| Some proc_desc ->
|
|
|
|
let updated_files =
|
|
|
|
let updated_files =
|
|
|
|
if Procdesc.is_defined proc_desc then
|
|
|
|
if Procdesc.is_defined proc_desc then
|
|
|
|
let file = (Procdesc.get_loc proc_desc).Location.file in
|
|
|
|
let file = (Procdesc.get_loc proc_desc).Location.file in
|
|
|
|
if is_whitelisted file then SourceFile.Set.add file files else files
|
|
|
|
if is_whitelisted file then SourceFile.Set.add file files else files
|
|
|
|
else files
|
|
|
|
else files
|
|
|
|
in
|
|
|
|
in
|
|
|
|
(updated_files, proc_desc :: pdescs) )
|
|
|
|
(updated_files, proc_desc :: pdescs)
|
|
|
|
cfg (SourceFile.Set.empty, [])
|
|
|
|
| None ->
|
|
|
|
in
|
|
|
|
acc )
|
|
|
|
SourceFile.Set.iter
|
|
|
|
in
|
|
|
|
(fun file -> write_html_file linereader file pdescs_in_cfg)
|
|
|
|
SourceFile.Set.iter
|
|
|
|
source_files_in_cfg )
|
|
|
|
(fun file -> write_html_file linereader file pdescs_in_cfg)
|
|
|
|
|
|
|
|
source_files_in_cfg
|
|
|
|