Remove MaskNeeded
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 27 Mar 2012 15:28:41 +0000 (15:28 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 27 Mar 2012 15:28:41 +0000 (08:28 -0700)
2012-03-27  H.J. Lu  <hongjiu.lu@intel.com>

* opth-gen.awk: Allocated a bit for Mask and InverseMask if it
hasn't been allocated.  Define a target macro for Mask and
InverseMask if it hasn't been defined.  Remove MaskExists
handling.

* doc/options.texi: Remove MaskNeeded.

From-SVN: r185882

gcc/ChangeLog
gcc/doc/options.texi
gcc/opth-gen.awk

index 876da25..b7736fb 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * opth-gen.awk: Allocated a bit for Mask and InverseMask if it
+       hasn't been allocated.  Define a target macro for Mask and
+       InverseMask if it hasn't been defined.  Remove MaskExists
+       handling.
+
+       * doc/options.texi: Remove MaskNeeded.
+
 2012-03-27  Chung-Lin Tang  <cltang@codesourcery.com>
 
        PR target/52667
index 0a54183..08b8b79 100644 (file)
@@ -346,8 +346,6 @@ the value 1 when the option is active and 0 otherwise.  If you use @code{Var}
 to attach the option to a different variable, the associated macros are
 called @code{OPTION_MASK_@var{name}} and @code{OPTION_@var{name}} respectively.
 
-You can disable automatic bit allocation using @code{MaskExists}.
-
 @item InverseMask(@var{othername})
 @itemx InverseMask(@var{othername}, @var{thisname})
 The option is the inverse of another option that has the
@@ -355,15 +353,6 @@ The option is the inverse of another option that has the
 the options-processing script will declare a @code{TARGET_@var{thisname}}
 macro that is 1 when the option is active and 0 otherwise.
 
-@item MaskExists
-The mask specified by the @code{Mask} property already exists.
-No @code{MASK} or @code{TARGET} definitions should be added to
-@file{options.h} in response to this option record.
-
-The main purpose of this property is to support synonymous options.
-The first option should use @samp{Mask(@var{name})} and the others
-should use @samp{Mask(@var{name}) MaskExists}.
-
 @item Enum(@var{name})
 The option's argument is a string from the set of strings associated
 with the corresponding @samp{Enum} record.  The string is checked and
index 541bc3e..9a7b6c3 100644 (file)
@@ -298,16 +298,25 @@ print "";
 
 for (i = 0; i < n_opts; i++) {
        name = opt_args("Mask", flags[i])
-       vname = var_name(flags[i])
-       mask = "MASK_"
-       mask_1 = "1"
-       if (vname != "") {
-               mask = "OPTION_MASK_"
-               if (host_wide_int[vname] == "yes")
-                       mask_1 = "HOST_WIDE_INT_1"
+       if (name == "") {
+               opt = opt_args("InverseMask", flags[i])
+               if (opt ~ ",")
+                       name = nth_arg(0, opt)
+               else
+                       name = opt
        }
-       if (name != "" && !flag_set_p("MaskExists", flags[i]))
+       if (name != "" && mask_bits[name] == 0) {
+               mask_bits[name] = 1
+               vname = var_name(flags[i])
+               mask = "MASK_"
+               mask_1 = "1"
+               if (vname != "") {
+                       mask = "OPTION_MASK_"
+                       if (host_wide_int[vname] == "yes")
+                               mask_1 = "HOST_WIDE_INT_1"
+               }
                print "#define " mask name " (" mask_1 " << " masknum[vname]++ ")"
+       }
 }
 for (i = 0; i < n_extra_masks; i++) {
        print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")"
@@ -330,17 +339,26 @@ print ""
 
 for (i = 0; i < n_opts; i++) {
        name = opt_args("Mask", flags[i])
-       vname = var_name(flags[i])
-       macro = "OPTION_"
-       mask = "OPTION_MASK_"
-       if (vname == "") {
-               vname = "target_flags"
-               macro = "TARGET_"
-               mask = "MASK_"
+       if (name == "") {
+               opt = opt_args("InverseMask", flags[i])
+               if (opt ~ ",")
+                       name = nth_arg(0, opt)
+               else
+                       name = opt
        }
-       if (name != "" && !flag_set_p("MaskExists", flags[i]))
+       if (name != "" && mask_macros[name] == 0) {
+               mask_macros[name] = 1
+               vname = var_name(flags[i])
+               macro = "OPTION_"
+               mask = "OPTION_MASK_"
+               if (vname == "") {
+                       vname = "target_flags"
+                       macro = "TARGET_"
+                       mask = "MASK_"
+               }
                print "#define " macro name \
                      " ((" vname " & " mask name ") != 0)"
+       }
 }
 for (i = 0; i < n_extra_masks; i++) {
        print "#define TARGET_" extra_masks[i] \