Skip to content

Commit 87f8070

Browse files
committed
[src][verbose] print error on missing cmi_infos and cmt_struct
1 parent 7a15e62 commit 87f8070

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/deadCode.ml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,17 @@ let rec load_file state fn =
444444
(* TODO: stateful computations should take and return the state when possible *)
445445
state
446446
in
447+
let add_bad_file err fn =
448+
if !DeadFlag.verbose then
449+
Printf.eprintf "%s\n%!" err;
450+
bad_files := fn :: !bad_files
451+
in
447452
let process_interface fn =
448453
last_loc := Lexing.dummy_pos;
449454
if !DeadFlag.verbose then Printf.eprintf "Scanning interface from %s\n%!" fn;
450455
init_and_continue state fn (fun state ->
451456
match state.file_infos.cmi_sign with
452-
| None -> bad_files := fn :: !bad_files
457+
| None -> add_bad_file "Missing cmi_sign" fn
453458
| Some cmi_sign ->
454459
read_interface fn cmi_sign state
455460
)
@@ -459,7 +464,7 @@ let rec load_file state fn =
459464
if !DeadFlag.verbose then Printf.eprintf "Scanning implementation from %s\n%!" fn;
460465
init_and_continue state fn (fun state ->
461466
match state.file_infos.cmt_struct with
462-
| None -> bad_files := fn :: !bad_files
467+
| None -> add_bad_file "Missing cmt_struct" fn
463468
| Some structure ->
464469
regabs state;
465470
let prepare (loc1, loc2) =

0 commit comments

Comments
 (0)