diff options
Diffstat (limited to 'driver')
-rw-r--r-- | driver/compile.ml | 3 | ||||
-rw-r--r-- | driver/main.ml | 1 | ||||
-rw-r--r-- | driver/main_args.ml | 12 | ||||
-rw-r--r-- | driver/main_args.mli | 4 | ||||
-rw-r--r-- | driver/optcompile.ml | 3 | ||||
-rw-r--r-- | driver/optmain.ml | 1 |
6 files changed, 24 insertions, 0 deletions
diff --git a/driver/compile.ml b/driver/compile.ml index c3873d32f..f1aaaa9e7 100644 --- a/driver/compile.ml +++ b/driver/compile.ml @@ -82,6 +82,7 @@ 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; + if !Clflags.dump_source then fprintf ppf "%a@." Pprintast.signature ast; let tsg = Typemod.transl_signature initial_env ast in let sg = tsg.sig_type in if !Clflags.print_types then @@ -121,6 +122,7 @@ let implementation ppf sourcefile outputprefix = try ignore( Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation + ++ print_if ppf Clflags.dump_source Pprintast.structure ++ Typemod.type_implementation sourcefile outputprefix modulename env); Warnings.check_fatal (); Pparse.remove_preprocessed inputfile; @@ -135,6 +137,7 @@ let implementation ppf sourcefile outputprefix = try Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation + ++ print_if ppf Clflags.dump_source Pprintast.structure ++ Typemod.type_implementation sourcefile outputprefix modulename env ++ Translmod.transl_implementation modulename ++ print_if ppf Clflags.dump_rawlambda Printlambda.lambda diff --git a/driver/main.ml b/driver/main.ml index 8b895af63..b3d5842a0 100644 --- a/driver/main.ml +++ b/driver/main.ml @@ -138,6 +138,7 @@ module Options = Main_args.Make_bytecomp_options (struct let _where = print_standard_library let _verbose = set verbose let _nopervasives = set nopervasives + let _dsource = set dump_source let _dparsetree = set dump_parsetree let _drawlambda = set dump_rawlambda let _dlambda = set dump_lambda diff --git a/driver/main_args.ml b/driver/main_args.ml index c5fd7c8f3..3f3e063ae 100644 --- a/driver/main_args.ml +++ b/driver/main_args.ml @@ -330,6 +330,10 @@ let mk_drawlambda f = "-drawlambda", Arg.Unit f, " (undocumented)" ;; +let mk_dsource f = + "-dsource", Arg.Unit f, " (undocumented)" +;; + let mk_dlambda f = "-dlambda", Arg.Unit f, " (undocumented)" ;; @@ -450,6 +454,7 @@ module type Bytecomp_options = sig val _nopervasives : unit -> unit val _use_prims : string -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -480,6 +485,7 @@ module type Bytetop_options = sig val _warn_error : string -> unit val _warn_help : unit -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -539,6 +545,7 @@ module type Optcomp_options = sig val _where : unit -> unit val _nopervasives : unit -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -585,6 +592,7 @@ module type Opttop_options = sig val _warn_error : string -> unit val _warn_help : unit -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -669,6 +677,7 @@ struct mk_nopervasives F._nopervasives; mk_use_prims F._use_prims; + mk_dsource F._dsource; mk_dparsetree F._dparsetree; mk_drawlambda F._drawlambda; mk_dlambda F._dlambda; @@ -702,6 +711,7 @@ struct mk_warn_error F._warn_error; mk_warn_help F._warn_help; + mk_dsource F._dsource; mk_dparsetree F._dparsetree; mk_drawlambda F._drawlambda; mk_dlambda F._dlambda; @@ -765,6 +775,7 @@ struct mk_where F._where; mk_nopervasives F._nopervasives; + mk_dsource F._dsource; mk_dparsetree F._dparsetree; mk_drawlambda F._drawlambda; mk_dlambda F._dlambda; @@ -813,6 +824,7 @@ module Make_opttop_options (F : Opttop_options) = struct mk_warn_error F._warn_error; mk_warn_help F._warn_help; + mk_dsource F._dsource; mk_dparsetree F._dparsetree; mk_drawlambda F._drawlambda; mk_dclambda F._dclambda; diff --git a/driver/main_args.mli b/driver/main_args.mli index bbdc8ec41..80e659e3f 100644 --- a/driver/main_args.mli +++ b/driver/main_args.mli @@ -62,6 +62,7 @@ module type Bytecomp_options = val _nopervasives : unit -> unit val _use_prims : string -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -93,6 +94,7 @@ module type Bytetop_options = sig val _warn_error : string -> unit val _warn_help : unit -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -152,6 +154,7 @@ module type Optcomp_options = sig val _where : unit -> unit val _nopervasives : unit -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit @@ -198,6 +201,7 @@ module type Opttop_options = sig val _warn_error : string -> unit val _warn_help : unit -> unit + val _dsource : unit -> unit val _dparsetree : unit -> unit val _drawlambda : unit -> unit val _dlambda : unit -> unit diff --git a/driver/optcompile.ml b/driver/optcompile.ml index 9bd1d9b05..1c0a540ae 100644 --- a/driver/optcompile.ml +++ b/driver/optcompile.ml @@ -79,6 +79,7 @@ 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; + if !Clflags.dump_source then fprintf ppf "%a@." Pprintast.signature ast; let tsg = Typemod.transl_signature initial_env ast in let sg = tsg.sig_type in if !Clflags.print_types then @@ -123,10 +124,12 @@ let implementation ppf sourcefile outputprefix = if !Clflags.print_types then ignore( Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation + ++ print_if ppf Clflags.dump_source Pprintast.structure ++ Typemod.type_implementation sourcefile outputprefix modulename env) else begin Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation + ++ print_if ppf Clflags.dump_source Pprintast.structure ++ Typemod.type_implementation sourcefile outputprefix modulename env ++ Translmod.transl_store_implementation modulename +++ print_if ppf Clflags.dump_rawlambda Printlambda.lambda diff --git a/driver/optmain.ml b/driver/optmain.ml index 9afdbb428..84d6fd02f 100644 --- a/driver/optmain.ml +++ b/driver/optmain.ml @@ -149,6 +149,7 @@ module Options = Main_args.Make_optcomp_options (struct let _where () = print_standard_library () let _nopervasives = set nopervasives + let _dsource = set dump_source let _dparsetree = set dump_parsetree let _drawlambda = set dump_rawlambda let _dlambda = set dump_lambda |