File tree Expand file tree Collapse file tree 4 files changed +39
-13
lines changed Expand file tree Collapse file tree 4 files changed +39
-13
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,22 @@ let print_if ppf flag printer arg =
27
27
arg
28
28
29
29
30
+ let process_with_gentype filename =
31
+ match ! Clflags. bs_gentype with
32
+ | None -> ()
33
+ | Some cmd ->
34
+ let comm = (cmd ^
35
+ " -cmt-add " ^
36
+ filename ^
37
+ ( " :" ^ ! Location. input_name)) in
38
+ if ! Clflags. verbose then begin
39
+ prerr_string " + " ;
40
+ prerr_endline comm;
41
+ prerr_newline ()
42
+ end ;
43
+ ignore
44
+ (Sys. command comm
45
+ )
30
46
31
47
let after_parsing_sig ppf outputprefix ast =
32
48
if ! Js_config. binary_ast then
@@ -76,6 +92,7 @@ let after_parsing_sig ppf outputprefix ast =
76
92
#end
77
93
Typemod. save_signature modulename tsg outputprefix ! Location. input_name
78
94
initial_env sg ;
95
+ process_with_gentype (outputprefix ^ " .cmti" );
79
96
end
80
97
end
81
98
@@ -142,7 +159,7 @@ let after_parsing_impl ppf outputprefix ast =
142
159
outputprefix
143
160
);
144
161
end ;
145
- Stypes. dump ( Some ( outputprefix ^ " .annot " ));
162
+ process_with_gentype ( outputprefix ^ " .cmt " )
146
163
end
147
164
let implementation ppf fname outputprefix =
148
165
Compmisc. init_path false ;
Original file line number Diff line number Diff line change @@ -50054,11 +50054,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env sg =
50054
50054
cmt_use_summaries = need_to_clear_env;
50055
50055
} in
50056
50056
output_cmt oc cmt;
50057
- close_out oc;
50058
- (* TODO: does not make sense to do post-proccesing for [Partial_implementaiton]*)
50059
- match !Clflags.bs_gentype with
50060
- | None -> ()
50061
- | Some cmd -> ignore (Sys.command (cmd ^ " -cmt-add " ^ filename ^ (match sourcefile with None -> "" | Some sourcefile -> ":" ^ sourcefile)))
50057
+ close_out oc
50062
50058
end;
50063
50059
clear ()
50064
50060
Original file line number Diff line number Diff line change @@ -38275,11 +38275,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env sg =
38275
38275
cmt_use_summaries = need_to_clear_env;
38276
38276
} in
38277
38277
output_cmt oc cmt;
38278
- close_out oc;
38279
- (* TODO: does not make sense to do post-proccesing for [Partial_implementaiton]*)
38280
- match !Clflags.bs_gentype with
38281
- | None -> ()
38282
- | Some cmd -> ignore (Sys.command (cmd ^ " -cmt-add " ^ filename ^ (match sourcefile with None -> "" | Some sourcefile -> ":" ^ sourcefile)))
38278
+ close_out oc
38283
38279
end;
38284
38280
clear ()
38285
38281
@@ -123404,6 +123400,22 @@ let print_if ppf flag printer arg =
123404
123400
arg
123405
123401
123406
123402
123403
+ let process_with_gentype filename =
123404
+ match !Clflags.bs_gentype with
123405
+ | None -> ()
123406
+ | Some cmd ->
123407
+ let comm = (cmd ^
123408
+ " -cmt-add " ^
123409
+ filename ^
123410
+ ( ":" ^ !Location.input_name)) in
123411
+ if !Clflags.verbose then begin
123412
+ prerr_string "+ ";
123413
+ prerr_endline comm;
123414
+ prerr_newline ()
123415
+ end ;
123416
+ ignore
123417
+ (Sys.command comm
123418
+ )
123407
123419
123408
123420
let after_parsing_sig ppf outputprefix ast =
123409
123421
if !Js_config.binary_ast then
@@ -123446,6 +123458,7 @@ let after_parsing_sig ppf outputprefix ast =
123446
123458
123447
123459
Typemod.save_signature modulename tsg outputprefix !Location.input_name
123448
123460
initial_env sg ;
123461
+ process_with_gentype (outputprefix ^ ".cmti");
123449
123462
end
123450
123463
end
123451
123464
@@ -123510,7 +123523,7 @@ let after_parsing_impl ppf outputprefix ast =
123510
123523
outputprefix
123511
123524
);
123512
123525
end;
123513
- Stypes.dump (Some ( outputprefix ^ ".annot"));
123526
+ process_with_gentype ( outputprefix ^ ".cmt")
123514
123527
end
123515
123528
let implementation ppf fname outputprefix =
123516
123529
Compmisc.init_path false;
You can’t perform that action at this time.
0 commit comments