summaryrefslogtreecommitdiff
path: root/driver/compile.ml
diff options
context:
space:
mode:
Diffstat (limited to 'driver/compile.ml')
-rw-r--r--driver/compile.ml19
1 files changed, 9 insertions, 10 deletions
diff --git a/driver/compile.ml b/driver/compile.ml
index b2cbb1cbd5..5b79877478 100644
--- a/driver/compile.ml
+++ b/driver/compile.ml
@@ -84,16 +84,15 @@ let interface ppf sourcefile outputprefix =
let ast =
Pparse.file ppf inputfile Parse.interface ast_intf_magic_number in
if !Clflags.dump_parsetree then fprintf ppf "%a@." Printast.interface ast;
- let sg = Typemod.transl_signature initial_env ast in
+ let tsg = Typemod.transl_signature initial_env ast in
if !Clflags.print_types then
fprintf std_formatter "%a@." Printtyp.signature
- (Typemod.simplify_signature sg.sig_type);
+ (Typemod.simplify_signature tsg.sig_type);
Warnings.check_fatal ();
if not !Clflags.print_types then begin
- Env.save_signature sg.sig_type modulename
- (outputprefix ^ ".cmi");
- Typemod.save_signature modulename sg outputprefix sourcefile
- initial_env (sg.sig_type, Env.imported_units()) ;
+ let sg = Env.save_signature tsg.sig_type modulename (outputprefix ^ ".cmi") in
+ Typemod.save_signature modulename tsg outputprefix sourcefile
+ initial_env sg ;
end;
Pparse.remove_preprocessed inputfile
with e ->
@@ -124,10 +123,10 @@ let implementation ppf sourcefile outputprefix =
++ Typemod.type_implementation sourcefile outputprefix modulename env);
Warnings.check_fatal ();
Pparse.remove_preprocessed inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
with x ->
Pparse.remove_preprocessed_if_ast inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
raise x
end else begin
let objfile = outputprefix ^ ".cmo" in
@@ -146,12 +145,12 @@ let implementation ppf sourcefile outputprefix =
Warnings.check_fatal ();
close_out oc;
Pparse.remove_preprocessed inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
with x ->
close_out oc;
remove_file objfile;
Pparse.remove_preprocessed_if_ast inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
raise x
end