+2018-10-01 Tamar Christina <tamar.christina@arm.com>
+
+ * params.c (set_param_value):
+ Add index of parameter being validated.
+ * common/common-target.def (option_validate_param): New.
+ * common/common-targhooks.h (default_option_validate_param): New.
+ * common/common-targhooks.c (default_option_validate_param): New.
+ * doc/tm.texi.in (TARGET_OPTION_VALIDATE_PARAM): New.
+ * doc/tm.texi: Regenerate.
+
2018-10-01 Tamar Christina <tamar.christina@arm.com>
PR target/86486
void, (void),
hook_void_void)
+DEFHOOK
+(option_validate_param,
+"Validate target-dependent value for @option{--param} settings, using\
+ calls to @code{set_param_value}.",
+ bool, (int, int),
+ default_option_validate_param)
+
/* The initial value of target_flags. */
DEFHOOKPOD
(default_target_flags,
return vec<const char *> ();
}
+/* Default version of TARGET_OPTION_VALIDATE_PARAM. */
+
+bool
+default_option_validate_param (const int value ATTRIBUTE_UNUSED,
+ const int param ATTRIBUTE_UNUSED)
+{
+ return true;
+}
+
const struct default_options empty_optimization_table[] =
{
{ OPT_LEVELS_NONE, 0, NULL, 0 }
location_t);
extern vec<const char *> default_get_valid_option_values (int, const char *);
+extern bool default_option_validate_param (const int, const int);
+
extern const struct default_options empty_optimization_table[];
#endif
Set target-dependent default values for @option{--param} settings, using calls to @code{set_default_param_value}.
@end deftypefn
+@deftypefn {Common Target Hook} bool TARGET_OPTION_VALIDATE_PARAM (int, @var{int})
+Validate target-dependent value for @option{--param} settings, using calls to @code{set_param_value}.
+@end deftypefn
+
@defmac SWITCHABLE_TARGET
Some targets need to switch between substantially different subtargets
during compilation. For example, the MIPS target has one subtarget for
@hook TARGET_OPTION_DEFAULT_PARAMS
+@hook TARGET_OPTION_VALIDATE_PARAM
+
@defmac SWITCHABLE_TARGET
Some targets need to switch between substantially different subtargets
during compilation. For example, the MIPS target has one subtarget for
error ("maximum value of parameter %qs is %u",
compiler_params[i].option,
compiler_params[i].max_value);
- else
+ else if (targetm_common.option_validate_param (value, (int)i))
set_param_value_internal ((compiler_param) i, value,
params, params_set, true);
}