Debian Codegraph @

gcc/d/lang.opt

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