Previous: Option file format, Up: Options
The second field of an option record can specify any of the following properties. When an option takes an argument, it is enclosed in parentheses following the option property name. The parser that handles option files is quite simplistic, and will be tricked by any nested parentheses within the argument text itself; in this case, the entire option argument can be wrapped in curly braces within the parentheses to demarcate it, e.g.:
Condition({defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS)})
Common
Target
Driver
It is possible to specify several different languages for the same
option. Each language must have been declared by an earlier
Language
record. See Option file format.
RejectDriver
RejectNegative
Negative(
othername)
Negative
property of the option to be
turned off.
Joined
Separate
Joined
indicates
that the option and argument can be included in the same argv
entry (as with -mflush-func=
name, for example).
Separate
indicates that the option and argument can be
separate argv
entries (as with -o
). An option is
allowed to have both of these properties.
JoinedOrMissing
argv
entry as the option itself.
This property cannot be used alongside Joined
or Separate
.
MissingArgError(
message)
Joined
or Separate
, the message
message will be used as an error message if the mandatory
argument is missing; for options without MissingArgError
, a
generic error message is used. message should contain a single
`%qs' format, which will be used to format the name of the option
passed.
Args(
n)
Separate
, indicate that it takes n
arguments. The default is 1.
UInteger
UInteger
should also be used on options like
-falign-loops
where both -falign-loops
and
-falign-loops
=n are supported to make sure the saved
options are given a full integer.
NoDriverArg
Separate
, the option only takes an
argument in the compiler proper, not in the driver. This is for
compatibility with existing options that are used both directly and
via -Wp,; new options should not have this property.
Var(
var)
global_options.x_
var).
The way that the state is stored depends on the type of option:
Mask
or InverseMask
properties,
var is the integer variable that contains the mask.
UInteger
property,
var is an integer variable that stores the value of the argument.
Enum
property,
var is a variable (type given in the Type
property of the
`Enum' record whose Name
property has the same argument as
the Enum
property of this option) that stores the value of the
argument.
Defer
property, var is a pointer to
a VEC(cl_deferred_option,heap)
that stores the option for later
processing. (var is declared with type void *
and needs
to be cast to VEC(cl_deferred_option,heap)
before use.)
The option-processing script will usually zero-initialize var.
You can modify this behavior using Init
.
Var(
var,
set)
!
set
when the “no-” form is used.
var is declared in the same way as for the single-argument form
described above.
Init(
value)
Var
property should be statically
initialized to value. If more than one option using the same
variable specifies Init
, all must specify the same initializer.
Mask(
name)
target_flags
variable (see Run-time Target) and is active when that bit is set.
You may also specify Var
to select a variable other than
target_flags
.
The options-processing script will automatically allocate a unique bit
for the option. If the option is attached to `target_flags',
the script will set the macro MASK_
name to the appropriate
bitmask. It will also declare a TARGET_
name macro that has
the value 1 when the option is active and 0 otherwise. If you use Var
to attach the option to a different variable, the associated macros are
called OPTION_MASK_
name and OPTION_
name respectively.
You can disable automatic bit allocation using MaskExists
.
InverseMask(
othername)
InverseMask(
othername,
thisname)
Mask(
othername)
property. If thisname is given,
the options-processing script will declare a TARGET_
thisname
macro that is 1 when the option is active and 0 otherwise.
MaskExists
Mask
property already exists.
No MASK
or TARGET
definitions should be added to
options.h in response to this option record.
The main purpose of this property is to support synonymous options.
The first option should use `Mask(name)' and the others
should use `Mask(name) MaskExists'.
Enum(
name)
Defer
Var
,
for later processing.
Alias(
opt)
Alias(
opt,
arg)
Alias(
opt,
posarg,
negarg)
Aliases should not specify Var
or Mask
or
UInteger
. Aliases should normally specify the same languages
as the target of the alias; the flags on the target will be used to
determine any diagnostic for use of an option for the wrong language,
while those on the alias will be used to identify what command-line
text is the option and what text is any argument to that option.
When an Alias
definition is used for an option, driver specs do
not need to handle it and no `OPT_' enumeration value is defined
for it; only the canonical form of the option will be seen in those
places.
Ignore
Warn
. The option will not be seen by specs and no `OPT_'
enumeration value is defined for it.
SeparateAlias
Joined
, Separate
and
Alias
, the option only acts as an alias when passed a separate
argument; with a joined argument it acts as a normal option, with an
`OPT_' enumeration value. This is for compatibility with the
Java -d option and should not be used for new options.
Warn(
message)
Warn
, the target of the alias must not also be marked
Warn
.
Report
Warning
Optimization
Var
should be saved and restored when the optimization level is
changed with optimize
attributes.
Undocumented
Condition(
cond)
Save
cl_target_option
structure to hold a copy of the
option, add the functions cl_target_option_save
and
cl_target_option_restore
to save and restore the options.
SetByCombined
gcc_options
struct to
have a field frontend_set_
name, where name
is the name of the field holding the value of this option (without the
leading x_
). This gives the front end a way to indicate that
the value has been set explicitly and should not be changed by the
combined option. For example, some front ends use this to prevent
-ffast-math and -fno-fast-math from changing the
value of -fmath-errno for languages that do not use
errno
.