OSDN Git Service

* c-common.c (parse_optimize_options): Do not capitalize warning
[pf3gnuchains/gcc-fork.git] / gcc / opth-gen.awk
index b84d1f2..0d1d0df 100644 (file)
@@ -1,4 +1,5 @@
-#  Copyright (C) 2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
+#  Copyright (C) 2003,2004,2005,2006,2007,2008, 2010
+#  Free Software Foundation, Inc.
 #  Contributed by Kelley Cook, June 2004.
 #  Original code from Neil Booth, May 2003.
 #
@@ -28,8 +29,6 @@ BEGIN {
        n_langs = 0
        n_target_save = 0
        n_extra_masks = 0
-       quote = "\042"
-       comma = ","
        FS=SUBSEP
 }
 
@@ -98,7 +97,7 @@ print ""
 print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)"
 print ""
 print "/* Structure to save/restore optimization and target specific options.  */";
-print "struct cl_optimization GTY(())";
+print "struct GTY(()) cl_optimization";
 print "{";
 
 n_opt_char = 2;
@@ -154,7 +153,7 @@ print "";
 
 # Target and optimization save/restore/print functions.
 print "/* Structure to save/restore selected target specific options.  */";
-print "struct cl_target_option GTY(())";
+print "struct GTY(()) cl_target_option";
 print "{";
 
 n_target_char = 0;
@@ -320,6 +319,7 @@ print "{"
 for (i = 0; i < n_opts; i++)
        back_chain[i] = "N_OPTS";
 
+enum_value = 0
 for (i = 0; i < n_opts; i++) {
        # Combine the flags of identical switches.  Switches
        # appear many times if they are handled by many front
@@ -330,10 +330,15 @@ for (i = 0; i < n_opts; i++) {
        }
 
        len = length (opts[i]);
-       enum = "OPT_" opts[i]
-       if (opts[i] == "finline-limit=" || opts[i] == "Wlarger-than=")
-               enum = enum "eq"
-       gsub ("[^A-Za-z0-9]", "_", enum)
+       enum = opt_enum(opts[i])
+       enum_string = enum " = " enum_value ","
+
+       # Aliases do not get enumeration names.
+       if ((flag_set_p("Alias.*", flags[i]) \
+            && !flag_set_p("SeparateAlias", flags[i])) \
+           || flag_set_p("Ignore", flags[i])) {
+               enum_string = "/* " enum_string " */"
+       }
 
        # If this switch takes joined arguments, back-chain all
        # subsequent switches to it for which it is a prefix.  If
@@ -348,19 +353,23 @@ for (i = 0; i < n_opts; i++) {
                }
        }
 
-       s = substr("                                     ", length (opts[i]))
-       if (i + 1 == n_opts)
-               comma = ""
+       s = substr("                                          ",
+                  length (enum_string))
 
        if (help[i] == "")
                hlp = "0"
        else
                hlp = "N_(\"" help[i] "\")";
 
-       print "  " enum "," s "/* -" opts[i] " */"
+       print "  " enum_string s "/* -" opts[i] " */"
+       enum_value++
 }
 
-print "  N_OPTS"
+print "  N_OPTS,"
+print "  OPT_SPECIAL_unknown,"
+print "  OPT_SPECIAL_ignore,"
+print "  OPT_SPECIAL_program_name,"
+print "  OPT_SPECIAL_input_file"
 print "};"
 print ""
 print "#endif /* OPTIONS_H */"