diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-27 15:28:41 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-27 15:28:41 +0000 |
commit | dbc6e347a3b265f737d8dfe50d6fc4946f8a17b4 (patch) | |
tree | 082df1a6e4de30b116ee7f94baaed1cd0c500910 | |
parent | 6e171ea32ac5ad1df952a9559a9c64ff08955b22 (diff) | |
download | gcc-dbc6e347a3b265f737d8dfe50d6fc4946f8a17b4.tar.gz |
Remove MaskNeeded
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185882 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/doc/options.texi | 11 | ||||
-rw-r--r-- | gcc/opth-gen.awk | 50 |
3 files changed, 43 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 876da2511a5..b7736fb7983 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi index 0a54183d831..08b8b793a04 100644 --- a/gcc/doc/options.texi +++ b/gcc/doc/options.texi @@ -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 diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index 541bc3ea596..9a7b6c385f8 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -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] \ |