diff --git a/infer/src/IR/Cfg.re b/infer/src/IR/Cfg.re index 6951cbd36..090a5e9ce 100644 --- a/infer/src/IR/Cfg.re +++ b/infer/src/IR/Cfg.re @@ -115,33 +115,6 @@ let load_cfg_from_file (filename: DB.filename) :option cfg => Serialization.from_file cfg_serializer filename; -/** save a copy in the results dir of the source files of procedures defined in the cfg, - unless an updated copy already exists */ -let save_source_files cfg => { - let process_proc _ pdesc => { - let loc = Procdesc.get_loc pdesc; - let source_file = loc.Location.file; - let source_file_str = DB.source_file_to_abs_path source_file; - let dest_file = DB.source_file_in_resdir source_file; - let dest_file_str = DB.filename_to_string dest_file; - let needs_copy = - Procdesc.is_defined pdesc && - Sys.file_exists source_file_str && ( - not (Sys.file_exists dest_file_str) || - DB.file_modified_time (DB.filename_from_string source_file_str) > - DB.file_modified_time dest_file - ); - if needs_copy { - switch (copy_file source_file_str dest_file_str) { - | Some _ => () - | None => L.err "Error cannot create copy of source file %s@." source_file_str - } - } - }; - iter_proc_desc cfg process_proc -}; - - /** Save the .attr files for the procedures in the cfg. */ let save_attributes source_file cfg => { let save_proc pdesc => { @@ -332,15 +305,8 @@ let mark_unchanged_pdescs cfg_new cfg_old => { /** Save a cfg into a file */ -let store_cfg_to_file - save_sources::save_sources=true - source_file::source_file - (filename: DB.filename) - (cfg: cfg) => { +let store_cfg_to_file source_file::source_file (filename: DB.filename) (cfg: cfg) => { inline_java_synthetic_methods cfg; - if save_sources { - save_source_files cfg - }; if Config.incremental_procs { switch (load_cfg_from_file filename) { | Some old_cfg => mark_unchanged_pdescs cfg old_cfg diff --git a/infer/src/IR/Cfg.rei b/infer/src/IR/Cfg.rei index 98484308f..7e3c3beab 100644 --- a/infer/src/IR/Cfg.rei +++ b/infer/src/IR/Cfg.rei @@ -24,8 +24,7 @@ let load_cfg_from_file: DB.filename => option cfg; /** Save a cfg into a file, and save a copy of the source files if the boolean is true */ -let store_cfg_to_file: - save_sources::bool? => source_file::DB.source_file => DB.filename => cfg => unit; +let store_cfg_to_file: source_file::DB.source_file => DB.filename => cfg => unit; /** {2 Functions for manipulating an interprocedural CFG} */ diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index 68124adf4..0541fc9a2 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -74,7 +74,6 @@ let remove_results_dir () = let create_results_dir () = create_path (Config.results_dir // Config.captured_dir_name) ; - create_path (Config.results_dir // Config.sources_dir_name) ; create_path (Config.results_dir // Config.specs_dir_name) let clean_results_dir () = diff --git a/infer/src/backend/printer.ml b/infer/src/backend/printer.ml index 03de9c0f3..b4d837e31 100644 --- a/infer/src/backend/printer.ml +++ b/infer/src/backend/printer.ml @@ -62,11 +62,7 @@ struct else None let from_file_linenum hash fname linenum = - let fname_in_resdir = - DB.source_file_in_resdir fname in - let sourcefile_in_resdir = - DB.abs_source_file_from_path (DB.filename_to_string fname_in_resdir) in - from_file_linenum_original hash sourcefile_in_resdir linenum + from_file_linenum_original hash fname linenum let from_loc hash loc = from_file_linenum hash loc.Location.file loc.Location.line diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index f47210bb5..e1bbea3d6 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -186,8 +186,6 @@ let smt_output = false let source_file_extentions = [".java"; ".m"; ".mm"; ".c"; ".cc"; ".cpp"; ".h"] -let sources_dir_name = "sources" - let specs_dir_name = "specs" let specs_files_suffix = ".specs" diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index d1dcb526e..149f2cdd7 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -112,7 +112,6 @@ val save_compact_summaries : bool val save_time_in_summaries : bool val smt_output : bool val source_file_extentions : string list -val sources_dir_name : string val specs_dir_name : string val specs_files_suffix : string val start_filename : string diff --git a/infer/src/base/DB.ml b/infer/src/base/DB.ml index 890e3361c..7cd6b7adc 100644 --- a/infer/src/base/DB.ml +++ b/infer/src/base/DB.ml @@ -119,17 +119,10 @@ let source_dir_get_internal_file source_dir extension = let captured_dir = Filename.concat Config.results_dir Config.captured_dir_name -let sources_dir = - Filename.concat Config.results_dir Config.sources_dir_name - (** get the source directory corresponding to a source file *) let source_dir_from_source_file source_file = Filename.concat captured_dir (source_file_encoding source_file) -(** get the path to the copy of the source file to be stored in the results directory *) -let source_file_in_resdir source_file = - Filename.concat sources_dir (source_file_encoding source_file) - (** Find the source directories in the results dir *) let find_source_dirs () = let source_dirs = ref [] in @@ -285,7 +278,6 @@ module Results_dir = struct create_dir Config.results_dir; create_dir specs_dir; create_dir (path_to_filename Abs_root [Config.attributes_dir_name]); - create_dir (path_to_filename Abs_root [Config.sources_dir_name]); create_dir (path_to_filename Abs_root [Config.captured_dir_name]); if not (source_file_equal source source_file_empty) then create_dir (path_to_filename (Abs_source_dir source) []) diff --git a/infer/src/base/DB.mli b/infer/src/base/DB.mli index 78e806b99..243ab21d4 100644 --- a/infer/src/base/DB.mli +++ b/infer/src/base/DB.mli @@ -126,9 +126,6 @@ type source_dir val source_dir_compare : source_dir -> source_dir -> int -(** get the absolute path to the sources dir *) -val sources_dir : string - (** expose the source dir as a string *) val source_dir_to_string : source_dir -> string @@ -138,9 +135,6 @@ val source_dir_get_internal_file : source_dir -> string -> filename (** get the source directory corresponding to a source file *) val source_dir_from_source_file : source_file -> source_dir -(** get the path to the copy of the source file to be stored in the results directory *) -val source_file_in_resdir : source_file -> filename - (** directory where the results of the capture phase are stored *) val captured_dir : filename diff --git a/infer/src/harness/inhabit.ml b/infer/src/harness/inhabit.ml index 5b2083728..17d80602f 100644 --- a/infer/src/harness/inhabit.ml +++ b/infer/src/harness/inhabit.ml @@ -205,8 +205,7 @@ let inhabit_call tenv (procname, receiver) cfg env = let create_dummy_harness_file harness_name = let dummy_file_name = let dummy_file_dir = - if Sys.file_exists DB.sources_dir then DB.sources_dir - else Filename.get_temp_dir_name () in + Filename.get_temp_dir_name () in let file_str = Procname.java_get_class_name harness_name ^ "_" ^Procname.java_get_method harness_name ^ ".java" in