return "0, CLVC_STRING, 0"
if (flag_set_p("ByteSize", flags))
return "0, CLVC_SIZE, 0"
- return "0, CLVC_BOOLEAN, 0"
+ return "0, CLVC_INTEGER, 0"
}
# Given that an option called NAME has flags FLAGS, return an initializer
switch (option->var_type)
{
- case CLVC_BOOLEAN:
+ case CLVC_INTEGER:
if (option->cl_host_wide_int)
{
*(HOST_WIDE_INT *) flag_var = value;
}
/* Return 1 if option OPT_IDX is enabled in OPTS, 0 if it is disabled,
- or -1 if it isn't a simple on-off switch. */
+ or -1 if it isn't a simple on-off switch
+ (or if the value is unknown, typically set later in target). */
int
option_enabled (int opt_idx, unsigned lang_mask, void *opts)
if (flag_var)
switch (option->var_type)
{
- case CLVC_BOOLEAN:
+ case CLVC_INTEGER:
if (option->cl_host_wide_int)
- return *(HOST_WIDE_INT *) flag_var != 0;
+ {
+ HOST_WIDE_INT v = *(HOST_WIDE_INT *) flag_var;
+ return v != 0 ? (v < 0 ? -1 : 1) : 0;
+ }
else
- return *(int *) flag_var != 0;
+ {
+ int v = *(int *) flag_var;
+ return v != 0 ? (v < 0 ? -1 : 1) : 0;
+ }
case CLVC_EQUAL:
if (option->cl_host_wide_int)
switch (cl_options[option].var_type)
{
- case CLVC_BOOLEAN:
+ case CLVC_INTEGER:
case CLVC_EQUAL:
case CLVC_SIZE:
state->data = flag_var;
const struct cl_option *option = &cl_options[opt_index];
/* -Werror=foo implies -Wfoo. */
- if (option->var_type == CLVC_BOOLEAN
+ if (option->var_type == CLVC_INTEGER
|| option->var_type == CLVC_ENUM
|| option->var_type == CLVC_SIZE)
{
/* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */
enum cl_var_type {
- /* The switch is enabled when FLAG_VAR is nonzero. */
- CLVC_BOOLEAN,
+ /* The switch is an integer value. */
+ CLVC_INTEGER,
/* The switch is enabled when FLAG_VAR == VAR_VALUE. */
CLVC_EQUAL,