test_flag("Target", flags, " | CL_TARGET") \
test_flag("Driver", flags, " | CL_DRIVER") \
test_flag("RejectDriver", flags, " | CL_REJECT_DRIVER") \
+ test_flag("NoDriverArg", flags, " | CL_NO_DRIVER_ARG") \
+ test_flag("SeparateAlias", flags, " | CL_SEPARATE_ALIAS") \
test_flag("Save", flags, " | CL_SAVE") \
test_flag("Joined", flags, " | CL_JOINED") \
test_flag("JoinedOrMissing", flags, " | CL_JOINED | CL_MISSING_OK") \
# associated with it.
function needs_state_p(flags)
{
- return flag_set_p("Target", flags)
+ return (flag_set_p("Target", flags) \
+ && !flag_set_p("Alias.*", flags) \
+ && !flag_set_p("Ignore", flags))
}
-# If FLAGS describes an option that needs a static state variable,
-# return the name of that variable, otherwise return "". NAME is
-# the name of the option.
+# If FLAGS describes an option that needs state without a public
+# variable name, return the name of that field, minus the initial
+# "x_", otherwise return "". NAME is the name of the option.
function static_var(name, flags)
{
if (global_state_p(flags) || !needs_state_p(flags))
{
name = var_name(flags) static_var(name, flags)
if (name != "")
- return "&" name
+ return "offsetof (struct gcc_options, x_" name ")"
if (opt_args("Mask", flags) != "")
- return "&target_flags"
+ return "offsetof (struct gcc_options, x_target_flags)"
if (opt_args("InverseMask", flags) != "")
- return "&target_flags"
- return "0"
+ return "offsetof (struct gcc_options, x_target_flags)"
+ return "-1"
}
# Given the option called NAME return a sanitized version of its name.
function opt_sanitized_name(name)
{
- if (name == "finline-limit=" || name == "Wlarger-than=" \
- || name == "ftemplate-depth=")
- name = name "eq"
if (name == "gdwarf+")
name = "gdwarfplus"
gsub ("[^A-Za-z0-9]", "_", name)