diff options
Diffstat (limited to 'driver/compile.ml')
-rw-r--r-- | driver/compile.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/driver/compile.ml b/driver/compile.ml index 6ffa9ed9a..fb003c7ea 100644 --- a/driver/compile.ml +++ b/driver/compile.ml @@ -21,12 +21,14 @@ open Compenv (* Keep in sync with the copy in optcompile.ml *) +let tool_name = "ocamlc" + let interface ppf sourcefile outputprefix = Compmisc.init_path false; let modulename = module_of_filename ppf sourcefile outputprefix in Env.set_unit_name modulename; let initial_env = Compmisc.initial_env () in - let ast = Pparse.parse_interface ppf sourcefile in + 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 initial_env ast in @@ -70,7 +72,7 @@ let implementation ppf sourcefile outputprefix = Warnings.check_fatal (); Stypes.dump (Some (outputprefix ^ ".annot")) in - try comp (Pparse.parse_implementation ppf sourcefile) + try comp (Pparse.parse_implementation ~tool_name ppf sourcefile) with x -> Stypes.dump (Some (outputprefix ^ ".annot")); raise x @@ -95,7 +97,7 @@ let implementation ppf sourcefile outputprefix = close_out oc; Stypes.dump (Some (outputprefix ^ ".annot")) in - try comp (Pparse.parse_implementation ppf sourcefile) + try comp (Pparse.parse_implementation ~tool_name ppf sourcefile) with x -> close_out oc; remove_file objfile; |