diff options
| author | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2012-05-21 12:22:23 +0000 |
|---|---|---|
| committer | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2012-05-21 12:22:23 +0000 |
| commit | e6949f28de20236f8510961d7d5e72ae87ad0892 (patch) | |
| tree | e5258f474b9023ad5f8946eda02f28d35cfab1c7 /driver/compile.ml | |
| parent | 758901f1269f41dad5731d419184448571b9cf2c (diff) | |
| download | ocaml-4.00-with-binannot.tar.gz | |
bin-annot: improved 'read_cmt' tool. Abstract Env.t .4.00-with-binannot
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/4.00-with-binannot@12470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver/compile.ml')
| -rw-r--r-- | driver/compile.ml | 19 |
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 |
