diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-30 06:24:35 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-30 06:24:35 +0000 |
commit | a150399de633299feeb20899e9b178895dae0c1c (patch) | |
tree | 0f5f11110d7efae0a9f2bdcb0ba8512beb09a1ab /gcc/optc-gen.awk | |
parent | 4c34e98c7bf1e13e0107768ef4a161fb823c4f7f (diff) | |
download | gcc-a150399de633299feeb20899e9b178895dae0c1c.tar.gz |
* opt-functions.awk (flag_set_p, test_flag): New functions.
(switch_flags): Use them.
* opth-gen.awk: Use flag_set_p to check for flags.
* optc-gen.awk: Likewise. Use opt_args to check for Init(...) flags.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97237 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optc-gen.awk')
-rw-r--r-- | gcc/optc-gen.awk | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 3ed1cf881be..94e2ddb65da 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -63,22 +63,16 @@ for (i = 0; i < n_opts; i++) { if (name == "") continue; - if (flags[i] ~ "VarExists") + if (flag_set_p("VarExists", flags[i])) continue; - if (flags[i] ~ "Init\\(") - { - init = flags[i]; - sub(".*Init\\(","",init); - sub("\\).*","",init); - init = " = " init; - } - else - init = ""; - - printf ("/* Set by -%s.\n %s */\nint %s%s;\n\n", + init = opt_args("Init", flags[i]) + if (init != "") + init = " = " init; + + printf ("/* Set by -%s.\n %s */\nint %s%s;\n\n", opts[i], help[i], name,init) - } +} print "const char * const lang_names[] =\n{" @@ -117,7 +111,7 @@ for (i = 0; i < n_opts; i++) # a later switch S is a longer prefix of a switch T, T # will be back-chained to S in a later iteration of this # for() loop, which is what we want. - if (flags[i] ~ "Joined") { + if (flag_set_p("Joined.*", flags[i])) { for (j = i + 1; j < n_opts; j++) { if (substr (opts[j], 1, len) != opts[i]) break; |