summaryrefslogtreecommitdiffstats
path: root/driver/compile.ml
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2014-08-07 09:46:34 +0000
committerAlain Frisch <alain@frisch.fr>2014-08-07 09:46:34 +0000
commit047e09748c91e1d8f80b51edfc33de76fbfc57da (patch)
tree82123e647183306f57d41efcfee9edecafcb169b /driver/compile.ml
parentcc9cbfc75575499e51473984b88327e19e642a00 (diff)
Cherry-pick 15062,15063,15064 from 4.02 (#6497).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver/compile.ml')
-rw-r--r--driver/compile.ml8
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;