Next: Option properties, Up: Options
Option files are a simple list of records in which each field occupies its own line and in which the records themselves are separated by blank lines. Comments may appear on their own line anywhere within the file and are preceded by semicolons. Whitespace is allowed before the semicolon.
The files can contain the following types of record:
cl_target_option
structure.
Var
properties.
gcc_options
structure, but these variables are also stored in
the cl_target_option
structure. The variables are saved in the
target save code and restored in the target restore code.
#ifdef
sequences to properly set up the initialization. These records have
two fields: the string `SourceInclude' and the name of the
include file.
Name(
name)
Enum
option properties.
Type(
type)
Var
.
UnknownError(
message)
UnknownError
, a
generic error message is used. message should contain a single
`%qs' format, which will be used to format the invalid argument.
Enum(
name)
String(
string)
Value(
value)
int
) should be used for the given string.
Canonical
DriverOnly
Set(
number)
EnumSet
options. number should be decimal number between
1 and 64 inclusive and divides the enumeration into a set of
sets of mutually exclusive arguments. Arguments with the same
number can't be specified together in the same option, but
arguments with different number can. value needs to be
chosen such that a mask of all value values from the same set
number bitwise ored doesn't overlap with masks for other sets.
When -foption=arg_from_set1,arg_from_set4
and
-fno-option=arg_from_set3
are used, the effect is that previous
value of the Var
will get bits from set 1 and 4 masks cleared,
ored Value
of arg_from_set1
and arg_from_set4
and then will get bits from set 3 mask cleared.
Undocumented
property).
By default, all options beginning with “f”, “W” or “m” are
implicitly assumed to take a “no-” form. This form should not be
listed separately. If an option beginning with one of these letters
does not have a “no-” form, you can use the RejectNegative
property to reject it.
The help text is automatically line-wrapped before being displayed. Normally the name of the option is printed on the left-hand side of the output and the help text is printed on the right. However, if the help text contains a tab character, the text to the left of the tab is used instead of the option's name and the text to the right of the tab forms the help text. This allows you to elaborate on what type of argument the option takes.
There is no support for different help texts for different languages. If an option is supported for multiple languages, use a generic description that is correct for all of them.
If an option has multiple option definition records (in different
front ends' *.opt files, and/or gcc/common.opt, for
example), convention is to not duplicate the help text for each of
them, but instead put a comment like ; documented in common.opt
in place of the help text for all but one of the multiple option
definition records.
target_flags
(see Run-time Target) for
each mask name x and set the macro MASK_
x to the
appropriate bitmask. It will also declare a TARGET_
x
macro that has the value 1 when bit MASK_
x is set and
0 otherwise.
They are primarily intended to declare target masks that are not associated with user options, either because these masks represent internal switches or because the options are not available on all configurations and yet the masks always need to be defined.