diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-04 10:17:11 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-04 10:17:11 +0000 |
commit | cb14e05859b08afbee46f715af6cd368f131a96a (patch) | |
tree | 80b585242934f43f5933e85676bd17af4fba0f01 /gcc/opts-common.c | |
parent | 517579e0f9bfb4bafcc6674532fab3352baef52d (diff) | |
download | gcc-cb14e05859b08afbee46f715af6cd368f131a96a.tar.gz |
* doc/options.texi (ToLower): Document.
* opt-functions.awk (switch_bit_fields): Initialize cl_tolower
field.
* opts-common.c (decode_cmdline_option): Handle cl_tolower.
* opts.h (cl_option): Add cl_tolower field.
* config/rx/rx.c (rx_handle_option): Use strcmp of -mcpu=
arguments with lowercase strings.
* config/rx/rx.opt (mcpu=): Add ToLower.
* config/rx/t-rx (MULTILIB_MATCHES): Don't handle uppercase -mcpu=
argument.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts-common.c')
-rw-r--r-- | gcc/opts-common.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/opts-common.c b/gcc/opts-common.c index f54d64aff28..e314cb35213 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -567,6 +567,19 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, if (!option_ok_for_language (option, lang_mask)) errors |= CL_ERR_WRONG_LANG; + /* Convert the argument to lowercase if appropriate. */ + if (arg && option->cl_tolower) + { + size_t j; + size_t len = strlen (arg); + char *arg_lower = XNEWVEC (char, len + 1); + + for (j = 0; j < len; j++) + arg_lower[j] = TOLOWER ((unsigned char) arg[j]); + arg_lower[len] = 0; + arg = arg_lower; + } + /* If the switch takes an integer, convert it. */ if (arg && option->cl_uinteger) { |