xref: /netbsd-src/external/gpl3/gcc/dist/gcc/d/lang.opt (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1; lang.opt -- Options for the D front end.
2; Copyright (C) 2006-2022 Free Software Foundation, Inc.
3;
4; GCC is free software; you can redistribute it and/or modify it under
5; the terms of the GNU General Public License as published by the Free
6; Software Foundation; either version 3, or (at your option) any later
7; version.
8;
9; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
10; WARRANTY; without even the implied warranty of MERCHANTABILITY or
11; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12; for more details.
13;
14; You should have received a copy of the GNU General Public License
15; along with GCC; see the file COPYING3.  If not see
16; <http://www.gnu.org/licenses/>.
17
18; See the GCC internals manual for a description of this file's format.
19
20; Please try to keep this file in ASCII collating order.
21
22Language
23D
24
25-dependencies
26D Alias(M)
27; Documented in C
28
29-print-missing-file-dependencies
30D Alias(MG)
31; Documented in C
32
33-user-dependencies
34D Alias(MM)
35; Documented in C
36
37-write-dependencies
38D NoDriverArg Separate Alias(MD)
39; Documented in C
40
41-write-user-dependencies
42D NoDriverArg Separate Alias(MMD)
43; Documented in C
44
45H
46D
47; Different from documented use in C.
48
49Hd
50D Joined Separate
51-Hd <dir>	Write D interface files to directory <dir>.
52
53Hf
54D Joined Separate
55-Hf <file>	Write D interface to <file>.
56
57I
58D Joined Separate
59; Documented in C
60
61J
62D Joined Separate
63; Different from documented use in Fortran.
64
65M
66D
67; Documented in C
68
69MD
70D Separate NoDriverArg
71; Documented in C
72
73MF
74D Joined Separate
75; Documented in C
76
77MG
78D
79; Documented in C
80
81MM
82D
83; Documented in C
84
85MMD
86D Separate NoDriverArg
87; Documented in C
88
89MP
90D
91; Documented in C
92
93MT
94D Joined Separate
95; Documented in C
96
97MQ
98D Joined Separate
99; Documented in C
100
101Waddress
102D Warning Var(warn_address) LangEnabledBy(D, Wextra)
103; Documented in C
104
105Wall
106D
107; Documented in C
108
109Walloca
110D
111; Documented in C
112
113Walloca-larger-than=
114D
115; Documented in C
116
117Wno-alloca-larger-than
118D
119; Documented in C
120
121Wcast-result
122D Warning Var(warn_cast_result) LangEnabledBy(D, Wextra)
123Warn about casts that will produce a null result.
124
125Wdeprecated
126D
127; Documented in common.opt
128
129Werror
130D
131; Documented in common.opt
132
133Wpsabi
134D
135; Documented in C
136
137Wspeculative
138D
139Warn from speculative compiles such as __traits(compiles).
140
141Wunknown-pragmas
142D Var(warn_unknown_pragmas) LangEnabledBy(D, Wextra)
143; Documented in C
144
145Wvarargs
146D
147; Documented in C
148
149X
150D
151Generate JSON file.
152
153Xf
154D Joined Separate
155-Xf <file>	Write JSON output to the given <file>.
156
157debuglib=
158Driver Joined
159Debug library to use instead of phobos.
160
161defaultlib=
162Driver Joined
163Default library to use instead of phobos.
164
165dstartfiles
166Driver
167Do link the standard D startup files in the compilation.
168
169-verbose
170D Alias(v)
171
172fall-instantiations
173D
174Generate code for all template instantiations.
175
176fassert
177D Var(flag_assert)
178Generate code for assert contracts.
179
180fbounds-check
181D
182; Documented in common.opt
183
184fbounds-check=
185D Joined RejectNegative Enum(bounds_check) Var(flag_bounds_check)
186-fbounds-check=[on|safeonly|off]	Turn array bounds checks on, in @safe code only, or off.
187
188Enum
189Name(bounds_check) Type(int) UnknownError(unknown array bounds setting %qs)
190
191EnumValue
192Enum(bounds_check) String(off) Value(0)
193
194EnumValue
195Enum(bounds_check) String(safeonly) Value(1)
196
197EnumValue
198Enum(bounds_check) String(on) Value(2)
199
200; Generates a secondary ModuleInfo symbol for linking in unittests
201fbuilding-libphobos-tests
202D Undocumented Var(flag_building_libphobos_tests)
203
204fbuiltin
205D Var(flag_no_builtin, 0)
206; Documented in C
207
208fcheck=assert
209D Alias(fassert)
210
211fcheck=bounds
212D Alias(fbounds-check)
213
214fcheck=in
215D Alias(fpreconditions)
216
217fcheck=invariant
218D Alias(finvariants)
219
220fcheck=out
221D Alias(fpostconditions)
222
223fcheck=switch
224D Alias(fswitch-errors)
225
226fcheckaction=
227D Joined RejectNegative Enum(check_action) Var(flag_check_action)
228-fcheckaction=[throw,halt,context]	Behavior on contract failure.
229
230Enum
231Name(check_action) Type(int) UnknownError(unknown checkaction setting %qs)
232
233EnumValue
234Enum(check_action) String(throw) Value(0)
235
236EnumValue
237Enum(check_action) String(halt) Value(1)
238
239EnumValue
240Enum(check_action) String(context) Value(2)
241
242fdebug
243D
244Compile in debug code.
245
246fdebug=
247D Joined RejectNegative
248-fdebug=<level|ident>	Compile in debug code, code <= <level>, or code identified by <ident>.
249
250fdoc
251D
252Generate documentation.
253
254fdoc-dir=
255D Joined RejectNegative
256-fdoc-dir=<dir>	Write documentation file to directory <dir>.
257
258fdoc-file=
259D Joined RejectNegative
260-fdoc-file=<file>	Write documentation to <file>.
261
262fdoc-inc=
263D Joined RejectNegative
264-fdoc-inc=<file>	Include a Ddoc macro <file>.
265
266fdruntime
267D
268Assume that standard D runtime libraries and \"D main\" exist.
269
270fdump-c++-spec-verbose
271D RejectNegative
272Add comments for ignored declarations in the generated C++ header.
273
274fdump-c++-spec=
275D RejectNegative Joined
276-fdump-cxx-spec=<filename>	Write all declarations as C++ code to <filename>.
277
278fdump-d-original
279D
280Display the frontend AST after parsing and semantic passes.
281
282fextern-std=
283D Joined RejectNegative Enum(extern_stdcpp) Var(flag_extern_stdcpp)
284-fextern-std=<standard>	Set C++ name mangling compatibility with <standard>.
285
286Enum
287Name(extern_stdcpp) Type(int) UnknownError(unknown C++ standard %qs)
288
289EnumValue
290Enum(extern_stdcpp) String(c++98) Value(199711)
291
292EnumValue
293Enum(extern_stdcpp) String(c++03) Value(199711)
294
295EnumValue
296Enum(extern_stdcpp) String(c++11) Value(201103)
297
298EnumValue
299Enum(extern_stdcpp) String(c++14) Value(201402)
300
301EnumValue
302Enum(extern_stdcpp) String(c++17) Value(201703)
303
304EnumValue
305Enum(extern_stdcpp) String(c++20) Value(202002)
306
307fignore-unknown-pragmas
308D
309Ignore unsupported pragmas.
310
311finvariants
312D Var(flag_invariants)
313Generate code for class invariant contracts.
314
315fmain
316D RejectNegative
317Generate a default D main() function when compiling.
318
319fmodule-file=
320D Joined RejectNegative
321-fmodule-file=<package.module>=<filespec>	use <filespec> as source file for <package.module>.
322
323fmoduleinfo
324D Var(flag_moduleinfo)
325Generate ModuleInfo struct for output module.
326
327fonly=
328D Joined RejectNegative
329Process all modules specified on the command line, but only generate code for the module specified by the argument.
330
331fpostconditions
332D Var(flag_postconditions)
333Generate code for postcondition contracts.
334
335fpreconditions
336D Var(flag_preconditions)
337Generate code for precondition contracts.
338
339fpreview=all
340D RejectNegative
341Turn on all upcoming D language features.
342
343fpreview=dip1000
344D RejectNegative
345Implement DIP1000: Scoped pointers.
346
347fpreview=dip1008
348D RejectNegative
349Implement DIP1008: Allow exceptions in @nogc code.
350
351fpreview=dip1021
352D RejectNegative
353Implement DIP1021: Mutable function arguments.
354
355fpreview=dip25
356D RejectNegative
357Implement DIP25: Sealed references.
358
359fpreview=dtorfields
360D RejectNegative
361Destruct fields of partially constructed objects.
362
363fpreview=fieldwise
364D RejectNegative
365Use field-wise comparisons for struct equality.
366
367fpreview=fixaliasthis
368D RejectNegative
369When a symbol is resolved, check `alias this' scope before going to upper scopes.
370
371fpreview=in
372D RejectNegative
373Implement 'in' parameters to mean scope const.
374
375fpreview=inclusiveincontracts
376D RejectNegative
377Implement 'in' contracts of overridden methods to be a superset of parent contract.
378
379fpreview=nosharedaccess
380D RejectNegative
381Disable access to shared memory objects.
382
383fpreview=rvaluerefparam
384D RejectNegative
385Enable rvalue arguments to ref parameters.
386
387fpreview=shortenedmethods
388D RejectNegative
389Allow use of '=>' for methods and top-level functions in addition to lambdas.
390
391frelease
392D
393Compile release version.
394
395frevert=all
396D RejectNegative
397Turn off all revertable D language features.
398
399frevert=dip1000
400D RejectNegative
401Revert DIP1000: Scoped pointers.
402
403frevert=dip25
404D RejectNegative
405Revert DIP25: Sealed references.
406
407frevert=dtorfields
408D RejectNegative
409Don't destruct fields of partially constructed objects.
410
411frevert=intpromote
412D RejectNegative
413Use C-style integral promotion for unary '+', '-' and '~'.
414
415frevert=markdown
416D RejectNegative
417Disable Markdown replacements in Ddoc.
418
419frtti
420D
421; Documented in C
422
423fsave-mixins=
424D Joined RejectNegative
425-fsave-mixins=<filename>	Expand and save mixins to file specified by <filename>.
426
427fswitch-errors
428D Var(flag_switch_errors)
429Generate code for switches without a default case.
430
431ftransition=all
432D RejectNegative
433List information on all D language transitions.
434
435ftransition=field
436D RejectNegative
437List all non-mutable fields which occupy an object instance.
438
439ftransition=in
440D RejectNegative
441List all usages of 'in' on parameter.
442
443ftransition=nogc
444D RejectNegative
445List all hidden GC allocations.
446
447ftransition=templates
448D RejectNegative
449List statistics on template instantiations.
450
451ftransition=tls
452D RejectNegative
453List all variables going into thread local storage.
454
455ftransition=vmarkdown
456D RejectNegative
457List instances of Markdown replacements in Ddoc.
458
459funittest
460D
461Compile in unittest code.
462
463fversion=
464D Joined RejectNegative
465-fversion=<level|ident>	Compile in version code >= <level> or identified by <ident>.
466
467fweak-templates
468D Var(flag_weak_templates) Init(1)
469Emit template instantiations as weak symbols.
470
471imultilib
472D Joined Separate
473; Documented in C
474
475iprefix
476D Joined Separate
477; Documented in C
478
479isysroot
480D Joined Separate
481; Documented in C
482
483isystem
484D Joined Separate
485; Documented in C
486
487nophoboslib
488Driver
489Do not link the standard D library in the compilation.
490
491nostdinc
492D
493; Documented in C
494
495static-libphobos
496Driver
497Link the standard D library statically in the compilation.
498
499shared-libphobos
500Driver
501Link the standard D library dynamically in the compilation.
502
503v
504D
505; Documented in C
506