summaryrefslogtreecommitdiff
path: root/driver/optcompile.ml
diff options
context:
space:
mode:
authorValentin Gatien-Baron <vgatien-baron@janestreet.com>2017-01-31 17:22:58 -0500
committerValentin Gatien-Baron <vgatien-baron@janestreet.com>2017-02-01 16:24:20 -0500
commit81dafd7ee2236411c6d01444c4f3fd0991af3a8f (patch)
tree5fc9848808ccfb3d2a7d06454809e8edc5e2da2b /driver/optcompile.ml
parentc03ac481943517c9a8d47e81a3568e549d93ed16 (diff)
downloadocaml-81dafd7ee2236411c6d01444c4f3fd0991af3a8f.tar.gz
making -dtimings include time spent typing mli's
Diffstat (limited to 'driver/optcompile.ml')
-rw-r--r--driver/optcompile.ml38
1 files changed, 20 insertions, 18 deletions
diff --git a/driver/optcompile.ml b/driver/optcompile.ml
index 991b9f5216..876b1cc903 100644
--- a/driver/optcompile.ml
+++ b/driver/optcompile.ml
@@ -35,24 +35,26 @@ let interface ppf sourcefile outputprefix =
let ast = Pparse.parse_interface ~tool_name ppf sourcefile in
if !Clflags.dump_parsetree then fprintf ppf "%a@." Printast.interface ast;
if !Clflags.dump_source then fprintf ppf "%a@." Pprintast.signature ast;
- let tsg = Typemod.type_interface sourcefile initial_env ast in
- if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
- let sg = tsg.sig_type in
- if !Clflags.print_types then
- Printtyp.wrap_printing_env initial_env (fun () ->
- fprintf std_formatter "%a@."
- Printtyp.signature (Typemod.simplify_signature sg));
- ignore (Includemod.signatures initial_env sg sg);
- Typecore.force_delayed_checks ();
- Warnings.check_fatal ();
- if not !Clflags.print_types then begin
- let deprecated = Builtin_attributes.deprecated_of_sig ast in
- let sg =
- Env.save_signature ~deprecated sg modulename (outputprefix ^ ".cmi")
- in
- Typemod.save_signature modulename tsg outputprefix sourcefile
- initial_env sg ;
- end
+ Timings.(time_call (Typing sourcefile)) (fun () ->
+ let tsg = Typemod.type_interface sourcefile initial_env ast in
+ if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
+ let sg = tsg.sig_type in
+ if !Clflags.print_types then
+ Printtyp.wrap_printing_env initial_env (fun () ->
+ fprintf std_formatter "%a@."
+ Printtyp.signature (Typemod.simplify_signature sg));
+ ignore (Includemod.signatures initial_env sg sg);
+ Typecore.force_delayed_checks ();
+ Warnings.check_fatal ();
+ if not !Clflags.print_types then begin
+ let deprecated = Builtin_attributes.deprecated_of_sig ast in
+ let sg =
+ Env.save_signature ~deprecated sg modulename (outputprefix ^ ".cmi")
+ in
+ Typemod.save_signature modulename tsg outputprefix sourcefile
+ initial_env sg ;
+ end
+ )
(* Compile a .ml file *)