283 lines | 9014 chars
1 | (**************************************************************************) |
2 | (* *) |
3 | (* OCaml *) |
4 | (* *) |
5 | (* Damien Doligez, projet Para, INRIA Rocquencourt *) |
6 | (* *) |
7 | (* Copyright 1998 Institut National de Recherche en Informatique et *) |
8 | (* en Automatique. *) |
9 | (* *) |
10 | (* All rights reserved. This file is distributed under the terms of *) |
11 | (* the GNU Lesser General Public License version 2.1, with the *) |
12 | (* special exception on linking described in the file LICENSE. *) |
13 | (* *) |
14 | (**************************************************************************) |
15 | |
16 | (* ATTENTION ! When you add or modify a parsing or typing option, do not forget |
17 | to update ocamldoc options too, in odoc_args.ml. *) |
18 | |
19 | module type Common_options = sig |
20 | val _absname : unit -> unit |
21 | val _alert : string -> unit |
22 | val _I : string -> unit |
23 | val _labels : unit -> unit |
24 | val _alias_deps : unit -> unit |
25 | val _no_alias_deps : unit -> unit |
26 | val _app_funct : unit -> unit |
27 | val _no_app_funct : unit -> unit |
28 | val _noassert : unit -> unit |
29 | val _nolabels : unit -> unit |
30 | val _nostdlib : unit -> unit |
31 | val _open : string -> unit |
32 | val _ppx : string -> unit |
33 | val _principal : unit -> unit |
34 | val _no_principal : unit -> unit |
35 | val _rectypes : unit -> unit |
36 | val _no_rectypes : unit -> unit |
37 | val _safe_string : unit -> unit |
38 | val _short_paths : unit -> unit |
39 | val _strict_sequence : unit -> unit |
40 | val _no_strict_sequence : unit -> unit |
41 | val _strict_formats : unit -> unit |
42 | val _no_strict_formats : unit -> unit |
43 | val _unboxed_types : unit -> unit |
44 | val _no_unboxed_types : unit -> unit |
45 | val _unsafe_string : unit -> unit |
46 | val _version : unit -> unit |
47 | val _vnum : unit -> unit |
48 | val _w : string -> unit |
49 | |
50 | val anonymous : string -> unit |
51 | end |
52 | |
53 | module type Core_options = sig |
54 | include Common_options |
55 | |
56 | val _nopervasives : unit -> unit |
57 | val _unsafe : unit -> unit |
58 | val _warn_error : string -> unit |
59 | val _warn_help : unit -> unit |
60 | |
61 | val _dno_unique_ids : unit -> unit |
62 | val _dunique_ids : unit -> unit |
63 | val _dsource : unit -> unit |
64 | val _dparsetree : unit -> unit |
65 | val _dtypedtree : unit -> unit |
66 | val _drawlambda : unit -> unit |
67 | val _dlambda : unit -> unit |
68 | |
69 | end |
70 | |
71 | module type Compiler_options = sig |
72 | val _a : unit -> unit |
73 | val _annot : unit -> unit |
74 | val _binannot : unit -> unit |
75 | val _c : unit -> unit |
76 | val _cc : string -> unit |
77 | val _cclib : string -> unit |
78 | val _ccopt : string -> unit |
79 | val _config : unit -> unit |
80 | val _config_var : string -> unit |
81 | val _for_pack : string -> unit |
82 | val _g : unit -> unit |
83 | val _stop_after : string -> unit |
84 | val _i : unit -> unit |
85 | val _impl : string -> unit |
86 | val _intf : string -> unit |
87 | val _intf_suffix : string -> unit |
88 | val _keep_docs : unit -> unit |
89 | val _no_keep_docs : unit -> unit |
90 | val _keep_locs : unit -> unit |
91 | val _no_keep_locs : unit -> unit |
92 | val _linkall : unit -> unit |
93 | val _noautolink : unit -> unit |
94 | val _o : string -> unit |
95 | val _opaque : unit -> unit |
96 | val _output_obj : unit -> unit |
97 | val _output_complete_obj : unit -> unit |
98 | val _pack : unit -> unit |
99 | val _plugin : string -> unit |
100 | val _pp : string -> unit |
101 | val _principal : unit -> unit |
102 | val _no_principal : unit -> unit |
103 | val _rectypes : unit -> unit |
104 | val _runtime_variant : string -> unit |
105 | val _with_runtime : unit -> unit |
106 | val _without_runtime : unit -> unit |
107 | val _safe_string : unit -> unit |
108 | val _short_paths : unit -> unit |
109 | val _thread : unit -> unit |
110 | val _v : unit -> unit |
111 | val _verbose : unit -> unit |
112 | val _where : unit -> unit |
113 | val _color : string -> unit |
114 | val _error_style : string -> unit |
115 | |
116 | val _match_context_rows : int -> unit |
117 | val _dtimings : unit -> unit |
118 | val _dprofile : unit -> unit |
119 | val _dump_into_file : unit -> unit |
120 | |
121 | val _args: string -> string array |
122 | val _args0: string -> string array |
123 | end |
124 | ;; |
125 | |
126 | module type Toplevel_options = sig |
127 | include Core_options |
128 | val _init : string -> unit |
129 | val _noinit : unit -> unit |
130 | val _no_version : unit -> unit |
131 | val _noprompt : unit -> unit |
132 | val _nopromptcont : unit -> unit |
133 | val _stdin : unit -> unit |
134 | val _args : string -> string array |
135 | val _args0 : string -> string array |
136 | val _color : string -> unit |
137 | val _error_style : string -> unit |
138 | end |
139 | ;; |
140 | |
141 | module type Bytecomp_options = sig |
142 | include Core_options |
143 | include Compiler_options |
144 | val _compat_32 : unit -> unit |
145 | val _custom : unit -> unit |
146 | val _no_check_prims : unit -> unit |
147 | val _dllib : string -> unit |
148 | val _dllpath : string -> unit |
149 | val _make_runtime : unit -> unit |
150 | val _vmthread : unit -> unit |
151 | val _use_runtime : string -> unit |
152 | val _output_complete_exe : unit -> unit |
153 | |
154 | val _dinstr : unit -> unit |
155 | val _dcamlprimc : unit -> unit |
156 | |
157 | val _use_prims : string -> unit |
158 | end;; |
159 | |
160 | module type Bytetop_options = sig |
161 | include Toplevel_options |
162 | val _dinstr : unit -> unit |
163 | |
164 | end;; |
165 | |
166 | module type Optcommon_options = sig |
167 | val _compact : unit -> unit |
168 | val _inline : string -> unit |
169 | val _inline_toplevel : string -> unit |
170 | val _inlining_report : unit -> unit |
171 | val _dump_pass : string -> unit |
172 | val _inline_max_depth : string -> unit |
173 | val _rounds : int -> unit |
174 | val _inline_max_unroll : string -> unit |
175 | val _classic_inlining : unit -> unit |
176 | val _inline_call_cost : string -> unit |
177 | val _inline_alloc_cost : string -> unit |
178 | val _inline_prim_cost : string -> unit |
179 | val _inline_branch_cost : string -> unit |
180 | val _inline_indirect_cost : string -> unit |
181 | val _inline_lifting_benefit : string -> unit |
182 | val _unbox_closures : unit -> unit |
183 | val _unbox_closures_factor : int -> unit |
184 | val _inline_branch_factor : string -> unit |
185 | val _remove_unused_arguments : unit -> unit |
186 | val _no_unbox_free_vars_of_closures : unit -> unit |
187 | val _no_unbox_specialised_args : unit -> unit |
188 | val _o2 : unit -> unit |
189 | val _o3 : unit -> unit |
190 | val _insn_sched : unit -> unit |
191 | val _no_insn_sched : unit -> unit |
192 | val _linscan : unit -> unit |
193 | val _no_float_const_prop : unit -> unit |
194 | |
195 | val _clambda_checks : unit -> unit |
196 | val _dflambda : unit -> unit |
197 | val _drawflambda : unit -> unit |
198 | val _dflambda_invariants : unit -> unit |
199 | val _dflambda_no_invariants : unit -> unit |
200 | val _dflambda_let : int -> unit |
201 | val _dflambda_verbose : unit -> unit |
202 | val _drawclambda : unit -> unit |
203 | val _dclambda : unit -> unit |
204 | val _dcmm : unit -> unit |
205 | val _dsel : unit -> unit |
206 | val _dcombine : unit -> unit |
207 | val _dcse : unit -> unit |
208 | val _dlive : unit -> unit |
209 | val _davail : unit -> unit |
210 | val _drunavail : unit -> unit |
211 | val _dspill : unit -> unit |
212 | val _dsplit : unit -> unit |
213 | val _dinterf : unit -> unit |
214 | val _dprefer : unit -> unit |
215 | val _dalloc : unit -> unit |
216 | val _dreload : unit -> unit |
217 | val _dscheduling : unit -> unit |
218 | val _dlinear : unit -> unit |
219 | val _dinterval : unit -> unit |
220 | val _dstartup : unit -> unit |
221 | end;; |
222 | |
223 | module type Optcomp_options = sig |
224 | include Core_options |
225 | include Compiler_options |
226 | include Optcommon_options |
227 | val _nodynlink : unit -> unit |
228 | val _p : unit -> unit |
229 | val _pp : string -> unit |
230 | val _S : unit -> unit |
231 | val _shared : unit -> unit |
232 | val _afl_instrument : unit -> unit |
233 | val _afl_inst_ratio : int -> unit |
234 | val _function_sections : unit -> unit |
235 | end;; |
236 | |
237 | module type Opttop_options = sig |
238 | include Toplevel_options |
239 | include Optcommon_options |
240 | val _verbose : unit -> unit |
241 | val _S : unit -> unit |
242 | end;; |
243 | |
244 | module type Ocamldoc_options = sig |
245 | include Common_options |
246 | val _impl : string -> unit |
247 | val _intf : string -> unit |
248 | val _intf_suffix : string -> unit |
249 | val _pp : string -> unit |
250 | val _thread : unit -> unit |
251 | val _v : unit -> unit |
252 | val _verbose : unit -> unit |
253 | val _vmthread : unit -> unit |
254 | end |
255 | |
256 | module type Arg_list = sig |
257 | val list : (string * Arg.spec * string) list |
258 | end;; |
259 | |
260 | module Make_bytecomp_options : Bytecomp_options -> Arg_list;; |
261 | module Make_bytetop_options : Bytetop_options -> Arg_list;; |
262 | module Make_optcomp_options : Optcomp_options -> Arg_list;; |
263 | module Make_opttop_options : Opttop_options -> Arg_list;; |
264 | module Make_ocamldoc_options : Ocamldoc_options -> Arg_list;; |
265 | |
266 | (** [options_with_command_line_syntax options r] returns [options2] that behaves |
267 | like [options], but additionally pushes command line argument on [r] (quoted |
268 | by [Filename.quote] when necessary). |
269 | This is meant for ocaml{c,opt}p, which use this to forward most of their |
270 | arguments to ocaml{c,opt}. *) |
271 | val options_with_command_line_syntax |
272 | : (string * Arg.spec * string) list |
273 | -> string list ref |
274 | -> (string * Arg.spec * string) list |
275 | |
276 | module Default: sig |
277 | module Topmain: Bytetop_options |
278 | module Opttopmain: Opttop_options |
279 | module Main: Bytecomp_options |
280 | module Optmain: Optcomp_options |
281 | module Odoc_args: Ocamldoc_options |
282 | end |
283 |