diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-28 20:52:12 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-28 20:52:12 +0000 |
commit | c5e839cb5ef14a22e8078adb0ede837f47d750a0 (patch) | |
tree | aeacd772adaa4ebc4fcc69669e083225f5e6479e /gcc/opth-gen.awk | |
parent | 14321893db58a975cf737cf18631ce7d0ab28cdf (diff) | |
download | gcc-c5e839cb5ef14a22e8078adb0ede837f47d750a0.tar.gz |
* optc-gen.awk (END): Make sure no variable is defined more
than once.
* opth-gen.awk (END): Allocate bits on a per-variable basis.
Allow for bitfield variables other than target_flags.
* doc/options.text (Mask): Document that you may specify a
variable other than target_flags.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98940 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opth-gen.awk')
-rw-r--r-- | gcc/opth-gen.awk | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index b5a4c578058..92c0e7e3723 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -75,24 +75,43 @@ for (i = 0; i < n_opts; i++) { } -masknum = 0 for (i = 0; i < n_opts; i++) { name = opt_args("Mask", flags[i]) + vname = var_name(flags[i]) + mask = "MASK_" + if (vname != "") { + mask = "OPTION_MASK_" + } if (name != "" && !flag_set_p("MaskExists", flags[i])) - print "#define MASK_" name " (1 << " masknum++ ")" + print "#define " mask name " (1 << " masknum[vname]++ ")" } for (i = 0; i < n_extra_masks; i++) { - print "#define MASK_" extra_masks[i] " (1 << " masknum++ ")" + print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")" +} + +for (var in masknum) { + if (masknum[var] > 31) { + if (var == "") + print "#error too many target masks" + else + print "#error too many masks for " var + } } -if (masknum > 31) - print "#error too many target masks" 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 != "" && !flag_set_p("MaskExists", flags[i])) - print "#define TARGET_" name \ - " ((target_flags & MASK_" name ") != 0)" + print "#define " macro name \ + " ((" vname " & " mask name ") != 0)" } for (i = 0; i < n_extra_masks; i++) { print "#define TARGET_" extra_masks[i] \ |