+2018-03-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/83193
+ * common/config/arm/arm-common.c (arm_parse_arch_option_name):
+ Accept complain bool parameter. Only emit errors if it is true.
+ (arm_parse_cpu_option_name): Likewise.
+ (arm_target_thumb_only): Adjust callers of the above.
+ * config/arm/arm-protos.h (arm_parse_cpu_option_name): Adjust
+ prototype to take a default true bool parameter.
+ (arm_parse_arch_option_name): Likewise.
+
2018-03-09 David Malcolm <dmalcolm@redhat.com>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
if (arch)
{
const arch_option *arch_opt
- = arm_parse_arch_option_name (all_architectures, "-march", arch);
+ = arm_parse_arch_option_name (all_architectures, "-march", arch,
+ false);
if (arch_opt && !check_isa_bits_for (arch_opt->common.isa_bits,
isa_bit_notm))
else if (cpu)
{
const cpu_option *cpu_opt
- = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu);
+ = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu, false);
if (cpu_opt && !check_isa_bits_for (cpu_opt->common.isa_bits,
isa_bit_notm))
/* Parse the base component of a CPU selection in LIST. Return a
pointer to the entry in the architecture table. OPTNAME is the
name of the option we are parsing and can be used if a diagnostic
- is needed. */
+ is needed. If COMPLAIN is true (the default) emit error
+ messages and hints on invalid input. */
const cpu_option *
arm_parse_cpu_option_name (const cpu_option *list, const char *optname,
- const char *target)
+ const char *target, bool complain)
{
const cpu_option *entry;
const char *end = strchr (target, '+');
return entry;
}
- error_at (input_location, "unrecognized %s target: %s", optname, target);
- arm_print_hint_for_cpu_option (target, list);
+ if (complain)
+ {
+ error_at (input_location, "unrecognized %s target: %s", optname, target);
+ arm_print_hint_for_cpu_option (target, list);
+ }
return NULL;
}
/* Parse the base component of a CPU or architecture selection in
LIST. Return a pointer to the entry in the architecture table.
OPTNAME is the name of the option we are parsing and can be used if
- a diagnostic is needed. */
+ a diagnostic is needed. If COMPLAIN is true (the default) emit error
+ messages and hints on invalid input. */
const arch_option *
arm_parse_arch_option_name (const arch_option *list, const char *optname,
- const char *target)
+ const char *target, bool complain)
{
const arch_option *entry;
const char *end = strchr (target, '+');
return entry;
}
- error_at (input_location, "unrecognized %s target: %s", optname, target);
- arm_print_hint_for_arch_option (target, list);
+ if (complain)
+ {
+ error_at (input_location, "unrecognized %s target: %s", optname, target);
+ arm_print_hint_for_arch_option (target, list);
+ }
return NULL;
}
extern const cpu_option all_cores[];
const cpu_option *arm_parse_cpu_option_name (const cpu_option *, const char *,
- const char *);
+ const char *, bool = true);
const arch_option *arm_parse_arch_option_name (const arch_option *,
- const char *, const char *);
+ const char *, const char *, bool = true);
void arm_parse_option_features (sbitmap, const cpu_arch_option *,
const char *);