Skip to content

Commit 59edafd

Browse files
committed
Change flag name and update documentation
1 parent 7f51c5e commit 59edafd

7 files changed

Lines changed: 48 additions & 11 deletions

File tree

driver/main_args.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ let mk_annot f =
3636
"-annot", Arg.Unit f, " (deprecated) Save information in <filename>.annot"
3737
;;
3838

39-
let mk_binannot f =
40-
"-bin-annot", Arg.Unit f, " Save typedtree in <filename>.cmt"
39+
let mk_annot_shapes f =
40+
"-annot-shapes", Arg.Unit f, " Save shapes in <filename>.cms"
4141
;;
4242

43-
let mk_shapes f =
44-
"-shapes", Arg.Unit f, " Save shapes in <filename>.cms"
43+
let mk_binannot f =
44+
"-bin-annot", Arg.Unit f, " Save typedtree in <filename>.cmt"
4545
;;
4646

4747
let mk_c f =
@@ -965,6 +965,7 @@ end
965965
module type Compiler_options = sig
966966
val _a : unit -> unit
967967
val _annot : unit -> unit
968+
val _annot_shapes : unit -> unit
968969
val _binannot : unit -> unit
969970
val _c : unit -> unit
970971
val _cc : string -> unit
@@ -999,7 +1000,6 @@ module type Compiler_options = sig
9991000
val _with_runtime : unit -> unit
10001001
val _without_runtime : unit -> unit
10011002
val _safe_string : unit -> unit
1002-
val _shapes : unit -> unit
10031003
val _short_paths : unit -> unit
10041004
val _thread : unit -> unit
10051005
val _v : unit -> unit
@@ -1160,8 +1160,8 @@ struct
11601160
mk_alert F._alert;
11611161
mk_absname F._absname;
11621162
mk_annot F._annot;
1163+
mk_annot_shapes F._annot_shapes;
11631164
mk_binannot F._binannot;
1164-
mk_shapes F._shapes;
11651165
mk_c F._c;
11661166
mk_cc F._cc;
11671167
mk_cclib F._cclib;
@@ -1342,8 +1342,8 @@ struct
13421342
mk_afl_instrument F._afl_instrument;
13431343
mk_afl_inst_ratio F._afl_inst_ratio;
13441344
mk_annot F._annot;
1345+
mk_annot_shapes F._annot_shapes;
13451346
mk_binannot F._binannot;
1346-
mk_shapes F._shapes;
13471347
mk_inline_branch_factor F._inline_branch_factor;
13481348
mk_c F._c;
13491349
mk_cc F._cc;
@@ -1852,6 +1852,7 @@ module Default = struct
18521852
module Compiler = struct
18531853
let _a = set make_archive
18541854
let _annot = set annotations
1855+
let _annot_shapes = set shapes
18551856
let _args = Arg.read_arg
18561857
let _args0 = Arg.read_arg0
18571858
let _binannot = set binary_annotations
@@ -1883,7 +1884,6 @@ module Default = struct
18831884
let _plugin _p = plugin := true
18841885
let _pp s = preprocessor := (Some s)
18851886
let _runtime_variant s = runtime_variant := s
1886-
let _shapes = set shapes
18871887
let _stop_after pass =
18881888
let module P = Compiler_pass in
18891889
match P.of_string pass with

driver/main_args.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ end
7474
module type Compiler_options = sig
7575
val _a : unit -> unit
7676
val _annot : unit -> unit
77+
val _annot_shapes : unit -> unit
7778
val _binannot : unit -> unit
7879
val _c : unit -> unit
7980
val _cc : string -> unit
@@ -108,7 +109,6 @@ module type Compiler_options = sig
108109
val _with_runtime : unit -> unit
109110
val _without_runtime : unit -> unit
110111
val _safe_string : unit -> unit
111-
val _shapes : unit -> unit
112112
val _short_paths : unit -> unit
113113
val _thread : unit -> unit
114114
val _v : unit -> unit

man/ocamlc.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,20 @@ Build a library (.cma file) with the object files (.cmo files) given
208208
.BR \-bin-annot
209209
instead.
210210
.TP
211+
.B \-annot\-shapes
212+
Dump information about the definitions of the current compilation unit in binary
213+
format. This information is represented as shapes, an abstraction of modules.
214+
The information for file
215+
.IR src .ml
216+
is put into file
217+
.IR src .cms.
218+
The files
219+
produced by
220+
.B \-annot\-shapes
221+
are more lightweight than the ones produced by
222+
.B \-bin\-annot
223+
but contain enough information for most external tooling needs.
224+
.TP
211225
.B \-bin\-annot
212226
Dump detailed information about the compilation (types, bindings,
213227
tail-calls, etc) in binary format. The information for file

man/ocamlopt.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,20 @@ Build a library (.cmxa/.a file) with the object files (.cmx/.o
171171
.BR \-bin-annot
172172
instead.
173173
.TP
174+
.B \-annot\-shapes
175+
Dump information about the definitions of the current compilation unit in binary
176+
format. This information is represented as shapes, an abstraction of modules.
177+
The information for file
178+
.IR src .ml
179+
is put into file
180+
.IR src .cms.
181+
The files
182+
produced by
183+
.B \-annot\-shapes
184+
are more lightweight than the ones produced by
185+
.B \-bin\-annot
186+
but contain enough information for most external tooling needs.
187+
.TP
174188
.B \-bin\-annot
175189
Dump detailed information about the compilation (types, bindings,
176190
tail-calls, etc) in binary format. The information for file

manual/src/cmds/unified-options.etex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ Force error messages to show absolute paths for file names.
6464
Deprecated since OCaml 4.11. Please use "-bin-annot" instead.
6565
}%notop
6666

67+
\notop{\item["-annot-shapes"]
68+
Dump information about the definitions of the current compilation unit in binary
69+
format. This information is represented as shapes, an abstraction of modules.
70+
The information for file \var{src}".ml" (resp. \var{src}".mli") is put into file
71+
\var{src}".cms" (resp. \var{src}".cmsi"). The "*.cms" and "*.cmsi" files
72+
produced by "-annot-shape" are more lightweight than the cmt produced by
73+
"-bin-annot" but contain enough information for most external tooling needs.
74+
}%notop
75+
6776
\item["-args" \var{filename}]
6877
Read additional newline-terminated command line arguments from \var{filename}.
6978
\top{It is not possible to pass a \var{scriptfile} via file to the toplevel.

stdlib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TARGET_BINDIR ?= $(BINDIR)
2222
COMPILER=$(ROOTDIR)/ocamlc$(EXE)
2323
CAMLC=$(OCAMLRUN) $(COMPILER)
2424
COMPFLAGS=-strict-sequence -absname -w +a-4-9-41-42-44-45-48-70 \
25-
-g -warn-error +A -bin-annot -shapes -nostdlib -principal \
25+
-g -warn-error +A -bin-annot -annot-shapes -nostdlib -principal \
2626
-safe-string -strict-formats
2727
ifeq "$(FLAMBDA)" "true"
2828
OPTCOMPFLAGS += -O3

utils/clflags.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ and all_ppx = ref ([] : string list) (* -ppx *)
6868
let absname = ref false (* -absname *)
6969
let annotations = ref false (* -annot *)
7070
let binary_annotations = ref false (* -bin-annot *)
71-
let shapes = ref false (* -shapes *)
71+
let shapes = ref false (* -annot-shapes *)
7272
and use_threads = ref false (* -thread *)
7373
and noassert = ref false (* -noassert *)
7474
and verbose = ref false (* -verbose *)

0 commit comments

Comments
 (0)