summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2007-05-16 08:21:41 +0000
committerDamien Doligez <damien.doligez-inria.fr>2007-05-16 08:21:41 +0000
commit1dd68ccf50afba140553a7cac8586dce93ffbbf2 (patch)
tree3162e4240757c2d7a563438c64632333ee30d7fb /driver
parent5dbc715029728bd9e9944f31fe6ac22ceb0a994d (diff)
downloadocaml-1dd68ccf50afba140553a7cac8586dce93ffbbf2.tar.gz
ajout des annotations pour variables et appels terminaux
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8232 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver')
-rw-r--r--driver/compile.ml4
-rw-r--r--driver/main.ml2
-rw-r--r--driver/main_args.ml5
-rw-r--r--driver/main_args.mli2
-rw-r--r--driver/optmain.ml9
5 files changed, 14 insertions, 8 deletions
diff --git a/driver/compile.ml b/driver/compile.ml
index 5adaae7875..a847dcab4a 100644
--- a/driver/compile.ml
+++ b/driver/compile.ml
@@ -111,12 +111,14 @@ let implementation ppf sourcefile outputprefix =
++ print_if ppf Clflags.dump_instr Printinstr.instrlist
++ Emitcode.to_file oc modulename;
Warnings.check_fatal ();
- Pparse.remove_preprocessed inputfile;
close_out oc;
+ Pparse.remove_preprocessed inputfile;
+ Stypes.dump (outputprefix ^ ".annot");
with x ->
close_out oc;
remove_file objfile;
Pparse.remove_preprocessed_if_ast inputfile;
+ Stypes.dump (outputprefix ^ ".annot");
raise x
end
diff --git a/driver/main.ml b/driver/main.ml
index 5782869d1d..1420c98d23 100644
--- a/driver/main.ml
+++ b/driver/main.ml
@@ -89,6 +89,7 @@ module Options = Main_args.Make_options (struct
let set r () = r := true
let unset r () = r := false
let _a = set make_archive
+ let _annot = set annotations
let _c = set compile_only
let _cc s = c_compiler := s; c_linker := s
let _cclib s = ccobjs := Misc.rev_split_words s @ !ccobjs
@@ -97,7 +98,6 @@ module Options = Main_args.Make_options (struct
let _custom = set custom_runtime
let _dllib s = dllibs := Misc.rev_split_words s @ !dllibs
let _dllpath s = dllpaths := !dllpaths @ [s]
- let _dtypes = set save_types
let _g = set debug
let _i () = print_types := true; compile_only := true
let _I s = include_dirs := s :: !include_dirs
diff --git a/driver/main_args.ml b/driver/main_args.ml
index f5fcea23e5..bb72b79450 100644
--- a/driver/main_args.ml
+++ b/driver/main_args.ml
@@ -15,6 +15,7 @@
module Make_options (F :
sig
val _a : unit -> unit
+ val _annot : unit -> unit
val _c : unit -> unit
val _cc : string -> unit
val _cclib : string -> unit
@@ -23,7 +24,6 @@ module Make_options (F :
val _custom : unit -> unit
val _dllib : string -> unit
val _dllpath : string -> unit
- val _dtypes : unit -> unit
val _g : unit -> unit
val _i : unit -> unit
val _I : string -> unit
@@ -65,6 +65,7 @@ module Make_options (F :
struct
let list = [
"-a", Arg.Unit F._a, " Build a library";
+ "-annot", Arg.Unit F._annot, " Save information in <filename>.annot";
"-c", Arg.Unit F._c, " Compile only (do not link)";
"-cc", Arg.String F._cc,
"<command> Use <command> as the C compiler and linker";
@@ -78,7 +79,7 @@ struct
"<lib> Use the dynamically-loaded library <lib>";
"-dllpath", Arg.String F._dllpath,
"<dir> Add <dir> to the run-time search path for shared libraries";
- "-dtypes", Arg.Unit F._dtypes, " Save type information in <filename>.annot";
+ "-dtypes", Arg.Unit F._annot, " (deprecated) same as -annot";
"-for-pack", Arg.String (fun s -> ()),
"<ident> Ignored (for compatibility with ocamlopt)";
"-g", Arg.Unit F._g, " Save debugging information";
diff --git a/driver/main_args.mli b/driver/main_args.mli
index b8afff0f74..1e4cb4944e 100644
--- a/driver/main_args.mli
+++ b/driver/main_args.mli
@@ -15,6 +15,7 @@
module Make_options (F :
sig
val _a : unit -> unit
+ val _annot : unit -> unit
val _c : unit -> unit
val _cc : string -> unit
val _cclib : string -> unit
@@ -23,7 +24,6 @@ module Make_options (F :
val _custom : unit -> unit
val _dllib : string -> unit
val _dllpath : string -> unit
- val _dtypes : unit -> unit
val _g : unit -> unit
val _i : unit -> unit
val _I : string -> unit
diff --git a/driver/optmain.ml b/driver/optmain.ml
index 06b4aadfe2..ac28b7618e 100644
--- a/driver/optmain.ml
+++ b/driver/optmain.ml
@@ -97,6 +97,8 @@ let main () =
try
Arg.parse (Arch.command_line_options @ [
"-a", Arg.Set make_archive, " Build a library";
+ "-annot", Arg.Set annotations,
+ " Save information in <filename>.annot";
"-c", Arg.Set compile_only, " Compile only (do not link)";
"-cc", Arg.String(fun s -> c_compiler := s; c_linker := s),
"<comp> Use <comp> as the C compiler and linker";
@@ -109,12 +111,13 @@ let main () =
" Optimize code size rather than speed";
"-config", Arg.Unit show_config,
" print configuration values and exit";
- "-dtypes", Arg.Set save_types,
- " Save type information in <filename>.annot";
+ "-dtypes", Arg.Set annotations,
+ " (deprecated) same as -annot";
"-for-pack", Arg.String (fun s -> for_package := Some s),
"<ident> Generate code that can later be `packed' with\n\
\ ocamlopt -pack -o <ident>.cmx";
- "-g", Arg.Set debug, " Record debugging information for exception backtrace";
+ "-g", Arg.Set debug,
+ " Record debugging information for exception backtrace";
"-i", Arg.Unit (fun () -> print_types := true; compile_only := true),
" Print inferred interface";
"-I", Arg.String(fun dir -> include_dirs := dir :: !include_dirs),