File: CompileTimeOptions

package info (click to toggle)
mlton 20061107-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,828 kB
  • ctags: 61,118
  • sloc: ansic: 11,446; makefile: 1,339; sh: 1,160; lisp: 900; pascal: 256; asm: 97
file content (513 lines) | stat: -rw-r--r-- 13,752 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="index,nofollow">



<title>CompileTimeOptions - MLton Standard ML Compiler (SML Compiler)</title>
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css">


<link rel="Start" href="Home">


</head>

<body lang="en" dir="ltr">

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-833377-1";
urchinTracker();
</script>
<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%>
  <tr>
    <td style = "
		border: 0px;
		color: darkblue; 
		font-size: 150%;
		text-align: left;">
      <a class = mltona href="Home">MLton 20061025</a>
    <td style = "
		border: 0px;
		font-size: 150%;
		text-align: center;
		width: 50%;">
      CompileTimeOptions
    <td style = "
		border: 0px;
		text-align: right;">
      <table cellspacing = 0 style = "border: 0px">
        <tr style = "vertical-align: middle;">
      </table>
  <tr style = "background-color: white;">
    <td colspan = 3
	style = "
		border: 0px;
		font-size:70%;
		text-align: right;">
      <a href = "Home">Home</a>
      &nbsp;<a href = "Index">Index</a>
      &nbsp;
</table>
<div id="content" lang="en" dir="ltr">
MLton's compile-time options control the name of the output file, the verbosity of compile-time messages, and whether or not certain optimizations are performed.  They also can specify which intermediate files are saved and can stop the compilation process early, at some intermediate pass, in which case compilation can be resumed by passing the generated files to MLton.  MLton uses the input file suffix to determine the type of input program.  The possibilities are <tt>.c</tt>, <tt>.cm</tt>, <tt>.mlb</tt>, <tt>.o</tt>, and <tt>.sml</tt>. <p>
With no arguments, MLton prints the version number and exits.  For a usage message, run MLton with an invalid switch, e.g.  <tt>mlton&nbsp;-z</tt>.  In the explanation below and in the usage message, for flags that take a number of choices (e.g. <tt>{true|false}&nbsp;</tt>), the first value listed is the default. 
</p>
<h2 id="head-6bf5da9c080bee3a8142586c412aa39971137eee">Options</h2>

    <ul>

    <li>
<p>
 <tt>-align&nbsp;{4|8}&nbsp;</tt> 
</p>
</li>

            <ul>

   Aligns object sizes and doubles in memory by the specified    alignment.  The default varies depending on architecture. 
            </ul>


    <li class="gap">
<p>
 <tt>-as-opt</tt> <em>option</em> 
</p>
</li>

            <ul>

   Pass <em>option</em> to <tt>gcc</tt> when assembling. 
            </ul>


    <li class="gap">
<p>
 <tt>-cc-opt</tt> <em>option</em> 
</p>
</li>

            <ul>

   Pass <em>option</em> to <tt>gcc</tt> when compiling C code. 
            </ul>


    <li class="gap">
<p>
 <tt>-codegen&nbsp;{native|bytecode|c}&nbsp;</tt> 
</p>
</li>

            <ul>

   Generate native code, byte code, or C code.  With    <tt>-codegen&nbsp;native</tt>, MLton typically compiles more quickly and    generates better code. 
            </ul>


    <li class="gap">
<p>
 <tt>-const&nbsp;'</tt><em>name</em><tt>&nbsp;</tt><em>value</em><tt>'</tt> 
</p>
</li>

            <ul>

   Set the value of a compile-time constant.  Here is a list of    available constants, their default values, and what they control. 
            </ul>



        <ul>

        <li>
<p>
 <tt>Exn.keepHistory&nbsp;{false|true}&nbsp;</tt> 
</p>
</li>

                <ul>

    Enable <tt>MLton.Exn.history</tt>.  See <a href="MLtonExn">MLtonExn</a> for details.  There is     a performance cost to setting this to <tt>true</tt>, both in memory     usage of exceptions and in run time, because of additional work     that must be performed at each exception construction, raise, and     handle. 
                </ul>



        </ul>


    <li class="gap">
<p>
 <tt>-default-ann&nbsp;</tt><em>ann</em> 
</p>
</li>

            <ul>

   Specify default <a href="MLBasisAnnotations">ML Basis annotations</a>.  For    example, <tt>-default-ann&nbsp;'warnUnused&nbsp;true'</tt> causes unused    variable warnings to be enabled by default.  A default is    overridden by the corresponding annotation in an ML Basis file. 
            </ul>


    <li class="gap">
<p>
 <tt>-disable-ann&nbsp;</tt><em>ann</em> 
</p>
</li>

            <ul>

   Ignore the specified <a href="MLBasisAnnotations">ML Basis annotation</a> in    every ML Basis file.  For example, to see <em>all</em> match and unused    warnings, compile with 
<pre>-default-ann 'warnUnused true'
-disable-ann forceUsed 
-disable-ann nonexhaustiveMatch
-disable-ann redundantMatch
-disable-ann warnUnused
</pre>
            </ul>


    <li class="gap">
<p>
 <tt>-export-header&nbsp;</tt><em>file</em> 
</p>
</li>

            <ul>

   Write to <em>file</em> C prototypes for all of the functions in the    program <a href="CallingFromCToSML">exported from SML to C</a>. 
            </ul>


    <li class="gap">
<p>
 <tt>-ieee-fp&nbsp;{false|true}&nbsp;</tt> 
</p>
</li>

            <ul>

   Cause the native code generator to be pedantic about following the    IEEE floating point standard.  By default, it is not, because of    the performance cost.  This only has an effect with     <tt>-codegen&nbsp;native</tt>.  
            </ul>


    <li class="gap">
<p>
 <tt>-inline&nbsp;</tt><em>n</em> 
</p>
</li>

            <ul>

   Set the inlining threshold used in the optimizer.  The threshold is    an approximate measure of code size of a procedure.  The default is    <tt>320</tt>. 
            </ul>


    <li class="gap">
<p>
 <tt>-keep&nbsp;{g|o|sml}&nbsp;</tt> 
</p>
</li>

            <ul>

   Save intermediate files.  If no <tt>-keep</tt> argument is given, then    only the output file is saved. 
<div>
<table>
   <tr>
<td>
 <tt>g</tt> </td>
<td>
 generated <tt>.S</tt> and <tt>.c</tt> files passed to gcc and the assembler </td>
</tr>
   <tr>
<td>
 <tt>o</tt> </td>
<td>
 object (<tt>.o</tt>) files </td>
</tr>
   <tr>
<td>
 <tt>sml</tt> </td>
<td>
 SML file </td>
</tr>
</table>
</div>

            </ul>


    <li class="gap">
<p>
 <tt>-link-opt&nbsp;</tt><em>option</em> 
</p>
</li>

            <ul>

   Pass <em>option</em> to <tt>gcc</tt> when linking.  You can use this to    specify library search paths, e.g. <tt>-link-opt&nbsp;-Lpath</tt>, and    libraries to link with, e.g. <tt>-link-opt&nbsp;-lfoo</tt>, or even both at    the same time, e.g. <tt>-link-opt&nbsp;'-Lpath&nbsp;-lfoo'</tt>.  If you wish to    pass an option to the linker, you must use <tt>gcc</tt>'s <tt>-Wl,</tt>    syntax, e.g., <tt>-link-opt&nbsp;'-Wl,--export-dynamic'</tt>. 
            </ul>


    <li class="gap">
<p>
 <tt>-mlb-path-map&nbsp;</tt><em>file</em> 
</p>
</li>

            <ul>

   Use <em>file</em> as an <a href="MLBasisPathMap">ML Basis path map</a> to define    additional MLB path variables.  Multiple uses of    <tt>-mlb-path-map</tt> are allowed, with variable definitions in later    path maps taking precedence over earlier ones. 
            </ul>


    <li class="gap">
<p>
 <tt>-output&nbsp;</tt><em>file</em> 
</p>
</li>

            <ul>

   Specify the name of the final output file. The default name is the    input file name with its suffix removed and an appropriate,    possibly empty, suffix added. 
            </ul>


    <li class="gap">
<p>
 <tt>-profile&nbsp;{no|alloc|count|time}&nbsp;</tt> 
</p>
</li>

            <ul>

   Produce an executable that gathers <a href="Profiling">Profiling</a> data.  When    such an executable is run, it produces an <tt>mlmon.out</tt> file. 
            </ul>


    <li class="gap">
<p>
 <tt>-profile-branch&nbsp;{false|true}&nbsp;</tt> 
</p>
</li>

            <ul>

   If true, the profiler will separately gather profiling data for     each branch of a function definition, <tt>case</tt> expression, and    <tt>if</tt> expression.  
            </ul>


    <li class="gap">
<p>
 <tt>-profile-stack&nbsp;{false|true}&nbsp;</tt> 
</p>
</li>

            <ul>

   If <tt>true</tt>, the executable will gather profiling data for all    functions on the stack, not just the currently executing function.    See <a href="ProfilingTheStack">ProfilingTheStack</a>. 
            </ul>


    <li class="gap">
<p>
 <tt>-runtime&nbsp;</tt><em>arg</em> 
</p>
</li>

            <ul>

   Pass argument to the runtime system via <tt>@MLton</tt>.  See    <a href="RunTimeOptions">RunTimeOptions</a>.  The argument will be processed before other    <tt>@MLton</tt> command line switches.  Multiple uses of    <tt>-runtime</tt> are allowed, and will pass all the arguments in    order.  If the same runtime switch occurs more than once, then the    last setting will take effect.  There is no need to supply the    leading <tt>@MLton</tt> or the trailing <tt>--</tt>; these will be    supplied automatically. <p>
   An argument to <tt>-runtime</tt> may contain spaces, which will cause    the argument to be treated as a sequence of words by the runtime.    For example the command line: 
</p>
   
<pre>mlton -runtime 'ram-slop 0.4' foo.sml</pre><p>
   will cause <tt>foo</tt> to run as if it had been called like: 
</p>
   
<pre>foo @MLton ram-slop 0.4 --</pre><p>
   An executable created with <tt>-runtime&nbsp;stop</tt> doesn't process any    <tt>@MLton</tt> arguments.  This is useful to create an executable,    e.g. <tt>echo</tt>, that must treat <tt>@MLton</tt> like any other    command-line argument.  
</p>
   
<pre>% mlton -runtime stop echo.sml
% echo @MLton --
@MLton --</pre>
            </ul>


    <li class="gap">
<p>
 <tt>-show-basis&nbsp;</tt><em>file</em> 
</p>
</li>

            <ul>

   Pretty print to <em>file</em> the basis defined by the input program.    See <a href="ShowBasis">ShowBasis</a>. 
            </ul>


    <li class="gap">
<p>
 <tt>-show-def-use&nbsp;</tt><em>file</em> 
</p>
</li>

            <ul>

   Output def-use information to <em>file</em>.  Each identifier that is    defined appears on a line, followed on subsequent lines by the    position of each use. 
            </ul>


    <li class="gap">
<p>
 <tt>-stop&nbsp;{f|g|o|sml|tc}&nbsp;</tt> 
</p>
</li>

            <ul>

   Specify when to stop. 
<div>
<table>
   <tr>
<td>
 <tt>f</tt> </td>
<td>
 list of files on stdout (only makes sense when input is <tt>foo.cm</tt> or <tt>foo.mlb</tt>) </td>
</tr>
   <tr>
<td>
 <tt>g</tt> </td>
<td>
 generated <tt>.S</tt> and <tt>.c</tt> files </td>
</tr>
   <tr>
<td>
 <tt>o</tt> </td>
<td>
 object (<tt>.o</tt>) files </td>
</tr>
   <tr>
<td>
 <tt>sml</tt> </td>
<td>
 SML file (only makes sense when input is <tt>foo.cm</tt> or <tt>foo.mlb</tt>) </td>
</tr>
   <tr>
<td>
 <tt>tc</tt> </td>
<td>
after type checking </td>
</tr>
</table>
</div>
<p>
   If you compile with <tt>-stop&nbsp;g</tt> or <tt>-stop&nbsp;o</tt>, you can resume    compilation by running MLton on the generated <tt>.c</tt> and <tt>.S</tt>    or <tt>.o</tt> files.  
</p>

            </ul>


    <li class="gap">
<p>
 <tt>-target&nbsp;{self|</tt>...<tt>}&nbsp;</tt> 
</p>
</li>

            <ul>

   Generate an executable that runs on the specified platform.  The    default is <tt>self</tt>, which means to compile for the machine that    MLton is running on.  To use any other target, you must first    install a <a href="CrossCompiling"> cross compiler</a>. 
            </ul>


    <li class="gap">
<p>
 <tt>-target-as-opt&nbsp;</tt><em>target</em><tt>&nbsp;</tt><em>option</em> 
</p>
</li>

            <ul>

   Like <tt>-as-opt</tt>, this passes <em>option</em> to <tt>gcc</tt> when    assembling, except it only passes <em>option</em> when the target architecture    or operating system is <em>target</em>.  Valid values for <em>target</em>    are: <tt>hppa</tt>, <tt>powerpc</tt>, <tt>sparc</tt>, <tt>x86</tt>,    <tt>cygwin</tt>, <tt>darwin</tt>, <tt>freebsd</tt>, <tt>linux</tt>,    <tt>mingw</tt>, <tt>netbsd</tt>, <tt>openbsd</tt>, <tt>solaris</tt>. 
            </ul>


    <li class="gap">
<p>
 <tt>-target-cc-opt&nbsp;</tt><em>target</em><tt>&nbsp;</tt><em>option</em> 
</p>
</li>

            <ul>

   Like <tt>-cc-opt</tt>, this passes <em>option</em> to <tt>gcc</tt> when compiling    C code, except it only passes <em>option</em> when the target architecture    or operating system is <em>target</em>.  Valid values for <em>target</em> are    as for <tt>-target-as-opt</tt>. 
            </ul>


    <li class="gap">
<p>
 <tt>-target-link-opt&nbsp;</tt><em>target</em><tt>&nbsp;</tt><em>option</em> 
</p>
</li>

            <ul>

   Like <tt>-link-opt</tt>, this passes <em>option</em> to <tt>gcc</tt> when    linking, except it only passes <em>option</em> when the target architecture    or operating system is <em>target</em>.  Valid values for <em>target</em> are    as for <tt>-target-as-opt</tt>. 
            </ul>


    <li class="gap">
<p>
 <tt>-verbose&nbsp;{0|1|2|3}&nbsp;</tt> 
</p>
</li>

            <ul>

   How verbose to be about what passes are running.  The default is    <tt>0</tt>. 
<div>
<table>
   <tr>
<td>
 <tt>0</tt> </td>
<td>
 silent </td>
</tr>
   <tr>
<td>
 <tt>1</tt> </td>
<td>
 calls to compiler, assembler, and linker </td>
</tr>
   <tr>
<td>
 <tt>2</tt> </td>
<td>
 1, plus intermediate compiler passes </td>
</tr>
   <tr>
<td>
 <tt>3</tt> </td>
<td>
 2, plus some data structure sizes </td>
</tr>
</table>
</div>
</ul>

</ul>

</div>



<p>
<hr>
Last edited on 2005-12-02 06:14:04 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
</body></html>