options.texi (ToLower): Document.

* 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.

From-SVN: r171932
This commit is contained in:
Joseph Myers 2011-04-04 11:17:11 +01:00 committed by Joseph Myers
parent 2aeaa366ad
commit 413519aef8
8 changed files with 41 additions and 7 deletions

View File

@ -1,3 +1,16 @@
2011-04-04 Joseph Myers <joseph@codesourcery.com>
* 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.
2011-04-04 Richard Sandiford <richard.sandiford@linaro.org>
* config/pdp11/pdp11.h (IRA_COVER_CLASSES): Delete.

View File

@ -2308,14 +2308,14 @@ rx_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
return value >= 0 && value <= 4;
case OPT_mcpu_:
if (strcasecmp (arg, "RX610") == 0)
if (strcmp (arg, "rx610") == 0)
rx_cpu_type = RX610;
else if (strcasecmp (arg, "RX200") == 0)
else if (strcmp (arg, "rx200") == 0)
{
target_flags |= MASK_NO_USE_FPU;
rx_cpu_type = RX200;
}
else if (strcasecmp (arg, "RX600") != 0)
else if (strcmp (arg, "rx600") != 0)
warning (0, "unrecognized argument '%s' to -mcpu= option", arg);
break;

View File

@ -1,5 +1,5 @@
; Command line options for the Renesas RX port of GCC.
; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
; Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
; Contributed by Red Hat.
;
; This file is part of GCC.
@ -43,7 +43,7 @@ Enable the use of RX FPU instructions. This is the default.
;---------------------------------------------------
mcpu=
Target RejectNegative Joined Var(rx_cpu_name) Report
Target RejectNegative Joined Var(rx_cpu_name) Report ToLower
Specify the target RX cpu type.
;---------------------------------------------------

View File

@ -1,5 +1,5 @@
# Makefile fragment for building GCC for the Renesas RX target.
# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
# Contributed by Red Hat.
#
# This file is part of GCC.
@ -23,7 +23,7 @@
MULTILIB_OPTIONS = m64bit-doubles nofpu mbig-endian-data
MULTILIB_DIRNAMES = 64-bit-double no-fpu-libs big-endian-data
MULTILIB_MATCHES = nofpu=mnofpu nofpu=mcpu?rx200 nofpu=mcpu?RX200
MULTILIB_MATCHES = nofpu=mnofpu nofpu=mcpu?rx200
MULTILIB_EXCEPTIONS =
MULTILIB_EXTRA_OPTS =

View File

@ -257,6 +257,11 @@ option handler. @code{UInteger} should also be used on options like
@code{-falign-loops}=@var{n} are supported to make sure the saved
options are given a full integer.
@item ToLower
The option's argument should be converted to lowercase as part of
putting it in canonical form, and before comparing with the strings
indicated by any @code{Enum} property.
@item NoDriverArg
For an option marked @code{Separate}, the option only takes an
argument in the compiler proper, not in the driver. This is for

View File

@ -126,6 +126,7 @@ function switch_bit_fields (flags)
flag_init("RejectNegative", flags) \
flag_init("JoinedOrMissing", flags) \
flag_init("UInteger", flags) \
flag_init("ToLower", flags) \
flag_init("Report", flags)
sub(", $", "", result)

View File

@ -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)
{

View File

@ -96,6 +96,8 @@ struct cl_option
BOOL_BITFIELD cl_missing_ok : 1;
/* Argument is an integer >=0. */
BOOL_BITFIELD cl_uinteger : 1;
/* Argument should be converted to lowercase. */
BOOL_BITFIELD cl_tolower : 1;
/* Report argument with -fverbose-asm */
BOOL_BITFIELD cl_report : 1;
/* Offset of field for this option in struct gcc_options, or