+2011-03-22 Joseph Myers <joseph@codesourcery.com>
+
+ * config/score/score.c (score_handle_option): Don't assert that
+ global structures are in use. Access target_flags via opts
+ pointer. Use value of -march= option to determine target_flags
+ settings.
+ * config/score/score.opt (march=): Use Enum.
+ (score_arch): New Enum and EnumValue entries.
+
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/mep/mep.c (option_mtiny_specified): Remove.
/* Implement TARGET_HANDLE_OPTION. */
static bool
-score_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+score_handle_option (struct gcc_options *opts,
+ struct gcc_options *opts_set ATTRIBUTE_UNUSED,
const struct cl_decoded_option *decoded,
location_t loc ATTRIBUTE_UNUSED)
{
size_t code = decoded->opt_index;
- const char *arg = decoded->arg;
-
- gcc_assert (opts == &global_options);
- gcc_assert (opts_set == &global_options_set);
+ int value = decoded->value;
switch (code)
{
case OPT_mscore7d:
- target_flags &= ~(MASK_ALL_CPU_BITS);
- target_flags |= MASK_SCORE7 | MASK_SCORE7D;
+ opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
+ opts->x_target_flags |= MASK_SCORE7 | MASK_SCORE7D;
return true;
case OPT_march_:
- if (strcmp (arg, "score7") == 0)
- {
- target_flags &= ~(MASK_ALL_CPU_BITS);
- target_flags |= MASK_SCORE7;
- return true;
- }
- else if (strcmp (arg, "score7d") == 0)
- {
- target_flags &= ~(MASK_ALL_CPU_BITS);
- target_flags |= MASK_SCORE7 | MASK_SCORE7D;
- return true;
- }
- else
- return false;
+ opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
+ opts->x_target_flags |= value;
+ return true;
default:
return true;
; Options for the Sunnorth port of the compiler.
-; Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
Support SCORE 7D ISA
march=
-Target RejectNegative Joined
+Target RejectNegative Joined Enum(score_arch)
Specify the name of the target architecture
+
+Enum
+Name(score_arch) Type(int)
+Known SCORE architectures (for use with the -march= option):
+
+EnumValue
+Enum(score_arch) String(score7) Value(MASK_SCORE7)
+
+EnumValue
+Enum(score_arch) String(score7d) Value(MASK_SCORE7 | MASK_SCORE7D)