1 ; lang.opt -- Options for the D front end.
2 ; Copyright (C) 2006-2023 Free Software Foundation, Inc.
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
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
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/>.
18 ; See the GCC internals manual for a description of this file's format.
20 ; Please try to keep this file in ASCII collating order.
29 -print-missing-file-dependencies
38 D NoDriverArg Separate Alias(MD)
41 -write-user-dependencies
42 D NoDriverArg Separate Alias(MMD)
47 ; Different from documented use in C.
51 -Hd <dir> Write D interface files to directory <dir>.
55 -Hf <file> Write D interface to <file>.
63 ; Different from documented use in Fortran.
70 D Separate NoDriverArg
86 D Separate NoDriverArg
102 D Warning Var(warn_address) LangEnabledBy(D, Wextra)
117 Wno-alloca-larger-than
121 Wbuiltin-declaration-mismatch
126 D Warning Var(warn_cast_result) LangEnabledBy(D, Wextra)
127 Warn about casts that will produce a null result.
131 ; Documented in common.opt
135 ; Documented in common.opt
139 ; Documented in common.opt
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.
151 Warn from speculative compiles such as __traits(compiles).
154 D Var(warn_unknown_pragmas) LangEnabledBy(D, Wextra)
167 -Xf <file> Write JSON output to the given <file>.
171 Debug library to use instead of phobos.
175 Default library to use instead of phobos.
179 Do link the standard D startup files in the compilation.
186 Generate code for all template instantiations.
190 Generate code for assert contracts.
194 ; Documented in common.opt
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.
201 Name(bounds_check) Type(int) UnknownError(unknown array bounds setting %qs)
204 Enum(bounds_check) String(off) Value(0)
207 Enum(bounds_check) String(safeonly) Value(1)
210 Enum(bounds_check) String(on) Value(2)
212 ; Generates a secondary ModuleInfo symbol for linking in unittests
213 fbuilding-libphobos-tests
214 D Undocumented Var(flag_building_libphobos_tests)
217 D Var(flag_no_builtin, 0)
224 D Alias(fbounds-check)
227 D Alias(fpreconditions)
233 D Alias(fpostconditions)
236 D Alias(fswitch-errors)
239 D Joined RejectNegative Enum(check_action) Var(flag_check_action)
240 -fcheckaction=[throw,halt,context] Behavior on contract failure.
243 Name(check_action) Type(int) UnknownError(unknown checkaction setting %qs)
246 Enum(check_action) String(throw) Value(0)
249 Enum(check_action) String(halt) Value(1)
252 Enum(check_action) String(context) Value(2)
256 Compile in debug code.
259 D Joined RejectNegative
260 -fdebug=<ident> Compile in debug code identified by <ident>.
264 Generate documentation.
267 D Joined RejectNegative
268 -fdoc-dir=<dir> Write documentation file to directory <dir>.
271 D Joined RejectNegative
272 -fdoc-file=<file> Write documentation to <file>.
275 D Joined RejectNegative
276 -fdoc-inc=<file> Include a Ddoc macro <file>.
280 Assume that standard D runtime libraries and \"D main\" exist.
282 fdump-c++-spec-verbose
284 Add comments for ignored declarations in the generated C++ header.
287 D RejectNegative Joined
288 -fdump-cxx-spec=<filename> Write all declarations as C++ code to <filename>.
292 Display the frontend AST after parsing and semantic passes.
296 ; Documented in common.opt
299 D Joined RejectNegative Enum(extern_stdcpp) Var(flag_extern_stdcpp)
300 -fextern-std=<standard> Set C++ name mangling compatibility with <standard>.
303 Name(extern_stdcpp) Type(int) UnknownError(unknown C++ standard %qs)
306 Enum(extern_stdcpp) String(c++98) Value(199711)
309 Enum(extern_stdcpp) String(c++03) Value(199711)
312 Enum(extern_stdcpp) String(c++11) Value(201103)
315 Enum(extern_stdcpp) String(c++14) Value(201402)
318 Enum(extern_stdcpp) String(c++17) Value(201703)
321 Enum(extern_stdcpp) String(c++20) Value(202002)
323 fignore-unknown-pragmas
325 Ignore unsupported pragmas.
328 D Var(flag_invariants)
329 Generate code for class invariant contracts.
333 Generate a default D main() function when compiling.
336 D Joined RejectNegative
337 -fmodule-file=<package.module>=<filespec> use <filespec> as source file for <package.module>.
340 D Var(flag_moduleinfo)
341 Generate ModuleInfo struct for output module.
344 D Joined RejectNegative
345 Process all modules specified on the command line, but only generate code for the module specified by the argument.
348 D Var(flag_postconditions)
349 Generate code for postcondition contracts.
352 D Var(flag_preconditions)
353 Generate code for precondition contracts.
357 Turn on all upcoming D language features.
361 Implement D bit-fields.
365 Implement DIP1000: Scoped pointers.
369 Implement DIP1008: Allow exceptions in @nogc code.
373 Implement DIP1021: Mutable function arguments.
377 Destruct fields of partially constructed objects.
381 Use field-wise comparisons for struct equality.
383 fpreview=fixaliasthis
385 When a symbol is resolved, check `alias this' scope before going to upper scopes.
387 fpreview=fiximmutableconv
389 Disallow unsound immutable conversions that were formerly incorrectly permitted.
393 Implement 'in' parameters to mean scope const.
395 fpreview=inclusiveincontracts
397 Implement 'in' contracts of overridden methods to be a superset of parent contract.
399 fpreview=nosharedaccess
401 Disable access to shared memory objects.
403 fpreview=rvaluerefparam
405 Enable rvalue arguments to ref parameters.
407 fpreview=systemvariables
409 Disable access to variables marked `@system' from @safe code.
413 Compile release version.
417 Turn off all revertable D language features.
421 Revert DIP1000: Scoped pointers.
425 Don't destruct fields of partially constructed objects.
429 Don't use C-style integral promotion for unary '+', '-' and '~'.
436 D Joined RejectNegative
437 -fsave-mixins=<filename> Expand and save mixins to file specified by <filename>.
440 D Var(flag_switch_errors)
441 Generate code for switches without a default case.
445 List information on all D language transitions.
449 List all non-mutable fields which occupy an object instance.
453 List all usages of 'in' on parameter.
457 List all hidden GC allocations.
459 ftransition=templates
461 List statistics on template instantiations.
465 List all variables going into thread local storage.
469 Compile in unittest code.
472 D Joined RejectNegative
473 -fversion=<ident> Compile in version code identified by <ident>.
476 D Var(flag_weak_templates) Init(1)
477 Emit template instantiations as weak symbols.
497 Do not link the standard D library in the compilation.
505 Link the standard D library statically in the compilation.
509 Link the standard D library dynamically in the compilation.