summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/compile.ml19
-rw-r--r--driver/optcompile.ml17
2 files changed, 17 insertions, 19 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
diff --git a/driver/optcompile.ml b/driver/optcompile.ml
index ff5b0e5917..3154ad1481 100644
--- a/driver/optcompile.ml
+++ b/driver/optcompile.ml
@@ -81,21 +81,20 @@ 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;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"))
with e ->
Pparse.remove_preprocessed_if_ast inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
raise e
(* Compile a .ml file *)
@@ -137,12 +136,12 @@ let implementation ppf sourcefile outputprefix =
end;
Warnings.check_fatal ();
Pparse.remove_preprocessed inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
with x ->
remove_file objfile;
remove_file cmxfile;
Pparse.remove_preprocessed_if_ast inputfile;
- Stypes.dump (outputprefix ^ ".annot");
+ Stypes.dump (Some (outputprefix ^ ".annot"));
raise x
let c_file name =