1*8feb0f0bSmrg@c Copyright (C) 2003-2020 Free Software Foundation, Inc. 21debfc3dSmrg@c This is part of the GCC manual. 31debfc3dSmrg@c For copying conditions, see the file gcc.texi. 41debfc3dSmrg 51debfc3dSmrg@node Options 61debfc3dSmrg@chapter Option specification files 71debfc3dSmrg@cindex option specification files 81debfc3dSmrg@cindex @samp{optc-gen.awk} 91debfc3dSmrg 101debfc3dSmrgMost GCC command-line options are described by special option 111debfc3dSmrgdefinition files, the names of which conventionally end in 121debfc3dSmrg@code{.opt}. This chapter describes the format of these files. 131debfc3dSmrg 141debfc3dSmrg@menu 151debfc3dSmrg* Option file format:: The general layout of the files 161debfc3dSmrg* Option properties:: Supported option properties 171debfc3dSmrg@end menu 181debfc3dSmrg 191debfc3dSmrg@node Option file format 201debfc3dSmrg@section Option file format 211debfc3dSmrg 221debfc3dSmrgOption files are a simple list of records in which each field occupies 231debfc3dSmrgits own line and in which the records themselves are separated by 241debfc3dSmrgblank lines. Comments may appear on their own line anywhere within 251debfc3dSmrgthe file and are preceded by semicolons. Whitespace is allowed before 261debfc3dSmrgthe semicolon. 271debfc3dSmrg 281debfc3dSmrgThe files can contain the following types of record: 291debfc3dSmrg 301debfc3dSmrg@itemize @bullet 311debfc3dSmrg@item 321debfc3dSmrgA language definition record. These records have two fields: the 331debfc3dSmrgstring @samp{Language} and the name of the language. Once a language 341debfc3dSmrghas been declared in this way, it can be used as an option property. 351debfc3dSmrg@xref{Option properties}. 361debfc3dSmrg 371debfc3dSmrg@item 381debfc3dSmrgA target specific save record to save additional information. These 391debfc3dSmrgrecords have two fields: the string @samp{TargetSave}, and a 401debfc3dSmrgdeclaration type to go in the @code{cl_target_option} structure. 411debfc3dSmrg 421debfc3dSmrg@item 431debfc3dSmrgA variable record to define a variable used to store option 441debfc3dSmrginformation. These records have two fields: the string 451debfc3dSmrg@samp{Variable}, and a declaration of the type and name of the 461debfc3dSmrgvariable, optionally with an initializer (but without any trailing 471debfc3dSmrg@samp{;}). These records may be used for variables used for many 481debfc3dSmrgoptions where declaring the initializer in a single option definition 491debfc3dSmrgrecord, or duplicating it in many records, would be inappropriate, or 501debfc3dSmrgfor variables set in option handlers rather than referenced by 511debfc3dSmrg@code{Var} properties. 521debfc3dSmrg 531debfc3dSmrg@item 541debfc3dSmrgA variable record to define a variable used to store option 551debfc3dSmrginformation. These records have two fields: the string 561debfc3dSmrg@samp{TargetVariable}, and a declaration of the type and name of the 571debfc3dSmrgvariable, optionally with an initializer (but without any trailing 581debfc3dSmrg@samp{;}). @samp{TargetVariable} is a combination of @samp{Variable} 591debfc3dSmrgand @samp{TargetSave} records in that the variable is defined in the 601debfc3dSmrg@code{gcc_options} structure, but these variables are also stored in 611debfc3dSmrgthe @code{cl_target_option} structure. The variables are saved in the 621debfc3dSmrgtarget save code and restored in the target restore code. 631debfc3dSmrg 641debfc3dSmrg@item 651debfc3dSmrgA variable record to record any additional files that the 661debfc3dSmrg@file{options.h} file should include. This is useful to provide 671debfc3dSmrgenumeration or structure definitions needed for target variables. 681debfc3dSmrgThese records have two fields: the string @samp{HeaderInclude} and the 691debfc3dSmrgname of the include file. 701debfc3dSmrg 711debfc3dSmrg@item 721debfc3dSmrgA variable record to record any additional files that the 731debfc3dSmrg@file{options.c} or @file{options-save.c} file should include. This 741debfc3dSmrgis useful to provide 751debfc3dSmrginline functions needed for target variables and/or @code{#ifdef} 761debfc3dSmrgsequences to properly set up the initialization. These records have 771debfc3dSmrgtwo fields: the string @samp{SourceInclude} and the name of the 781debfc3dSmrginclude file. 791debfc3dSmrg 801debfc3dSmrg@item 811debfc3dSmrgAn enumeration record to define a set of strings that may be used as 821debfc3dSmrgarguments to an option or options. These records have three fields: 831debfc3dSmrgthe string @samp{Enum}, a space-separated list of properties and help 841debfc3dSmrgtext used to describe the set of strings in @option{--help} output. 851debfc3dSmrgProperties use the same format as option properties; the following are 861debfc3dSmrgvalid: 871debfc3dSmrg@table @code 881debfc3dSmrg@item Name(@var{name}) 891debfc3dSmrgThis property is required; @var{name} must be a name (suitable for use 901debfc3dSmrgin C identifiers) used to identify the set of strings in @code{Enum} 911debfc3dSmrgoption properties. 921debfc3dSmrg 931debfc3dSmrg@item Type(@var{type}) 941debfc3dSmrgThis property is required; @var{type} is the C type for variables set 951debfc3dSmrgby options using this enumeration together with @code{Var}. 961debfc3dSmrg 971debfc3dSmrg@item UnknownError(@var{message}) 981debfc3dSmrgThe message @var{message} will be used as an error message if the 991debfc3dSmrgargument is invalid; for enumerations without @code{UnknownError}, a 1001debfc3dSmrggeneric error message is used. @var{message} should contain a single 1011debfc3dSmrg@samp{%qs} format, which will be used to format the invalid argument. 1021debfc3dSmrg@end table 1031debfc3dSmrg 1041debfc3dSmrg@item 1051debfc3dSmrgAn enumeration value record to define one of the strings in a set 1061debfc3dSmrggiven in an @samp{Enum} record. These records have two fields: the 1071debfc3dSmrgstring @samp{EnumValue} and a space-separated list of properties. 1081debfc3dSmrgProperties use the same format as option properties; the following are 1091debfc3dSmrgvalid: 1101debfc3dSmrg@table @code 1111debfc3dSmrg@item Enum(@var{name}) 1121debfc3dSmrgThis property is required; @var{name} says which @samp{Enum} record 1131debfc3dSmrgthis @samp{EnumValue} record corresponds to. 1141debfc3dSmrg 1151debfc3dSmrg@item String(@var{string}) 1161debfc3dSmrgThis property is required; @var{string} is the string option argument 1171debfc3dSmrgbeing described by this record. 1181debfc3dSmrg 1191debfc3dSmrg@item Value(@var{value}) 1201debfc3dSmrgThis property is required; it says what value (representable as 1211debfc3dSmrg@code{int}) should be used for the given string. 1221debfc3dSmrg 1231debfc3dSmrg@item Canonical 1241debfc3dSmrgThis property is optional. If present, it says the present string is 1251debfc3dSmrgthe canonical one among all those with the given value. Other strings 1261debfc3dSmrgyielding that value will be mapped to this one so specs do not need to 1271debfc3dSmrghandle them. 1281debfc3dSmrg 1291debfc3dSmrg@item DriverOnly 1301debfc3dSmrgThis property is optional. If present, the present string will only 1311debfc3dSmrgbe accepted by the driver. This is used for cases such as 1321debfc3dSmrg@option{-march=native} that are processed by the driver so that 1331debfc3dSmrg@samp{gcc -v} shows how the options chosen depended on the system on 1341debfc3dSmrgwhich the compiler was run. 1351debfc3dSmrg@end table 1361debfc3dSmrg 1371debfc3dSmrg@item 1381debfc3dSmrgAn option definition record. These records have the following fields: 1391debfc3dSmrg@enumerate 1401debfc3dSmrg@item 1411debfc3dSmrgthe name of the option, with the leading ``-'' removed 1421debfc3dSmrg@item 1431debfc3dSmrga space-separated list of option properties (@pxref{Option properties}) 1441debfc3dSmrg@item 1451debfc3dSmrgthe help text to use for @option{--help} (omitted if the second field 1461debfc3dSmrgcontains the @code{Undocumented} property). 1471debfc3dSmrg@end enumerate 1481debfc3dSmrg 1491debfc3dSmrgBy default, all options beginning with ``f'', ``W'' or ``m'' are 1501debfc3dSmrgimplicitly assumed to take a ``no-'' form. This form should not be 1511debfc3dSmrglisted separately. If an option beginning with one of these letters 1521debfc3dSmrgdoes not have a ``no-'' form, you can use the @code{RejectNegative} 1531debfc3dSmrgproperty to reject it. 1541debfc3dSmrg 1551debfc3dSmrgThe help text is automatically line-wrapped before being displayed. 1561debfc3dSmrgNormally the name of the option is printed on the left-hand side of 1571debfc3dSmrgthe output and the help text is printed on the right. However, if the 1581debfc3dSmrghelp text contains a tab character, the text to the left of the tab is 1591debfc3dSmrgused instead of the option's name and the text to the right of the 1601debfc3dSmrgtab forms the help text. This allows you to elaborate on what type 1611debfc3dSmrgof argument the option takes. 1621debfc3dSmrg 1631debfc3dSmrg@item 1641debfc3dSmrgA target mask record. These records have one field of the form 1651debfc3dSmrg@samp{Mask(@var{x})}. The options-processing script will automatically 1661debfc3dSmrgallocate a bit in @code{target_flags} (@pxref{Run-time Target}) for 1671debfc3dSmrgeach mask name @var{x} and set the macro @code{MASK_@var{x}} to the 1681debfc3dSmrgappropriate bitmask. It will also declare a @code{TARGET_@var{x}} 1691debfc3dSmrgmacro that has the value 1 when bit @code{MASK_@var{x}} is set and 1701debfc3dSmrg0 otherwise. 1711debfc3dSmrg 1721debfc3dSmrgThey are primarily intended to declare target masks that are not 1731debfc3dSmrgassociated with user options, either because these masks represent 1741debfc3dSmrginternal switches or because the options are not available on all 1751debfc3dSmrgconfigurations and yet the masks always need to be defined. 1761debfc3dSmrg@end itemize 1771debfc3dSmrg 1781debfc3dSmrg@node Option properties 1791debfc3dSmrg@section Option properties 1801debfc3dSmrg 1811debfc3dSmrgThe second field of an option record can specify any of the following 1821debfc3dSmrgproperties. When an option takes an argument, it is enclosed in parentheses 1831debfc3dSmrgfollowing the option property name. The parser that handles option files 1841debfc3dSmrgis quite simplistic, and will be tricked by any nested parentheses within 1851debfc3dSmrgthe argument text itself; in this case, the entire option argument can 1861debfc3dSmrgbe wrapped in curly braces within the parentheses to demarcate it, e.g.: 1871debfc3dSmrg 1881debfc3dSmrg@smallexample 1891debfc3dSmrgCondition(@{defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS)@}) 1901debfc3dSmrg@end smallexample 1911debfc3dSmrg 1921debfc3dSmrg@table @code 1931debfc3dSmrg@item Common 1941debfc3dSmrgThe option is available for all languages and targets. 1951debfc3dSmrg 1961debfc3dSmrg@item Target 1971debfc3dSmrgThe option is available for all languages but is target-specific. 1981debfc3dSmrg 1991debfc3dSmrg@item Driver 2001debfc3dSmrgThe option is handled by the compiler driver using code not shared 2011debfc3dSmrgwith the compilers proper (@file{cc1} etc.). 2021debfc3dSmrg 2031debfc3dSmrg@item @var{language} 2041debfc3dSmrgThe option is available when compiling for the given language. 2051debfc3dSmrg 2061debfc3dSmrgIt is possible to specify several different languages for the same 2071debfc3dSmrgoption. Each @var{language} must have been declared by an earlier 2081debfc3dSmrg@code{Language} record. @xref{Option file format}. 2091debfc3dSmrg 2101debfc3dSmrg@item RejectDriver 2111debfc3dSmrgThe option is only handled by the compilers proper (@file{cc1} etc.)@: 2121debfc3dSmrgand should not be accepted by the driver. 2131debfc3dSmrg 2141debfc3dSmrg@item RejectNegative 2151debfc3dSmrgThe option does not have a ``no-'' form. All options beginning with 2161debfc3dSmrg``f'', ``W'' or ``m'' are assumed to have a ``no-'' form unless this 2171debfc3dSmrgproperty is used. 2181debfc3dSmrg 2191debfc3dSmrg@item Negative(@var{othername}) 2201debfc3dSmrgThe option will turn off another option @var{othername}, which is 2211debfc3dSmrgthe option name with the leading ``-'' removed. This chain action will 2221debfc3dSmrgpropagate through the @code{Negative} property of the option to be 223c0a68be4Smrgturned off. The driver will prune options, removing those that are 224c0a68be4Smrgturned off by some later option. This pruning is not done for options 225c0a68be4Smrgwith @code{Joined} or @code{JoinedOrMissing} properties, unless the 226c0a68be4Smrgoptions have either @code{RejectNegative} property or the @code{Negative} 227c0a68be4Smrgproperty mentions an option other than itself. 2281debfc3dSmrg 2291debfc3dSmrgAs a consequence, if you have a group of mutually-exclusive 2301debfc3dSmrgoptions, their @code{Negative} properties should form a circular chain. 2311debfc3dSmrgFor example, if options @option{-@var{a}}, @option{-@var{b}} and 2321debfc3dSmrg@option{-@var{c}} are mutually exclusive, their respective @code{Negative} 2331debfc3dSmrgproperties should be @samp{Negative(@var{b})}, @samp{Negative(@var{c})} 2341debfc3dSmrgand @samp{Negative(@var{a})}. 2351debfc3dSmrg 2361debfc3dSmrg@item Joined 2371debfc3dSmrg@itemx Separate 2381debfc3dSmrgThe option takes a mandatory argument. @code{Joined} indicates 2391debfc3dSmrgthat the option and argument can be included in the same @code{argv} 2401debfc3dSmrgentry (as with @code{-mflush-func=@var{name}}, for example). 2411debfc3dSmrg@code{Separate} indicates that the option and argument can be 2421debfc3dSmrgseparate @code{argv} entries (as with @code{-o}). An option is 2431debfc3dSmrgallowed to have both of these properties. 2441debfc3dSmrg 2451debfc3dSmrg@item JoinedOrMissing 2461debfc3dSmrgThe option takes an optional argument. If the argument is given, 2471debfc3dSmrgit will be part of the same @code{argv} entry as the option itself. 2481debfc3dSmrg 2491debfc3dSmrgThis property cannot be used alongside @code{Joined} or @code{Separate}. 2501debfc3dSmrg 2511debfc3dSmrg@item MissingArgError(@var{message}) 2521debfc3dSmrgFor an option marked @code{Joined} or @code{Separate}, the message 2531debfc3dSmrg@var{message} will be used as an error message if the mandatory 2541debfc3dSmrgargument is missing; for options without @code{MissingArgError}, a 2551debfc3dSmrggeneric error message is used. @var{message} should contain a single 2561debfc3dSmrg@samp{%qs} format, which will be used to format the name of the option 2571debfc3dSmrgpassed. 2581debfc3dSmrg 2591debfc3dSmrg@item Args(@var{n}) 2601debfc3dSmrgFor an option marked @code{Separate}, indicate that it takes @var{n} 2611debfc3dSmrgarguments. The default is 1. 2621debfc3dSmrg 2631debfc3dSmrg@item UInteger 264c0a68be4SmrgThe option's argument is a non-negative integer consisting of either 265c0a68be4Smrgdecimal or hexadecimal digits interpreted as @code{int}. Hexadecimal 266c0a68be4Smrgintegers may optionally start with the @code{0x} or @code{0X} prefix. 267c0a68be4SmrgThe option parser validates and converts the argument before passing 268c0a68be4Smrgit to the relevant option handler. @code{UInteger} should also be used 269c0a68be4Smrgwith options like @code{-falign-loops} where both @code{-falign-loops} 270c0a68be4Smrgand @code{-falign-loops}=@var{n} are supported to make sure the saved 271c0a68be4Smrgoptions are given a full integer. Positive values of the argument in 272c0a68be4Smrgexcess of @code{INT_MAX} wrap around zero. 273c0a68be4Smrg 274c0a68be4Smrg@item Host_Wide_Int 275c0a68be4SmrgThe option's argument is a non-negative integer consisting of either 276c0a68be4Smrgdecimal or hexadecimal digits interpreted as the widest integer type 277c0a68be4Smrgon the host. As with an @code{UInteger} argument, hexadecimal integers 278c0a68be4Smrgmay optionally start with the @code{0x} or @code{0X} prefix. The option 279c0a68be4Smrgparser validates and converts the argument before passing it to 280c0a68be4Smrgthe relevant option handler. @code{Host_Wide_Int} should be used with 281c0a68be4Smrgoptions that need to accept very large values. Positive values of 282c0a68be4Smrgthe argument in excess of @code{HOST_WIDE_INT_M1U} are assigned 283c0a68be4Smrg@code{HOST_WIDE_INT_M1U}. 284c0a68be4Smrg 285c0a68be4Smrg@item IntegerRange(@var{n}, @var{m}) 286c0a68be4SmrgThe options's arguments are integers of type @code{int}. The option's 287c0a68be4Smrgparser validates that the value of an option integer argument is within 288c0a68be4Smrgthe closed range [@var{n}, @var{m}]. 289c0a68be4Smrg 290c0a68be4Smrg@item ByteSize 291c0a68be4SmrgA property applicable only to @code{UInteger} or @code{Host_Wide_Int} 292c0a68be4Smrgarguments. The option's integer argument is interpreted as if in infinite 293c0a68be4Smrgprecision using saturation arithmetic in the corresponding type. The argument 294c0a68be4Smrgmay be followed by a @samp{byte-size} suffix designating a multiple of bytes 295c0a68be4Smrgsuch as @code{kB} and @code{KiB} for kilobyte and kibibyte, respectively, 296c0a68be4Smrg@code{MB} and @code{MiB} for megabyte and mebibyte, @code{GB} and @code{GiB} 297c0a68be4Smrgfor gigabyte and gigibyte, and so on. @code{ByteSize} should be used for 298c0a68be4Smrgwith options that take a very large argument representing a size in bytes, 299c0a68be4Smrgsuch as @option{-Wlarger-than=}. 3001debfc3dSmrg 3011debfc3dSmrg@item ToLower 3021debfc3dSmrgThe option's argument should be converted to lowercase as part of 3031debfc3dSmrgputting it in canonical form, and before comparing with the strings 3041debfc3dSmrgindicated by any @code{Enum} property. 3051debfc3dSmrg 3061debfc3dSmrg@item NoDriverArg 3071debfc3dSmrgFor an option marked @code{Separate}, the option only takes an 3081debfc3dSmrgargument in the compiler proper, not in the driver. This is for 3091debfc3dSmrgcompatibility with existing options that are used both directly and 3101debfc3dSmrgvia @option{-Wp,}; new options should not have this property. 3111debfc3dSmrg 3121debfc3dSmrg@item Var(@var{var}) 3131debfc3dSmrgThe state of this option should be stored in variable @var{var} 3141debfc3dSmrg(actually a macro for @code{global_options.x_@var{var}}). 3151debfc3dSmrgThe way that the state is stored depends on the type of option: 3161debfc3dSmrg 317*8feb0f0bSmrg@item WarnRemoved 318*8feb0f0bSmrgThe option is removed and every usage of such option will 319*8feb0f0bSmrgresult in a warning. We use it option backward compatibility. 320c0a68be4Smrg 321c0a68be4Smrg@item Var(@var{var}, @var{set}) 322c0a68be4SmrgThe option controls an integer variable @var{var} and is active when 323c0a68be4Smrg@var{var} equals @var{set}. The option parser will set @var{var} to 324c0a68be4Smrg@var{set} when the positive form of the option is used and @code{!@var{set}} 325c0a68be4Smrgwhen the ``no-'' form is used. 326c0a68be4Smrg 327c0a68be4Smrg@var{var} is declared in the same way as for the single-argument form 328c0a68be4Smrgdescribed above. 329c0a68be4Smrg 3301debfc3dSmrg@itemize @bullet 3311debfc3dSmrg@item 3321debfc3dSmrgIf the option uses the @code{Mask} or @code{InverseMask} properties, 3331debfc3dSmrg@var{var} is the integer variable that contains the mask. 3341debfc3dSmrg 3351debfc3dSmrg@item 3361debfc3dSmrgIf the option is a normal on/off switch, @var{var} is an integer 3371debfc3dSmrgvariable that is nonzero when the option is enabled. The options 3381debfc3dSmrgparser will set the variable to 1 when the positive form of the 3391debfc3dSmrgoption is used and 0 when the ``no-'' form is used. 3401debfc3dSmrg 3411debfc3dSmrg@item 3421debfc3dSmrgIf the option takes an argument and has the @code{UInteger} property, 3431debfc3dSmrg@var{var} is an integer variable that stores the value of the argument. 3441debfc3dSmrg 3451debfc3dSmrg@item 3461debfc3dSmrgIf the option takes an argument and has the @code{Enum} property, 3471debfc3dSmrg@var{var} is a variable (type given in the @code{Type} property of the 3481debfc3dSmrg@samp{Enum} record whose @code{Name} property has the same argument as 3491debfc3dSmrgthe @code{Enum} property of this option) that stores the value of the 3501debfc3dSmrgargument. 3511debfc3dSmrg 3521debfc3dSmrg@item 3531debfc3dSmrgIf the option has the @code{Defer} property, @var{var} is a pointer to 3541debfc3dSmrga @code{VEC(cl_deferred_option,heap)} that stores the option for later 3551debfc3dSmrgprocessing. (@var{var} is declared with type @code{void *} and needs 3561debfc3dSmrgto be cast to @code{VEC(cl_deferred_option,heap)} before use.) 3571debfc3dSmrg 3581debfc3dSmrg@item 3591debfc3dSmrgOtherwise, if the option takes an argument, @var{var} is a pointer to 3601debfc3dSmrgthe argument string. The pointer will be null if the argument is optional 3611debfc3dSmrgand wasn't given. 3621debfc3dSmrg@end itemize 3631debfc3dSmrg 3641debfc3dSmrgThe option-processing script will usually zero-initialize @var{var}. 3651debfc3dSmrgYou can modify this behavior using @code{Init}. 3661debfc3dSmrg 3671debfc3dSmrg@item Init(@var{value}) 3681debfc3dSmrgThe variable specified by the @code{Var} property should be statically 3691debfc3dSmrginitialized to @var{value}. If more than one option using the same 3701debfc3dSmrgvariable specifies @code{Init}, all must specify the same initializer. 3711debfc3dSmrg 3721debfc3dSmrg@item Mask(@var{name}) 3731debfc3dSmrgThe option is associated with a bit in the @code{target_flags} 3741debfc3dSmrgvariable (@pxref{Run-time Target}) and is active when that bit is set. 3751debfc3dSmrgYou may also specify @code{Var} to select a variable other than 3761debfc3dSmrg@code{target_flags}. 3771debfc3dSmrg 3781debfc3dSmrgThe options-processing script will automatically allocate a unique bit 3791debfc3dSmrgfor the option. If the option is attached to @samp{target_flags}, 3801debfc3dSmrgthe script will set the macro @code{MASK_@var{name}} to the appropriate 3811debfc3dSmrgbitmask. It will also declare a @code{TARGET_@var{name}} macro that has 3821debfc3dSmrgthe value 1 when the option is active and 0 otherwise. If you use @code{Var} 3831debfc3dSmrgto attach the option to a different variable, the bitmask macro with be 3841debfc3dSmrgcalled @code{OPTION_MASK_@var{name}}. 3851debfc3dSmrg 3861debfc3dSmrg@item InverseMask(@var{othername}) 3871debfc3dSmrg@itemx InverseMask(@var{othername}, @var{thisname}) 3881debfc3dSmrgThe option is the inverse of another option that has the 3891debfc3dSmrg@code{Mask(@var{othername})} property. If @var{thisname} is given, 3901debfc3dSmrgthe options-processing script will declare a @code{TARGET_@var{thisname}} 3911debfc3dSmrgmacro that is 1 when the option is active and 0 otherwise. 3921debfc3dSmrg 3931debfc3dSmrg@item Enum(@var{name}) 3941debfc3dSmrgThe option's argument is a string from the set of strings associated 3951debfc3dSmrgwith the corresponding @samp{Enum} record. The string is checked and 3961debfc3dSmrgconverted to the integer specified in the corresponding 3971debfc3dSmrg@samp{EnumValue} record before being passed to option handlers. 3981debfc3dSmrg 3991debfc3dSmrg@item Defer 4001debfc3dSmrgThe option should be stored in a vector, specified with @code{Var}, 4011debfc3dSmrgfor later processing. 4021debfc3dSmrg 4031debfc3dSmrg@item Alias(@var{opt}) 4041debfc3dSmrg@itemx Alias(@var{opt}, @var{arg}) 4051debfc3dSmrg@itemx Alias(@var{opt}, @var{posarg}, @var{negarg}) 4061debfc3dSmrgThe option is an alias for @option{-@var{opt}} (or the negative form 4071debfc3dSmrgof that option, depending on @code{NegativeAlias}). In the first form, 4081debfc3dSmrgany argument passed to the alias is considered to be passed to 4091debfc3dSmrg@option{-@var{opt}}, and @option{-@var{opt}} is considered to be 4101debfc3dSmrgnegated if the alias is used in negated form. In the second form, the 4111debfc3dSmrgalias may not be negated or have an argument, and @var{posarg} is 4121debfc3dSmrgconsidered to be passed as an argument to @option{-@var{opt}}. In the 4131debfc3dSmrgthird form, the alias may not have an argument, if the alias is used 4141debfc3dSmrgin the positive form then @var{posarg} is considered to be passed to 4151debfc3dSmrg@option{-@var{opt}}, and if the alias is used in the negative form 4161debfc3dSmrgthen @var{negarg} is considered to be passed to @option{-@var{opt}}. 4171debfc3dSmrg 4181debfc3dSmrgAliases should not specify @code{Var} or @code{Mask} or 4191debfc3dSmrg@code{UInteger}. Aliases should normally specify the same languages 4201debfc3dSmrgas the target of the alias; the flags on the target will be used to 4211debfc3dSmrgdetermine any diagnostic for use of an option for the wrong language, 4221debfc3dSmrgwhile those on the alias will be used to identify what command-line 4231debfc3dSmrgtext is the option and what text is any argument to that option. 4241debfc3dSmrg 4251debfc3dSmrgWhen an @code{Alias} definition is used for an option, driver specs do 4261debfc3dSmrgnot need to handle it and no @samp{OPT_} enumeration value is defined 4271debfc3dSmrgfor it; only the canonical form of the option will be seen in those 4281debfc3dSmrgplaces. 4291debfc3dSmrg 4301debfc3dSmrg@item NegativeAlias 4311debfc3dSmrgFor an option marked with @code{Alias(@var{opt})}, the option is 4321debfc3dSmrgconsidered to be an alias for the positive form of @option{-@var{opt}} 4331debfc3dSmrgif negated and for the negative form of @option{-@var{opt}} if not 4341debfc3dSmrgnegated. @code{NegativeAlias} may not be used with the forms of 4351debfc3dSmrg@code{Alias} taking more than one argument. 4361debfc3dSmrg 4371debfc3dSmrg@item Ignore 4381debfc3dSmrgThis option is ignored apart from printing any warning specified using 4391debfc3dSmrg@code{Warn}. The option will not be seen by specs and no @samp{OPT_} 4401debfc3dSmrgenumeration value is defined for it. 4411debfc3dSmrg 4421debfc3dSmrg@item SeparateAlias 4431debfc3dSmrgFor an option marked with @code{Joined}, @code{Separate} and 4441debfc3dSmrg@code{Alias}, the option only acts as an alias when passed a separate 4451debfc3dSmrgargument; with a joined argument it acts as a normal option, with an 4461debfc3dSmrg@samp{OPT_} enumeration value. This is for compatibility with the 4471debfc3dSmrgJava @option{-d} option and should not be used for new options. 4481debfc3dSmrg 4491debfc3dSmrg@item Warn(@var{message}) 4501debfc3dSmrgIf this option is used, output the warning @var{message}. 4511debfc3dSmrg@var{message} is a format string, either taking a single operand with 4521debfc3dSmrga @samp{%qs} format which is the option name, or not taking any 4531debfc3dSmrgoperands, which is passed to the @samp{warning} function. If an alias 4541debfc3dSmrgis marked @code{Warn}, the target of the alias must not also be marked 4551debfc3dSmrg@code{Warn}. 4561debfc3dSmrg 4571debfc3dSmrg@item Report 4581debfc3dSmrgThe state of the option should be printed by @option{-fverbose-asm}. 4591debfc3dSmrg 4601debfc3dSmrg@item Warning 4611debfc3dSmrgThis is a warning option and should be shown as such in 4621debfc3dSmrg@option{--help} output. This flag does not currently affect anything 4631debfc3dSmrgother than @option{--help}. 4641debfc3dSmrg 4651debfc3dSmrg@item Optimization 4661debfc3dSmrgThis is an optimization option. It should be shown as such in 4671debfc3dSmrg@option{--help} output, and any associated variable named using 4681debfc3dSmrg@code{Var} should be saved and restored when the optimization level is 4691debfc3dSmrgchanged with @code{optimize} attributes. 4701debfc3dSmrg 4711debfc3dSmrg@item PerFunction 4721debfc3dSmrgThis is an option that can be overridden on a per-function basis. 4731debfc3dSmrg@code{Optimization} implies @code{PerFunction}, but options that do not 4741debfc3dSmrgaffect executable code generation may use this flag instead, so that the 4751debfc3dSmrgoption is not taken into account in ways that might affect executable 4761debfc3dSmrgcode generation. 4771debfc3dSmrg 478*8feb0f0bSmrg@item Param 479*8feb0f0bSmrgThis is an option that is a parameter. 480*8feb0f0bSmrg 4811debfc3dSmrg@item Undocumented 4821debfc3dSmrgThe option is deliberately missing documentation and should not 4831debfc3dSmrgbe included in the @option{--help} output. 4841debfc3dSmrg 4851debfc3dSmrg@item Condition(@var{cond}) 4861debfc3dSmrgThe option should only be accepted if preprocessor condition 4871debfc3dSmrg@var{cond} is true. Note that any C declarations associated with the 4881debfc3dSmrgoption will be present even if @var{cond} is false; @var{cond} simply 4891debfc3dSmrgcontrols whether the option is accepted and whether it is printed in 4901debfc3dSmrgthe @option{--help} output. 4911debfc3dSmrg 4921debfc3dSmrg@item Save 4931debfc3dSmrgBuild the @code{cl_target_option} structure to hold a copy of the 4941debfc3dSmrgoption, add the functions @code{cl_target_option_save} and 4951debfc3dSmrg@code{cl_target_option_restore} to save and restore the options. 4961debfc3dSmrg 4971debfc3dSmrg@item SetByCombined 4981debfc3dSmrgThe option may also be set by a combined option such as 4991debfc3dSmrg@option{-ffast-math}. This causes the @code{gcc_options} struct to 5001debfc3dSmrghave a field @code{frontend_set_@var{name}}, where @code{@var{name}} 5011debfc3dSmrgis the name of the field holding the value of this option (without the 5021debfc3dSmrgleading @code{x_}). This gives the front end a way to indicate that 5031debfc3dSmrgthe value has been set explicitly and should not be changed by the 5041debfc3dSmrgcombined option. For example, some front ends use this to prevent 5051debfc3dSmrg@option{-ffast-math} and @option{-fno-fast-math} from changing the 5061debfc3dSmrgvalue of @option{-fmath-errno} for languages that do not use 5071debfc3dSmrg@code{errno}. 5081debfc3dSmrg 5091debfc3dSmrg@item EnabledBy(@var{opt}) 5101debfc3dSmrg@itemx EnabledBy(@var{opt} || @var{opt2}) 5111debfc3dSmrg@itemx EnabledBy(@var{opt} && @var{opt2}) 5121debfc3dSmrgIf not explicitly set, the option is set to the value of 5131debfc3dSmrg@option{-@var{opt}}; multiple options can be given, separated by 5141debfc3dSmrg@code{||}. The third form using @code{&&} specifies that the option is 5151debfc3dSmrgonly set if both @var{opt} and @var{opt2} are set. The options @var{opt} 5161debfc3dSmrgand @var{opt2} must have the @code{Common} property; otherwise, use 5171debfc3dSmrg@code{LangEnabledBy}. 5181debfc3dSmrg 5191debfc3dSmrg@item LangEnabledBy(@var{language}, @var{opt}) 5201debfc3dSmrg@itemx LangEnabledBy(@var{language}, @var{opt}, @var{posarg}, @var{negarg}) 5211debfc3dSmrgWhen compiling for the given language, the option is set to the value 5221debfc3dSmrgof @option{-@var{opt}}, if not explicitly set. @var{opt} can be also a list 5231debfc3dSmrgof @code{||} separated options. In the second form, if 5241debfc3dSmrg@var{opt} is used in the positive form then @var{posarg} is considered 5251debfc3dSmrgto be passed to the option, and if @var{opt} is used in the negative 5261debfc3dSmrgform then @var{negarg} is considered to be passed to the option. It 5271debfc3dSmrgis possible to specify several different languages. Each 5281debfc3dSmrg@var{language} must have been declared by an earlier @code{Language} 5291debfc3dSmrgrecord. @xref{Option file format}. 5301debfc3dSmrg 5311debfc3dSmrg@item NoDWARFRecord 5321debfc3dSmrgThe option is omitted from the producer string written by 5331debfc3dSmrg@option{-grecord-gcc-switches}. 5341debfc3dSmrg 5351debfc3dSmrg@item PchIgnore 5361debfc3dSmrgEven if this is a target option, this option will not be recorded / compared 5371debfc3dSmrgto determine if a precompiled header file matches. 5381debfc3dSmrg 5391debfc3dSmrg@item CPP(@var{var}) 5401debfc3dSmrgThe state of this option should be kept in sync with the preprocessor 5411debfc3dSmrgoption @var{var}. If this property is set, then properties @code{Var} 5421debfc3dSmrgand @code{Init} must be set as well. 5431debfc3dSmrg 5441debfc3dSmrg@item CppReason(@var{CPP_W_Enum}) 5451debfc3dSmrgThis warning option corresponds to @code{cpplib.h} warning reason code 5461debfc3dSmrg@var{CPP_W_Enum}. This should only be used for warning options of the 5471debfc3dSmrgC-family front-ends. 5481debfc3dSmrg 5491debfc3dSmrg@end table 550