flags.xml 54.8 KB
Newer Older
1
<?xml version="1.0" encoding="iso-8859-1"?>
2
  <sect1 id="flag-reference">
3
4
    <title>Flag reference</title>

5
6
    <para>This section is a quick-reference for GHC's command-line
    flags.  For each flag, we also list its static/dynamic status (see
7
    <xref linkend="static-dynamic-flags"/>), and the flag's opposite
8
9
    (if available).</para>

10
    <sect2>
11
12
13
      <title>Help and verbosity options</title>

      <para><xref linkend="options-help"/></para>
14
15

      <informaltable>
16
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
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
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-?</option></entry>
	      <entry>help</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-help</option></entry>
	      <entry>help</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-v</option></entry>
	      <entry>verbose mode (equivalent to <option>-v3</option>)</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-v</option><replaceable>n</replaceable></entry>
	      <entry>set verbosity level</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
50
51
52
53
54
55
	    <row>
	      <entry><option>-V</option></entry>
	      <entry>display GHC version</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
56
	    <row>
57
	      <entry><option>&ndash;&ndash;version</option></entry>
58
59
60
61
62
	      <entry>display GHC version</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
63
	      <entry><option>&ndash;&ndash;numeric-version</option></entry>
64
65
66
67
	      <entry>display GHC version (numeric only)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
68
	    <row>
69
	      <entry><option>&ndash;&ndash;print-libdir</option></entry>
70
71
72
73
	      <entry>display GHC library directory</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
74
75
76
77
78
79
	    <row>
	      <entry><option>-ferror-spans</option></entry>
	      <entry>output full span in error messages</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
80
81
82
83
84
85
	  </tbody>
	</tgroup>
      </informaltable>

    </sect2>
    <sect2>
86
      <title>Which phases to run</title>
87
      
88
89
      <para><xref linkend="options-order"/></para>

90
      <informaltable>
91
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
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
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-E</option></entry>
	      <entry>Stop after preprocessing (<literal>.hspp</literal> file)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-C</option></entry>
	      <entry>Stop after generating C (<literal>.hc</literal> file)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-S</option></entry>
	      <entry>Stop after generating assembly (<literal>.s</literal> file)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-c</option></entry>
	      <entry>Stop after compiling to object code (<literal>.o</literal> file)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
128
129
130
    </sect2>

     <sect2>
131
      <title>Alternative modes of operation</title>
132
      
133
134
      <para><xref linkend="modes"/></para>

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
      <informaltable>
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>--interactive</option></entry>
	      <entry>Interactive mode - normally used by just running <command>ghci</command></entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>--make</option></entry>
	      <entry>Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using <command>make</command>.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-e <replaceable>expr</replaceable></option></entry>
	      <entry>Evaluate <replaceable>expr</replaceable></entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-M</option></entry>
	      <entry>Generate dependency information suitable for use in a <filename>Makefile</filename>.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>--mk-dll</option></entry>
	      <entry>DLL-creation mode (Windows only)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
179
180
181
    </sect2>

    <sect2>
182
      <title>Redirecting output</title>
183
      
184
185
      <para><xref linkend="options-output"/></para>

186
      <informaltable>
187
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
188
189
190
191
192
193
194
195
196
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
197
198
199
200
201
202
	    <row>
	      <entry><option>-hcsuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the suffix to use for intermediate C files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
203
204
205
206
207
208
	    <row>
	      <entry><option>-hidir</option> <replaceable>dir</replaceable></entry>
	      <entry>set directory for interface files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
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
	    <row>
	      <entry><option>-hisuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the suffix to use for interface files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-o</option> <replaceable>filename</replaceable></entry>
	      <entry>set output filename</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-odir</option> <replaceable>dir</replaceable></entry>
	      <entry>set output directory</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ohi</option> <replaceable>filename</replaceable></entry>
	      <entry>set the filename in which to put the interface</entry>
	      <entry>static</entry>
	      <entry></entry>
	    </row>
	    <row>
	      <entry><option>-osuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the output file suffix</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
245
246
247
      <title>Keeping intermediate files</title>
      
      <para><xref linkend="keeping-intermediates"/></para>
248
249
      
      <informaltable>
250
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
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
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-keep-hc-file</option></entry>
	      <entry>retain intermediate <literal>.hc</literal> files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-s-file</option></entry>
	      <entry>retain intermediate <literal>.s</literal> files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-raw-s-file</option></entry>
	      <entry>retain intermediate <literal>.raw_s</literal> files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-tmp-files</option></entry>
	      <entry>retain all intermediate temporary files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
290
      <title>Temporary files</title>
291
      
292
293
      <para><xref linkend="temp-files"/></para>

294
      <informaltable>
295
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-tmpdir</option></entry>
	      <entry>set the directory for temporary files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
317
318
319
      <title>Finding imports</title>

      <para><xref linkend="search-path"/></para>
320
321

      <informaltable>
322
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
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
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-i</option><replaceable>dir1</replaceable>:<replaceable>dir2</replaceable>:...</entry>
	      <entry>add <replaceable>dir</replaceable>,
	          <replaceable>dir2</replaceable>, etc. to import path</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-i</option></entry>
	      <entry>Empty the import directory list</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
352
353
354
      <title>Interface file options</title>

      <para><xref linkend="hi-options"/></para>
355
356

      <informaltable>
357
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-ddump-hi</option></entry>
	      <entry>Dump the new interface to stdout</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-hi-diffs</option></entry>
	      <entry>Show the differences vs. the old interface</entry>
	      <entry>dynamic</entry>
378
379
380
381
382
383
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-minimal-imports</option></entry>
	      <entry>Dump a minimal set of imports</entry>
	      <entry>dynamic</entry>
384
385
	      <entry>-</entry>
	    </row>
386
387
388
389
390
391
392
393
	    <row>
	      <entry><option>--show-iface</option> <replaceable>file</replaceable></entry>
	      <entry>Read the interface in
	      <replaceable>file</replaceable> and dump it as text to
	      <literal>stdout</literal>.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
394
395
396
397
398
399
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
    
    <sect2>
400
401
402
      <title>Recompilation checking</title>

      <para><xref linkend="recomp"/></para>
403
404

      <informaltable>
405
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
406
407
408
409
410
411
412
413
414
415
416
417
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-no-recomp</option></entry>
418
419
420
	      <entry>Turn off recompilation checking; implied by any
	      <option>-ddump-X</option> option</entry>
	      <entry>dynamic</entry>
421
	      <entry><option>-recomp</option></entry>
422
423
424
425
426
427
428
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
429
      <title>Interactive-mode options</title>
430
      
431
432
      <para><xref linkend="ghci-dot-files"/></para>

433
      <informaltable>
434
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
435
	  <thead>
436
	    <row>
437
438
439
440
441
442
443
444
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
445
446
	      <entry><option>-ignore-dot-ghci</option></entry>
	      <entry>Disable reading of <filename>.ghci</filename> files</entry>
447
448
449
450
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
451
452
	      <entry><option>-read-dot-ghci</option></entry>
	      <entry>Enable reading of <filename>.ghci</filename> files</entry>
453
454
455
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
456
457
458
459
460
461
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
462
463
464
465
      <title>Packages</title>

      <para><xref linkend="packages"/></para>

466
      <informaltable>
467
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
468
469
470
471
472
473
474
475
476
	  <thead>
    	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
477
	    <row>
478
479
480
481
	      <entry><option>-package</option> <replaceable>P</replaceable></entry>
	      <entry>Expose package <replaceable>P</replaceable></entry>
	      <entry>static</entry>
	      <entry>-</entry>
482
483
484
485
486
487
	    </row>
	    <row>
	      <entry><option>-hide-all-packages</option></entry>
	      <entry>Hide all packages by default</entry>
	      <entry>static</entry>
	      <entry>-</entry>
488
489
490
491
492
493
494
495
496
497
	    </row>
	    <row>
	      <entry><option>-hide-package</option> <replaceable>name</replaceable></entry>
	      <entry>Hide package <replaceable>P</replaceable></entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ignore-package</option> <replaceable>name</replaceable></entry>
	      <entry>Ignore package <replaceable>P</replaceable></entry>
498
499
500
501
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
502
503
	      <entry><option>-package-conf</option> <replaceable>file</replaceable></entry>
	      <entry>Load more packages from <replaceable>file</replaceable></entry>
504
505
506
507
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
508
509
	      <entry><option>-no-user-package-conf</option></entry>
	      <entry>Don't load the user's package config file.</entry>
510
511
512
513
514
515
516
517
518
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
519
520
521
      <title>Language options</title>

      <para><xref linkend="options-language"/></para>
522
523

      <informaltable>
524
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
525
526
527
528
529
530
531
532
533
534
535
	  <thead>
    	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-fallow-overlapping-instances</option></entry>
536
	      <entry>Enable overlapping instances</entry>
537
538
539
540
	      <entry>dynamic</entry>
	      <entry><option>-fno-allow-overlapping-instances</option></entry>
	    </row>
	    <row>
541
542
	      <entry><option>-fallow-undecidable-instances</option></entry>
	      <entry>Enable undecidable instances</entry>
543
	      <entry>dynamic</entry>
544
	      <entry><option>-fno-allow-undecidable-instances</option></entry>
545
	    </row>
546
547
	    <row>
	      <entry><option>-fallow-incoherent-instances</option></entry>
548
549
	      <entry>Enable incoherent instances.  
	      Implies <option>-fallow-overlapping-instances</option> </entry>
550
551
552
553
554
555
556
557
558
	      <entry>dynamic</entry>
	      <entry><option>-fno-allow-incoherent-instances</option></entry>
	    </row>
	    <row>
	      <entry><option>-farrows</option></entry>
	      <entry>Enable arrow notation extension</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-arrows</option></entry>
	    </row>
559
	    <row>
560
561
	      <entry><option>-fcontext-stack</option><replaceable>n</replaceable></entry>
	      <entry>set the limit for context reduction</entry>
562
	      <entry>static</entry>
563
	      <entry><option>-</option></entry>
564
	    </row>
chak's avatar
chak committed
565
566
567
568
569
570
	    <row>
	      <entry><option>-ffi</option> or <option>-fffi</option></entry>
	      <entry>Enable foreign function interface (implied by
	      <option>-fglasgow-exts</option>)</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-ffi</option></entry>
ross's avatar
ross committed
571
572
	    </row>
	    <row>
573
574
	      <entry><option>-fgenerics</option></entry>
	      <entry>Enable generics</entry>
ross's avatar
ross committed
575
	      <entry>dynamic</entry>
576
	      <entry><option>-fno-fgenerics</option></entry>
chak's avatar
chak committed
577
578
	    </row>
	    <row>
579
580
	      <entry><option>-fglasgow-exts</option></entry>
	      <entry>Enable most language extensions</entry>
chak's avatar
chak committed
581
	      <entry>dynamic</entry>
582
	      <entry><option>-fno-glasgow-exts</option></entry>
chak's avatar
chak committed
583
	    </row>
584
585
586
587
588
589
	    <row>
	      <entry><option>-fignore-asserts</option></entry>
	      <entry>Ignore assertions</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-ignore-asserts</option></entry>
	    </row>
590
591
	    <row>
	      <entry><option>-fimplicit-params</option></entry>
592
593
	      <entry>Enable Implicit Parameters.
	      Implied by <option>-fglasgow-exts</option>.</entry>
594
595
596
597
598
599
600
601
602
	      <entry>dynamic</entry>
	      <entry><option>-fno-implicit-params</option></entry>
	    </row>
	    <row>
	      <entry><option>-firrefutable-tuples</option></entry>
	      <entry>Make tuple pattern matching irrefutable</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-irrefutable-tuples</option></entry>
	    </row>
603
604
605
606
	    <row>
	      <entry><option>-fno-implicit-prelude</option></entry>
	      <entry>Don't implicitly <literal>import Prelude</literal></entry>
	      <entry>dynamic</entry>
607
	      <entry><option>-fimplicit-prelude</option></entry>
608
609
610
611
612
	    </row>
	    <row>
	      <entry><option>-fno-monomorphism-restriction</option></entry>
	      <entry>Disable the monomorphism restriction</entry>
	      <entry>dynamic</entry>
613
	      <entry><option>-fmonomorphism-restriction</option></entry>
614
	    </row>
615
616
617
618
619
620
621
	    <row>
	      <entry><option>-fscoped-type-variables</option></entry>
	      <entry>Enable lexically-scoped type variables.
	      Implied by <option>-fglasgow-exts</option>.</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-scoped-type-variables</option></entry>
	    </row>
622
	    <row>
623
	      <entry><option>-fth</option></entry>
624
625
	      <entry>Enable Template Haskell. 
		Implied by <option>-fglasgow-exts</option>.</entry>
626
	      <entry>dynamic</entry>
627
	      <entry><option>-fno-th</option></entry>
628
629
630
631
632
633
634
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
635
      <title>Warnings</title>
636
      
637
638
      <para>(<xref linkend="options-sanity"/></para>

639
    <informaltable>
640
      <tgroup cols="3" align="left" colsep="1" rowsep="1">
641
642
643
644
645
646
647
648
649
650
651
652
	<thead>
	  <row>
	    <entry>Flag</entry>
	    <entry>Description</entry>
	    <entry>Static/Dynamic</entry>
	    <entry>Reverse</entry>
	  </row>
	</thead>
	<tbody>
	  <row>
	    <entry><option>-W</option></entry>
	    <entry>enable normal warnings</entry>
653
	    <entry>dynamic</entry>
654
655
656
657
658
	    <entry><option>-w</option></entry>
	  </row>
	  <row>
	    <entry><option>-w</option></entry>
	    <entry>disable all warnings</entry>
659
	    <entry>dynamic</entry>
660
661
662
663
664
	    <entry>-</entry>
	  </row>
	  <row>
	    <entry><option>-Wall</option></entry>
	    <entry>enable all warnings</entry>
665
	    <entry>dynamic</entry>
666
667
	    <entry><option>-w</option></entry>
	  </row>
668
669
670
671
672
673
	  <row>
	    <entry><option>-Werror</option></entry>
	    <entry>make warnings fatal</entry>
	    <entry>dynamic</entry>
	    <entry></entry>
	  </row>
674
675
676

	  <row>
	    <entry><option>-fwarn-deprecations</option></entry>
677
	    <entry>warn about uses of functions &amp; types that are deprecated</entry>
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-deprecations</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-duplicate-exports</option></entry>
	    <entry>warn when an entity is exported multiple times</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-duplicate-exports</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-hi-shadowing</option></entry>
	    <entry>warn when a <literal>.hi</literal> file in the
	    current directory shadows a library</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-hi-shadowing</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-incomplete-patterns</option></entry>
	    <entry>warn when a pattern match could fail</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-incomplete-patterns</option></entry>
	  </row>

704
705
706
707
708
709
710
	  <row>
	    <entry><option>-fwarn-incomplete-record-updates</option></entry>
	    <entry>warn when a record update could fail</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-incomplete-record-updates</option></entry>
	  </row>

711
712
713
714
715
716
717
	  <row>
	    <entry><option>-fwarn-misc</option></entry>
	    <entry>enable miscellaneous warnings</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-misc</option></entry>
	  </row>

718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
	  <row>
	    <entry><option>-fwarn-missing-fields</option></entry>
	    <entry>warn when fields of a record are uninitialised</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-missing-fields</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-missing-methods</option></entry>
	    <entry>warn when class methods are undefined</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-missing-methods</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-missing-signatures</option></entry>
	    <entry>warn about top-level functions without signatures</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-missing-signatures</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-name-shadowing</option></entry>
	    <entry>warn when names are shadowed</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-name-shadowing</option></entry>
	  </row>

746
747
748
749
750
751
752
753
	  <row>
	    <entry><option>-fwarn-oprhans</option></entry>
	    <entry>warn when the module contains "orphan" instance declarations
	    or rewrite rules</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-orphans</option></entry>
	  </row>

754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
	  <row>
	    <entry><option>-fwarn-overlapping-patterns</option></entry>
	    <entry>warn about overlapping patterns</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-overlapping-patterns</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-simple-patterns</option></entry>
	    <entry>warn about lambda-patterns that can fail</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-simple-patterns</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-type-defaults</option></entry>
	    <entry>warn when defaulting happens</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-type-defaults</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-unused-binds</option></entry>
	    <entry>warn about bindings that are unused</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-unused-binds</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-unused-imports</option></entry>
	    <entry>warn about unnecessary imports</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-unused-imports</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-unused-matches</option></entry>
	    <entry>warn about variables in patterns that aren't used</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-unused-matches</option></entry>
	  </row>

	  </tbody>
	</tgroup>
      </informaltable>

    </sect2>
    <sect2>
802
803
804
      <title>Optimisation levels</title>

      <para><xref linkend="options-optimise"/></para>
805
806

      <informaltable>
807
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
808
809
810
811
812
813
814
815
816
817
818
819
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-O</option></entry>
	      <entry>Enable default optimisation (level 1)</entry>
820
	      <entry>dynamic</entry>
821
822
823
824
825
	      <entry><option>-O0</option></entry>
	    </row>
	    <row>
	      <entry><option>-O</option><replaceable>n</replaceable></entry>
	      <entry>Set optimisation level <replaceable>n</replaceable></entry>
826
	      <entry>dynamic</entry>
827
828
829
830
831
832
833
834
	      <entry><option>-O0</option></entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
	      
    </sect2>
    <sect2>
835
836
837
      <title>Individual optimisations</title>

      <para><xref linkend="options-f"/></para>
838
839

      <informaltable>
840
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
841
842
843
844
845
846
847
848
849
850
851
852
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-fcase-merge</option></entry>
	      <entry>Enable case-merging</entry>
853
	      <entry>dynamic</entry>
854
855
856
857
858
859
	      <entry><option>-fno-case-merge</option></entry>
	    </row>

	    <row>
	      <entry><option>-fdicts-strict</option></entry>
	      <entry>Make dictionaries strict</entry>
860
	      <entry>static</entry>
861
862
863
864
865
866
	      <entry><option>-fno-dicts-strict</option></entry>
	    </row>

	    <row>
	      <entry><option>-fdo-eta-reduction</option></entry>
	      <entry>Enable eta-reduction</entry>
867
	      <entry>dynamic</entry>
868
869
870
871
872
873
	      <entry><option>-fno-do-eta-reduction</option></entry>
	    </row>

	    <row>
	      <entry><option>-fdo-lambda-eta-expansion</option></entry>
	      <entry>Enable lambda eta-reduction</entry>
874
	      <entry>dynamic</entry>
875
876
877
878
879
880
881
882
883
884
885
	      <entry><option>-fno-do-lambda-eta-expansion</option></entry>
	    </row>

	    <row>
	      <entry><option>-fexcess-precision</option></entry>
	      <entry>Enable excess intermediate precision</entry>
	      <entry>static</entry>
	      <entry><option>-fno-excess-precision</option></entry>
	    </row>

	    <row>
886
	      <entry><option>-frules-off</option></entry>
887
888
	      <entry>Switch off all rewrite rules (including rules
	      generated by automatic specialisation of overloaded functions)</entry>
889
	      <entry>static</entry>
890
	      <entry><option>-frules-off</option></entry>
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
	    </row>

	    <row>
	      <entry><option>-fignore-asserts</option></entry>
	      <entry>Ignore assertions in the source</entry>
	      <entry>static</entry>
	      <entry><option>-fno-ignore-asserts</option></entry>
	    </row>

	    <row>
	      <entry><option>-fignore-interface-pragmas</option></entry>
	      <entry>Ignore pragmas in interface files</entry>
	      <entry>static</entry>
	      <entry><option>-fno-ignore-interface-pragmas</option></entry>
	    </row>

	    <row>
	      <entry><option>-fliberate-case-threshold</option></entry>
chak's avatar
chak committed
909
	      <entry>Tweak the liberate-case optimisation (default: 10)</entry>
910
911
912
913
914
915
916
	      <entry>static</entry>
	      <entry><option>-fno-liberate-case-threshold</option></entry>
	    </row>

	    <row>
	      <entry><option>-fomit-interface-pragmas</option></entry>
	      <entry>Don't generate interface pragmas</entry>
917
	      <entry>dynamic</entry>
918
919
920
	      <entry><option>-fno-omit-interface-pragmas</option></entry>
	    </row>

chak's avatar
chak committed
921
922
923
924
925
926
927
928
	    <row>
	      <entry><option>-fmax-worker-args</option></entry>
	      <entry>If a worker has that many arguments, none will be
	        unpacked anymore (default: 10)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>

929
930
931
	    <row>
	      <entry><option>-fmax-simplifier-iterations</option></entry>
	      <entry>Set the max iterations for the simplifier</entry>
932
	      <entry>dynamic</entry>
933
934
935
	      <entry>-</entry>
	    </row>

936
937
938
939
940
941
942
943
	    <row>
	      <entry><option>-fno-state-hack</option></entry>
	      <entry>Turn off the "state hack" whereby any lambda with a real-world state token
	      as argument is considered to be single-entry.  Hence OK to inline things inside it.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>

944
945
946
	    <row>
	      <entry><option>-fno-cse</option></entry>
	      <entry>Turn off common sub-expression</entry>
947
	      <entry>dynamic</entry>
948
949
950
	      <entry>-</entry>
	    </row>

951
952
	    <row>
	      <entry><option>-fno-full-laziness</option></entry>
953
	      <entry>Turn off full laziness (floating bindings outwards).</entry>
954
	      <entry>dynamic</entry>
955
	      <entry>-ffull-laziness</entry>
956
957
	    </row>

958
959
960
961
962
963
964
965
966
967
	    <row>
	      <entry><option>-fno-pre-inlining</option></entry>
	      <entry>Turn off pre-inlining</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>

	    <row>
	      <entry><option>-fno-strictness</option></entry>
	      <entry>Turn off strictness analysis</entry>
968
	      <entry>dynamic</entry>
969
970
971
972
973
974
	      <entry>-</entry>
	    </row>

	    <row>
	      <entry><option>-funbox-strict-fields</option></entry>
	      <entry>Flatten strict constructor fields</entry>
975
	      <entry>dynamic</entry>
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
	      <entry><option>-fno-unbox-strict-fields</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-creation-threshold</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-creation-threshold</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-fun-discount</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-fun-discount</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-keeness-factor</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-keeness-factor</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-update-in-place</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-update-in-place</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-use-threshold</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-use-threshold</option></entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1019
1020
1021
      <title>Profiling options</title>
      
      <para><xref linkend="profiling"/></para>
1022
1023

      <informaltable>
1024
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-auto</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all
	      exported functions</entry>
	      <entry>static</entry>
	      <entry><option>-no-auto</option></entry>
	    </row>
	    <row>
	      <entry><option>-auto-all</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all
	      top-level functions</entry>
	      <entry>static</entry>
	      <entry><option>-no-auto-all</option></entry>
	    </row>
	    <row>
	      <entry><option>-auto-dicts</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all dictionaries</entry>
	      <entry>static</entry>
	      <entry><option>-no-auto-dicts</option></entry>
	    </row>
	    <row>
	      <entry><option>-caf-all</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all CAFs</entry>
	      <entry>static</entry>
	      <entry><option>-no-caf-all</option></entry>
	    </row>
	    <row>
	      <entry><option>-prof</option></entry>
	      <entry>Turn on profiling</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ticky</option></entry>
	      <entry>Turn on ticky-ticky profiling</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1078
1079
1080
      <title>Parallelism options</title>

      <para><xref linkend="sec-using-parallel"/></para>
1081
1082

      <informaltable>
1083
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-gransim</option></entry>
	      <entry>Enable GRANSIM</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-parallel</option></entry>
	      <entry>Enable Parallel Haskell</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-smp</option></entry>
	      <entry>Enable SMP support</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1117
1118
1119
      <title>C pre-processor options</title>

      <para><xref linkend="c-pre-processor"/></para>
1120
1121

      <informaltable>
1122
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1123
1124
1125
1126
1127
1128
1129
1130
1131
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
1132
1133
1134
1135
1136
1137
	    <row>
	      <entry><option>-cpp</option></entry>
	      <entry>Run the C pre-processor on Haskell source files</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
	    <row>
	      <entry><option>-D</option><replaceable>symbol</replaceable><optional>=<replaceable>value</replaceable></optional></entry>
	      <entry>Define a symbol in the C pre-processor</entry>
	      <entry>dynamic</entry>
	      <entry><option>-U</option><replaceable>symbol</replaceable></entry>
	    </row>
	    <row>
	      <entry><option>-U</option><replaceable>symbol</replaceable></entry>
	      <entry>Undefine a symbol in the C pre-processor</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-I</option><replaceable>dir</replaceable></entry>
	      <entry>Add <replaceable>dir</replaceable> to the
	      directory search list for <literal>#include</literal> files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1163
1164
1165
      <title>C compiler options</title>

      <para><xref linkend="options-C-compiler"/></para>
1166
      <informaltable>
1167
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-#include</option> <replaceable>file</replaceable></entry>
	      <entry>Include <replaceable>file</replaceable> when
	      compiling the <filename>.hc</filename> file</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

1189
    <sect2>
1190
1191
1192
      <title>Code generation options</title>

      <para><xref linkend="options-codegen"/></para>
1193
1194

      <informaltable>
1195
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-fasm</option></entry>
	      <entry>Use the native code generator</entry>
	      <entry>dynamic</entry>
	      <entry>-fvia-C</entry>
	    </row>
	    <row>
	      <entry><option>-fvia-C</option></entry>
	      <entry>Compile via C</entry>
	      <entry>dynamic</entry>
	      <entry>-fasm</entry>
	    </row>
1217
1218
1219
1220
1221
1222
	    <row>
	      <entry><option>-fno-code</option></entry>
	      <entry>Omit code generation</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1223
1224
1225
1226
1227
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

1228
    <sect2>
1229
1230
1231
      <title>Linking options</title>

      <para><xref linkend="options-linker"/></para>
1232
1233

      <informaltable>
1234
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-dynamic</option></entry>
	      <entry>Use dynamic Haskell libraries (if available)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
	    <row>
	      <entry><option>-framework</option> <replaceable>name</replaceable></entry>
	      <entry>On Darwin/MacOS X only, link in the framework <replaceable>name</replaceable>.
		This option corresponds to the <option>-framework</option> option for Apple's Linker.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-framework-path</option> <replaceable>name</replaceable></entry>
	      <entry>On Darwin/MacOS X only, add <replaceable>dir</replaceable> to the list of
	        directories searched for frameworks.
		This option corresponds to the <option>-F</option> option for Apple's Linker.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
	    <row>
	      <entry><option>-l</option><replaceable>lib</replaceable></entry>
	      <entry>Link in library <replaceable>lib</replaceable></entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-L</option><replaceable>dir</replaceable></entry>
	      <entry>Add <replaceable>dir</replaceable> to the list of
	      directories searched for libraries</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1278
	    <row>
1279
1280
	      <entry><option>-main-is</option></entry>
	      <entry>Set main function</entry>
1281
1282
1283
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1284
	    <row>
1285
	      <entry><option>-no-hs-main</option></entry>
ross's avatar
ross committed
1286
	      <entry>Don't assume this program contains <literal>main</literal></entry>
1287
1288
1289
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1290
	    <row>
1291
1292
	      <entry><option>-no-link</option></entry>
	      <entry>Omit linking</entry>
1293
1294
1295
1296
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
1297
1298
	      <entry><option>-package</option> <replaceable>name</replaceable></entry>
	      <entry>Link in package <replaceable>name</replaceable></entry>
1299
1300
1301
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
	    <row>
	      <entry><option>-split-objs</option></entry>
	      <entry>Split objects (for libraries)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-static</option></entry>
	      <entry>Use static Haskell libraries</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
	    <row>
	      <entry><option>-threaded</option></entry>
	      <entry>Use the threaded runtime</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-debug</option></entry>
	      <entry>Use the debugging runtime</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1326
1327
1328
1329
1330
1331
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1332
1333
1334
      <title>Replacing phases</title>

      <para><xref linkend="replacing-phases"/></para>
1335
1336

      <informaltable>
1337
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-pgmL</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the literate pre-processor</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-pgmP</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the C
	      pre-processor (with <option>-cpp</option> only)</entry>
	      <entry>static</entry> <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-pgmc</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the C compiler</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-pgma</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the assembler</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-pgml</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the linker</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-pgmdll</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the DLL generator</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-pgmdep</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the dependency generator</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
sof's avatar
sof committed
1389
1390
1391
1392
1393
1394
1395
	    <row>
	      <entry><option>-pgmF</option> <replaceable>cmd</replaceable></entry>
	      <entry>Use <replaceable>cmd</replaceable> as the pre-processor
	      (with <option>-F</option> only)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
	  </tbody>
	</tgroup>
      </informaltable>
      <indexterm><primary><option>-pgmL</option></primary></indexterm>
      <indexterm><primary><option>-pgmP</option></primary></indexterm>
      <indexterm><primary><option>-pgmc</option></primary></indexterm>
      <indexterm><primary><option>-pgma</option></primary></indexterm>
      <indexterm><primary><option>-pgml</option></primary></indexterm>
      <indexterm><primary><option>-pgmdll</option></primary></indexterm>
      <indexterm><primary><option>-pgmdep</option></primary></indexterm>
sof's avatar
sof committed
1406
      <indexterm><primary><option>-pgmF</option></primary></indexterm>
1407
1408
1409
1410

    </sect2>

    <sect2>
1411
1412
1413
      <title>Forcing options to particular phases</title>

      <para><xref linkend="forcing-options-through"/></para>
1414
1415

      <informaltable>
1416
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-optL</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the literate pre-processor</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-optP</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to cpp (with
	      <option>-cpp</option> only)</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
1439
1440
1441
1442
1443
1444
1445
	    <row>
	      <entry><option>-optF</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the
	      custom pre-processor</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
	    <row>
	      <entry><option>-optc</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the C compiler</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-opta</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the assembler</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-optl</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the linker</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-optdll</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the DLL generator</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-optdep</option> <replaceable>option</replaceable></entry>
	      <entry>pass <replaceable>option</replaceable> to the dependency generator</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1482
      <title>Platform-specific options</title>
1483
      
1484
1485
      <para><xref linkend="options-platform"/></para>

1486
      <informaltable>
1487
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-mv8</option></entry>
	      <entry>(SPARC only) enable version 8 support</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-monly-[32]-regs</option></entry>
	      <entry>(x86 only) give some registers back to the C compiler</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

apt's avatar
apt committed
1514
1515
         
    <sect2>
1516
1517
1518
      <title>External core file options</title>

      <para><xref linkend="ext-core"/></para>
apt's avatar
apt committed
1519
1520

      <informaltable>
1521
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
apt's avatar
apt committed
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-fext-core</option></entry>
	      <entry>Generate <filename>.hcr</filename> external Core files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
	

1543
    <sect2>
1544
1545
1546
      <title>Compiler debugging options</title>

      <para><xref linkend="options-debugging"/></para>
1547
1548

      <informaltable>
1549
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-dcore-lint</option></entry>
	      <entry>Turn on internal sanity checking</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-absC</option></entry>
	      <entry>Dump abstract C</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-asm</option></entry>
	      <entry>Dump assembly</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-bcos</option></entry>
	      <entry>Dump interpreter byte code</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-cpranal</option></entry>
	      <entry>Dump output from CPR analysis</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-cse</option></entry>
	      <entry>Dump CSE output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-deriv</option></entry>
	      <entry>Dump deriving output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-ds</option></entry>
	      <entry>Dump desugarer output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-flatC</option></entry>
	      <entry>Dump &ldquo;flat&rdquo; C</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-foreign</option></entry>
1615
	      <entry>Dump <literal>foreign export</literal> stubs</entry>
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-inlinings</option></entry>
	      <entry>Dump inlining info</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-occur-anal</option></entry>
	      <entry>Dump occurrence analysis output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-parsed</option></entry>
	      <entry>Dump parse tree</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-realC</option></entry>
	      <entry>Dump &ldquo;real&rdquo; C</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-rn</option></entry>
	      <entry>Dump renamer output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-rules</option></entry>
	      <entry>Dump rules</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-sat</option></entry>
	      <entry>Dump saturated output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-simpl</option></entry>
	      <entry>Dump final simplifier output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-simpl-iterations</option></entry>
	      <entry>Dump output from each simplifier iteration</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-spec</option></entry>
	      <entry>Dump specialiser output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-stg</option></entry>
	      <entry>Dump final STG</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-stranal</option></entry>
	      <entry>Dump strictness analyser output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-tc</option></entry>
	      <entry>Dump typechecker output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-types</option></entry>
	      <entry>Dump type signatures</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-usagesp</option></entry>
	      <entry>Dump UsageSP analysis output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-worker-wrapper</option></entry>
	      <entry>Dump worker-wrapper output</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-rn-trace</option></entry>
	      <entry>Trace renamer</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-rn-stats</option></entry>
	      <entry>Renamer stats</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-stix</option></entry>
	      <entry>Native code generator intermediate form</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-simpl-stats</option></entry>
	      <entry>Dump simplifier stats</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dppr-debug</option></entry>
	      <entry>Turn on debug printing (more verbose)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dppr-noprags</option></entry>
	      <entry>Don't output pragma info in dumps</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dppr-user-length</option></entry>
	      <entry>Set the depth for printing expressions in error msgs</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dsource-stats</option></entry>
	      <entry>Dump haskell source stats</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dstg-lint</option></entry>
	      <entry>STG pass sanity checking</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dstg-stats</option></entry>
	      <entry>Dump STG stats</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dusagesp-lint</option></entry>
	      <entry>UsageSP sanity checker</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dverbose-core2core</option></entry>
	      <entry>Show output from each core-to-core pass</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dverbose-stg2stg</option></entry>
	      <entry>Show output from each STG-to-STG pass</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
1793
1794
1795
1796
1797
1798
	    <row>
	      <entry><option>-unreg</option></entry>
	      <entry>Enable unregisterised compilation</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
1799
1800
1801
1802
1803
1804
1805
1806
1807
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
      
    <sect2>
      <title>Misc compiler options</title>

      <informaltable>
1808
	<tgroup cols="3" align="left" colsep="1" rowsep="1">
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-femit-extern-decls</option></entry>
	      <entry>???</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fglobalise-toplev-names</option></entry>
	      <entry>Make all top-level names global (for <option>-split-objs</option>)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fno-hi-version-check</option></entry>
	      <entry>Don't complain about <literal>.hi</literal> file mismatches</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-dno-black-holing</option></entry>
	      <entry>Turn off black holing (probably doesn't work)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fno-method-sharing</option></entry>
chak's avatar
chak committed
1844
	      <entry>Don't share specialisations of overloaded functions</entry>
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fno-prune-decls</option></entry>
	      <entry>Renamer: don't prune declarations</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fhistory-size</option></entry>
	      <entry>Set simplification history size</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-funregisterised</option></entry>
	      <entry>Unregisterised compilation (use <option>-unreg</option> instead)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fno-asm-mangling</option></entry>
	      <entry>Turn off assembly mangling (use <option>-unreg</option> instead)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
  </sect1>


<!--
Still to document:

Misc:
  ,  ( "H"                 , HasArg (setHeapSize . fromIntegral . decodeSize) )
  ,  ( "Rghc-timing"	   , NoArg  (enableTimingStats) )

1886
  -Bdir
1887
1888
1889
1890
-->

<!-- Emacs stuff:
     ;;; Local Variables: ***
1891
1892
     ;;; mode: xml ***
     ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
1893
1894
     ;;; End: ***
 -->