OSDN Git Service

* cfgloop.h (struct loop): Move can_be_parallel field up.
[pf3gnuchains/gcc-fork.git] / gcc / opt-functions.awk
index a14b8c2..4eeb67b 100644 (file)
@@ -1,4 +1,5 @@
-#  Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+#  Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
+#  Free Software Foundation, Inc.
 #  Contributed by Kelley Cook, June 2004.
 #  Original code from Neil Booth, May 2003.
 #
@@ -41,7 +42,13 @@ function opt_args(name, flags)
        if (flags !~ " " name "\\(")
                return ""
        sub(".* " name "\\(", "", flags)
-       sub("\\).*", "", flags)
+       if (flags ~ "^{")
+       {
+               sub ("^{", "", flags)
+               sub("}\\).*", "", flags)
+       }
+       else
+               sub("\\).*", "", flags)
 
        return flags
 }
@@ -71,6 +78,7 @@ function switch_flags (flags)
        result = result \
          test_flag("Common", flags, " | CL_COMMON") \
          test_flag("Target", flags, " | CL_TARGET") \
+         test_flag("Save", flags, " | CL_SAVE") \
          test_flag("Joined", flags, " | CL_JOINED") \
          test_flag("JoinedOrMissing", flags, " | CL_JOINED | CL_MISSING_OK") \
          test_flag("Separate", flags, " | CL_SEPARATE") \
@@ -129,7 +137,7 @@ function var_type(flags)
 }
 
 # Return the type of variable that should be associated with the given flags
-# for use within a structure.  Simple variables are changed to unsigned char
+# for use within a structure.  Simple variables are changed to signed char
 # type instead of int to save space.
 function var_type_struct(flags)
 {
@@ -139,7 +147,7 @@ function var_type_struct(flags)
                if (flag_set_p(".*Mask.*", flags))
                        return "int "
                else
-                       return "unsigned char "
+                       return "signed char "
        }
        else
                return "const char *"
@@ -186,3 +194,21 @@ function var_ref(name, flags)
                return "&target_flags"
        return "0"
 }
+
+# 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)
+       return name
+}
+
+# Given the option called NAME return the appropriate enum for it.
+function opt_enum(name)
+{
+       return "OPT_" opt_sanitized_name(name)
+}