make it clearer

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4689 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jacques Garrigue 2002-04-18 03:44:44 +00:00
parent 78594fe79f
commit 98ca2c1b3e
1 changed files with 6 additions and 7 deletions

View File

@ -720,11 +720,7 @@ let imported_units() =
let save_signature sg modname filename =
Btype.cleanup_abbrev ();
Subst.reset_for_saving ();
let s = Subst.for_saving Subst.identity in
let sg = Subst.signature s sg in
let comps =
components_of_module empty s
(Pident(Ident.create_persistent modname)) (Tmty_signature sg) in
let sg = Subst.signature (Subst.for_saving Subst.identity) sg in
let oc = open_out_bin filename in
try
output_string oc cmi_magic_number;
@ -733,16 +729,19 @@ let save_signature sg modname filename =
let crc = Digest.file filename in
let crcs = (modname, crc) :: imported_units() in
output_value oc crcs;
close_out oc;
(* Enter signature in persistent table so that imported_unit()
will also return its crc *)
let comps =
components_of_module empty Subst.identity
(Pident(Ident.create_persistent modname)) (Tmty_signature sg) in
let ps =
{ ps_name = modname;
ps_sig = sg;
ps_comps = comps;
ps_crcs = crcs;
ps_filename = filename } in
Hashtbl.add persistent_structures modname ps;
close_out oc
Hashtbl.add persistent_structures modname ps
with exn ->
close_out oc;
remove_file filename;