diff options
Diffstat (limited to 'driver/optcompile.ml')
| -rw-r--r-- | driver/optcompile.ml | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/driver/optcompile.ml b/driver/optcompile.ml index 6086afa3d1..0646c20433 100644 --- a/driver/optcompile.ml +++ b/driver/optcompile.ml @@ -16,7 +16,7 @@ open Misc open Config -open Formatmsg +open Format open Typedtree (* Initialize the search path. @@ -99,14 +99,14 @@ let parse_file inputfile parse_fun ast_magic = (* Compile a .mli file *) -let interface sourcefile = +let interface ppf sourcefile = let prefixname = Filename.chop_extension sourcefile in let modulename = String.capitalize(Filename.basename prefixname) in let inputfile = preprocess sourcefile (prefixname ^ ".ppi") in let ast = parse_file inputfile Parse.interface ast_intf_magic_number in - if !Clflags.dump_parsetree then (Printast.interface ast; print_newline ()); + if !Clflags.dump_parsetree then fprintf ppf "%a@." Printast.interface ast; let sg = Typemod.transl_signature (initial_env()) ast in - if !Clflags.print_types then (Printtyp.signature sg; print_newline()); + if !Clflags.print_types then fprintf ppf "%a@." Printtyp.signature sg; Env.save_signature sg modulename (prefixname ^ ".cmi"); remove_preprocessed inputfile @@ -119,19 +119,19 @@ let print_if flag printer arg = let (++) x f = f x let (+++) (x, y) f = (x, f y) -let implementation sourcefile = +let implementation ppf sourcefile = let prefixname = Filename.chop_extension sourcefile in let modulename = String.capitalize(Filename.basename prefixname) in let inputfile = preprocess sourcefile (prefixname ^ ".ppo") in let env = initial_env() in Compilenv.reset modulename; parse_file inputfile Parse.implementation ast_impl_magic_number - ++ print_if Clflags.dump_parsetree Printast.implementation + ++ print_if Clflags.dump_parsetree (Printast.implementation ppf) ++ Typemod.type_implementation sourcefile prefixname modulename env ++ Translmod.transl_store_implementation modulename - +++ print_if Clflags.dump_rawlambda Printlambda.lambda + +++ print_if Clflags.dump_rawlambda (Printlambda.lambda ppf) +++ Simplif.simplify_lambda - +++ print_if Clflags.dump_lambda Printlambda.lambda + +++ print_if Clflags.dump_lambda (Printlambda.lambda ppf) ++ Asmgen.compile_implementation prefixname; Compilenv.save_unit_info (prefixname ^ ".cmx"); remove_preprocessed inputfile |
