OSDN Git Service

2010-09-30 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / opt-functions.awk
index 4ff4068..863c478 100644 (file)
@@ -80,6 +80,8 @@ function switch_flags (flags)
          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") \
@@ -113,12 +115,14 @@ function global_state_p(flags)
 # 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))
@@ -189,20 +193,17 @@ function var_ref(name, 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)