Skip to content

Commit f518995

Browse files
committed
Calling genType from buckle instead from the patched compiler
1 parent 7b9a647 commit f518995

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

jscomp/core/js_implementation.ml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ let print_if ppf flag printer arg =
2727
arg
2828

2929

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+
)
3046

3147
let after_parsing_sig ppf outputprefix ast =
3248
if !Js_config.binary_ast then
@@ -76,6 +92,7 @@ let after_parsing_sig ppf outputprefix ast =
7692
#end
7793
Typemod.save_signature modulename tsg outputprefix !Location.input_name
7894
initial_env sg ;
95+
process_with_gentype (outputprefix ^ ".cmti");
7996
end
8097
end
8198

@@ -142,7 +159,7 @@ let after_parsing_impl ppf outputprefix ast =
142159
outputprefix
143160
);
144161
end;
145-
Stypes.dump (Some (outputprefix ^ ".annot"));
162+
process_with_gentype (outputprefix ^ ".cmt")
146163
end
147164
let implementation ppf fname outputprefix =
148165
Compmisc.init_path false;

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50054,11 +50054,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env sg =
5005450054
cmt_use_summaries = need_to_clear_env;
5005550055
} in
5005650056
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
5006250058
end;
5006350059
clear ()
5006450060

lib/4.02.3/whole_compiler.ml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38275,11 +38275,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env sg =
3827538275
cmt_use_summaries = need_to_clear_env;
3827638276
} in
3827738277
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
3828338279
end;
3828438280
clear ()
3828538281

@@ -123404,6 +123400,22 @@ let print_if ppf flag printer arg =
123404123400
arg
123405123401

123406123402

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+
)
123407123419

123408123420
let after_parsing_sig ppf outputprefix ast =
123409123421
if !Js_config.binary_ast then
@@ -123446,6 +123458,7 @@ let after_parsing_sig ppf outputprefix ast =
123446123458

123447123459
Typemod.save_signature modulename tsg outputprefix !Location.input_name
123448123460
initial_env sg ;
123461+
process_with_gentype (outputprefix ^ ".cmti");
123449123462
end
123450123463
end
123451123464

@@ -123510,7 +123523,7 @@ let after_parsing_impl ppf outputprefix ast =
123510123523
outputprefix
123511123524
);
123512123525
end;
123513-
Stypes.dump (Some (outputprefix ^ ".annot"));
123526+
process_with_gentype (outputprefix ^ ".cmt")
123514123527
end
123515123528
let implementation ppf fname outputprefix =
123516123529
Compmisc.init_path false;

ocaml

Submodule ocaml updated from 025b846 to c45c78d

0 commit comments

Comments
 (0)