|
|
@ -26,24 +26,14 @@ type source_file =
|
|
|
|
| Absolute of string
|
|
|
|
| Absolute of string
|
|
|
|
| RelativeProjectRoot of string (* relative to project root *)
|
|
|
|
| RelativeProjectRoot of string (* relative to project root *)
|
|
|
|
| RelativeInferModel of string (* relative to infer models *)
|
|
|
|
| RelativeInferModel of string (* relative to infer models *)
|
|
|
|
|
|
|
|
[@@deriving compare]
|
|
|
|
|
|
|
|
|
|
|
|
let source_file_compare sf1 sf2 =
|
|
|
|
let equal_source_file sf1 sf2 =
|
|
|
|
match sf1, sf2 with
|
|
|
|
compare_source_file sf1 sf2 = 0
|
|
|
|
| Absolute p1, Absolute p2 -> string_compare p1 p2
|
|
|
|
|
|
|
|
| Absolute _, _ -> -1
|
|
|
|
|
|
|
|
| _, Absolute _ -> 1
|
|
|
|
|
|
|
|
| RelativeProjectRoot p1, RelativeProjectRoot p2 -> string_compare p1 p2
|
|
|
|
|
|
|
|
| RelativeProjectRoot _, _ -> -1
|
|
|
|
|
|
|
|
| _, RelativeProjectRoot _ -> 1
|
|
|
|
|
|
|
|
| RelativeInferModel p1, RelativeInferModel p2 -> string_compare p1 p2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let source_file_equal sf1 sf2 =
|
|
|
|
|
|
|
|
(source_file_compare sf1 sf2) = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module OrderedSourceFile =
|
|
|
|
module OrderedSourceFile =
|
|
|
|
struct
|
|
|
|
struct
|
|
|
|
type t = source_file
|
|
|
|
type t = source_file [@@deriving compare]
|
|
|
|
let compare = source_file_compare
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
module SourceFileMap = Map.Make(OrderedSourceFile)
|
|
|
|
module SourceFileMap = Map.Make(OrderedSourceFile)
|
|
|
@ -165,9 +155,7 @@ let source_file_of_header header_file =
|
|
|
|
(** {2 Source Dirs} *)
|
|
|
|
(** {2 Source Dirs} *)
|
|
|
|
|
|
|
|
|
|
|
|
(** source directory: the directory inside the results dir corresponding to a source file *)
|
|
|
|
(** source directory: the directory inside the results dir corresponding to a source file *)
|
|
|
|
type source_dir = string
|
|
|
|
type source_dir = string [@@deriving compare]
|
|
|
|
|
|
|
|
|
|
|
|
let source_dir_compare = string_compare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(** expose the source dir as a string *)
|
|
|
|
(** expose the source dir as a string *)
|
|
|
|
let source_dir_to_string source_dir = source_dir
|
|
|
|
let source_dir_to_string source_dir = source_dir
|
|
|
@ -204,7 +192,7 @@ let find_source_dirs () =
|
|
|
|
|
|
|
|
|
|
|
|
(** {2 Filename} *)
|
|
|
|
(** {2 Filename} *)
|
|
|
|
|
|
|
|
|
|
|
|
type filename = string
|
|
|
|
type filename = string [@@deriving compare]
|
|
|
|
|
|
|
|
|
|
|
|
let filename_concat = Filename.concat
|
|
|
|
let filename_concat = Filename.concat
|
|
|
|
|
|
|
|
|
|
|
@ -212,8 +200,6 @@ let filename_to_string s = s
|
|
|
|
|
|
|
|
|
|
|
|
let filename_from_string s = s
|
|
|
|
let filename_from_string s = s
|
|
|
|
|
|
|
|
|
|
|
|
let filename_compare = Pervasives.compare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let filename_add_suffix fn s = fn ^ s
|
|
|
|
let filename_add_suffix fn s = fn ^ s
|
|
|
|
|
|
|
|
|
|
|
|
let chop_extension = Filename.chop_extension
|
|
|
|
let chop_extension = Filename.chop_extension
|
|
|
@ -224,14 +210,12 @@ let file_remove = Sys.remove
|
|
|
|
|
|
|
|
|
|
|
|
module FilenameSet = Set.Make(
|
|
|
|
module FilenameSet = Set.Make(
|
|
|
|
struct
|
|
|
|
struct
|
|
|
|
type t = filename
|
|
|
|
type t = filename [@@deriving compare]
|
|
|
|
let compare = filename_compare
|
|
|
|
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
module FilenameMap = Map.Make(
|
|
|
|
module FilenameMap = Map.Make(
|
|
|
|
struct
|
|
|
|
struct
|
|
|
|
type t = filename
|
|
|
|
type t = filename [@@deriving compare]
|
|
|
|
let compare = filename_compare
|
|
|
|
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
(** Return the time when a file was last modified. The file must exist. *)
|
|
|
|
(** Return the time when a file was last modified. The file must exist. *)
|
|
|
@ -342,7 +326,7 @@ module Results_dir = struct
|
|
|
|
create_dir specs_dir;
|
|
|
|
create_dir specs_dir;
|
|
|
|
create_dir (path_to_filename Abs_root [Config.attributes_dir_name]);
|
|
|
|
create_dir (path_to_filename Abs_root [Config.attributes_dir_name]);
|
|
|
|
create_dir (path_to_filename Abs_root [Config.captured_dir_name]);
|
|
|
|
create_dir (path_to_filename Abs_root [Config.captured_dir_name]);
|
|
|
|
if not (source_file_equal source source_file_empty) then
|
|
|
|
if not (equal_source_file source source_file_empty) then
|
|
|
|
create_dir (path_to_filename (Abs_source_dir source) [])
|
|
|
|
create_dir (path_to_filename (Abs_source_dir source) [])
|
|
|
|
|
|
|
|
|
|
|
|
let clean_specs_dir () =
|
|
|
|
let clean_specs_dir () =
|
|
|
|