Previous: Option file format, Up: Options
Condition({defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS)})
选项记录的第二个域可以指定下列属性:
CommonTargetDriver可以为多个不同的语言指定同一个选项。每个语言language必须已经被之前的Language记录声明过。参见Option file format。
RejectDriverRejectNegativeNegative(othername)Negative属性来传播一连串的选项关闭行为。
JoinedSeparateJoined指示选项和参数可以被包含在同一个argv项中(例如 -mflush-func=name)。Separate指示选项和参数可以为分开的argv项(如-o)。一个选项允许同时具有这两个属性。
JoinedOrMissing选项接受一个可选参数。如果参数给出,则会作为选项本身的argv项的一部分。
该属性不能和Joined或Separate一起使用。
MissingArgError(message)UIntegerNoDriverArgSeparate, 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)Mask或者InverseMask属性,则var为包含
mask的整数变量。
UInteger属性,则var为整数变量,并且存储了参数的值。
选项处理脚本通常会在options.c中声明var,并且在起动时间将其初始化为0。你可以使用VarExists和Init来修改这种行为。
Var(var, set)!set。
var的声明方式与上面描述的单一参数形式的具有相同的方式。
VarExists应该只有在options.c之外声明了该变量的时候,才使用这个属性。
Init(value)Var指定的变量应该被静态初始化为value。
Mask(name)target_flags变量(参见Run-time Target)中的一个位相关联,并且当该位被置位时才起作用。你还可以指定Var去选择一个变量,而不只是target_flags。
选项处理脚本将会自动为选项分配一个唯一的位。如果选项与‘target_flags’关联,则脚本会将宏MASK_name设为合适的位掩码。它还会声明一个TARGET_name宏,当选项起作用时其值为1,否则为0。如果使用Var将选项关联到不同的变量上,则相关的宏分别叫做OPTION_MASK_name和OPTION_name。
可以使用 MaskExists 来禁止自动位分配。
InverseMask(othername)InverseMask(othername, thisname)Mask(othername)属性的另一个选项的反面。如果给出了thisname,则选项处理脚本会声明一个TARGET_thisname宏,当选项起作用时其为1,否则为0。
MaskExistsMask属性指定的掩码已经存在。这样,就不会有MASK和TARGET定义被增加到options.h中。
该属性的主要目的用来支持同义选项。第一个选项应该使用‘Mask(name)’并且其它的应该使用‘Mask(name) MaskExists’。
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.
IgnoreWarn. The option will not be seen by specs and no ‘OPT_’
enumeration value is defined for it.
SeparateAliasJoined, 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.
ReportUndocumentedCondition(cond)Savecl_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.