diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-13 14:27:22 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-13 14:27:22 +0000 |
commit | d4c7816a34cdbf396efa1009310b2fc2a05631bc (patch) | |
tree | dc424ba0e4c45bee7be4f49b2afb355c7a222f5e /gcc | |
parent | 38525cf296cd0873d2a1e90d8f58ae7f47237e8d (diff) | |
download | gcc-d4c7816a34cdbf396efa1009310b2fc2a05631bc.tar.gz |
2010-04-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
* opt-functions.awk (opt_sanitized_name): New.
(opt_enum): New.
* optc-gen.awk: Use it
* opth-gen.awk: Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158272 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/opt-functions.awk | 18 | ||||
-rw-r--r-- | gcc/optc-gen.awk | 6 | ||||
-rw-r--r-- | gcc/opth-gen.awk | 8 |
4 files changed, 27 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f82bc7a0655..dbc73df1cb7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-04-13 Manuel López-Ibáñez <manu@gcc.gnu.org> + + * opt-functions.awk (opt_sanitized_name): New. + (opt_enum): New. + * optc-gen.awk: Use it + * opth-gen.awk: Use it. + 2010-04-13 Martin Jambor <mjambor@suse.cz> * tree-sra.c (replace_uses_with_default_def_ssa_name): New function. diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index f5b485aa62b..4eeb67bdbea 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -194,3 +194,21 @@ function var_ref(name, flags) return "&target_flags" return "0" } + +# Given the option called NAME return a sanitized version of its name. +function opt_sanitized_name(name) +{ + if (name == "finline-limit=" || name == "Wlarger-than=" \ + || name == "ftemplate-depth=") + name = name "eq" + if (name == "gdwarf+") + name = "gdwarfplus" + gsub ("[^A-Za-z0-9]", "_", name) + return name +} + +# Given the option called NAME return the appropriate enum for it. +function opt_enum(name) +{ + return "OPT_" opt_sanitized_name(name) +} diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 0cff3753245..da595e94bc0 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -170,11 +170,7 @@ for (i = 0; i < n_opts; i++) { } len = length (opts[i]); - enum = "OPT_" opts[i] - if (opts[i] == "finline-limit=" || opts[i] == "Wlarger-than=" \ - || opts[i] == "ftemplate-depth=") - enum = enum "eq" - gsub ("[^A-Za-z0-9]", "_", enum) + enum = opt_enum(opts[i]) # If this switch takes joined arguments, back-chain all # subsequent switches to it for which it is a prefix. If diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index 93a9008bdcf..cf2ef9683c8 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -331,13 +331,7 @@ for (i = 0; i < n_opts; i++) { } len = length (opts[i]); - enum = "OPT_" opts[i] - if (opts[i] == "finline-limit=" || opts[i] == "Wlarger-than=" \ - || opts[i] == "ftemplate-depth=") - enum = enum "eq" - if (opts[i] == "gdwarf+") - enum = "OPT_gdwarfplus" - gsub ("[^A-Za-z0-9]", "_", enum) + enum = opt_enum(opts[i]) # If this switch takes joined arguments, back-chain all # subsequent switches to it for which it is a prefix. If |