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
143 Warn from speculative compiles such as __traits(compiles).
146 D Var(warn_unknown_pragmas) LangEnabledBy(D, Wextra)
159 -Xf <file> Write JSON output to the given <file>.
163 Debug library to use instead of phobos.
167 Default library to use instead of phobos.
171 Do link the standard D startup files in the compilation.
178 Generate code for all template instantiations.
182 Generate code for assert contracts.
186 ; Documented in common.opt
189 D Joined RejectNegative Enum(bounds_check) Var(flag_bounds_check)
190 -fbounds-check=[on|safeonly|off] Turn array bounds checks on, in @safe code only, or off.
193 Name(bounds_check) Type(int) UnknownError(unknown array bounds setting %qs)
196 Enum(bounds_check) String(off) Value(0)
199 Enum(bounds_check) String(safeonly) Value(1)
202 Enum(bounds_check) String(on) Value(2)
204 ; Generates a secondary ModuleInfo symbol for linking in unittests
205 fbuilding-libphobos-tests
206 D Undocumented Var(flag_building_libphobos_tests)
209 D Var(flag_no_builtin, 0)
216 D Alias(fbounds-check)
219 D Alias(fpreconditions)
225 D Alias(fpostconditions)
228 D Alias(fswitch-errors)
231 D Joined RejectNegative Enum(check_action) Var(flag_check_action)
232 -fcheckaction=[throw,halt,context] Behavior on contract failure.
235 Name(check_action) Type(int) UnknownError(unknown checkaction setting %qs)
238 Enum(check_action) String(throw) Value(0)
241 Enum(check_action) String(halt) Value(1)
244 Enum(check_action) String(context) Value(2)
248 Compile in debug code.
251 D Joined RejectNegative
252 -fdebug=<ident> Compile in debug code identified by <ident>.
256 Generate documentation.
259 D Joined RejectNegative
260 -fdoc-dir=<dir> Write documentation file to directory <dir>.
263 D Joined RejectNegative
264 -fdoc-file=<file> Write documentation to <file>.
267 D Joined RejectNegative
268 -fdoc-inc=<file> Include a Ddoc macro <file>.
272 Assume that standard D runtime libraries and \"D main\" exist.
274 fdump-c++-spec-verbose
276 Add comments for ignored declarations in the generated C++ header.
279 D RejectNegative Joined
280 -fdump-cxx-spec=<filename> Write all declarations as C++ code to <filename>.
284 Display the frontend AST after parsing and semantic passes.
287 D Joined RejectNegative Enum(extern_stdcpp) Var(flag_extern_stdcpp)
288 -fextern-std=<standard> Set C++ name mangling compatibility with <standard>.
291 Name(extern_stdcpp) Type(int) UnknownError(unknown C++ standard %qs)
294 Enum(extern_stdcpp) String(c++98) Value(199711)
297 Enum(extern_stdcpp) String(c++03) Value(199711)
300 Enum(extern_stdcpp) String(c++11) Value(201103)
303 Enum(extern_stdcpp) String(c++14) Value(201402)
306 Enum(extern_stdcpp) String(c++17) Value(201703)
309 Enum(extern_stdcpp) String(c++20) Value(202002)
311 fignore-unknown-pragmas
313 Ignore unsupported pragmas.
316 D Var(flag_invariants)
317 Generate code for class invariant contracts.
321 Generate a default D main() function when compiling.
324 D Joined RejectNegative
325 -fmodule-file=<package.module>=<filespec> use <filespec> as source file for <package.module>.
328 D Var(flag_moduleinfo)
329 Generate ModuleInfo struct for output module.
332 D Joined RejectNegative
333 Process all modules specified on the command line, but only generate code for the module specified by the argument.
336 D Var(flag_postconditions)
337 Generate code for postcondition contracts.
340 D Var(flag_preconditions)
341 Generate code for precondition contracts.
345 Turn on all upcoming D language features.
349 Implement D bit-fields.
353 Implement DIP1000: Scoped pointers.
357 Implement DIP1008: Allow exceptions in @nogc code.
361 Implement DIP1021: Mutable function arguments.
365 Destruct fields of partially constructed objects.
369 Use field-wise comparisons for struct equality.
371 fpreview=fixaliasthis
373 When a symbol is resolved, check `alias this' scope before going to upper scopes.
375 fpreview=fiximmutableconv
377 Disallow unsound immutable conversions that were formerly incorrectly permitted.
381 Implement 'in' parameters to mean scope const.
383 fpreview=inclusiveincontracts
385 Implement 'in' contracts of overridden methods to be a superset of parent contract.
387 fpreview=nosharedaccess
389 Disable access to shared memory objects.
391 fpreview=rvaluerefparam
393 Enable rvalue arguments to ref parameters.
395 fpreview=systemvariables
397 Disable access to variables marked `@system' from @safe code.
401 Compile release version.
405 Turn off all revertable D language features.
409 Revert DIP1000: Scoped pointers.
413 Don't destruct fields of partially constructed objects.
417 Don't use C-style integral promotion for unary '+', '-' and '~'.
424 D Joined RejectNegative
425 -fsave-mixins=<filename> Expand and save mixins to file specified by <filename>.
428 D Var(flag_switch_errors)
429 Generate code for switches without a default case.
433 List information on all D language transitions.
437 List all non-mutable fields which occupy an object instance.
441 List all usages of 'in' on parameter.
445 List all hidden GC allocations.
447 ftransition=templates
449 List statistics on template instantiations.
453 List all variables going into thread local storage.
457 Compile in unittest code.
460 D Joined RejectNegative
461 -fversion=<ident> Compile in version code identified by <ident>.
464 D Var(flag_weak_templates) Init(1)
465 Emit template instantiations as weak symbols.
485 Do not link the standard D library in the compilation.
493 Link the standard D library statically in the compilation.
497 Link the standard D library dynamically in the compilation.