diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-18 14:52:06 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-18 14:52:06 +0000 |
commit | 72ec6882af0cdd2dbb64e0019806cabdd9302b58 (patch) | |
tree | 281491eb9469913e27f7aa1d7338b708f181d46f /gcc/opts-common.c | |
parent | 16a1895e10389a1d54c67d23f32999ac2cbc556d (diff) | |
download | gcc-72ec6882af0cdd2dbb64e0019806cabdd9302b58.tar.gz |
Allow HOST_WIDE_INT for option variable.
2011-08-18 H.J. Lu <hongjiu.lu@intel.com>
Igor Zamyatin <igor.zamyatin@intel.com>
* hwint.h (HOST_WIDE_INT_1): New.
* opt-functions.awk (switch_bit_fields): Initialize the
host_wide_int field.
(host_wide_int_var_name): New.
(var_type_struct): Check and return HOST_WIDE_INT.
* opt-read.awk: Handle HOST_WIDE_INT for "Variable".
* optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other.
* opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly
check masks for HOST_WIDE_INT.
* opts-common.c (set_option): Support HOST_WIDE_INT flag_var.
(option_enabled): Likewise.
(get_option_state): Likewise.
* opts.h (cl_option): Add cl_host_wide_int. Change var_value
to HOST_WIDE_INT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts-common.c')
-rw-r--r-- | gcc/opts-common.c | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 973dd7e97e7..0b86764cd79 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -1088,9 +1088,14 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set, break; case CLVC_EQUAL: - *(int *) flag_var = (value - ? option->var_value - : !option->var_value); + if (option->cl_host_wide_int) + *(HOST_WIDE_INT *) flag_var = (value + ? option->var_value + : !option->var_value); + else + *(int *) flag_var = (value + ? option->var_value + : !option->var_value); if (set_flag_var) *(int *) set_flag_var = 1; break; @@ -1098,11 +1103,26 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set, case CLVC_BIT_CLEAR: case CLVC_BIT_SET: if ((value != 0) == (option->var_type == CLVC_BIT_SET)) - *(int *) flag_var |= option->var_value; + { + if (option->cl_host_wide_int) + *(HOST_WIDE_INT *) flag_var |= option->var_value; + else + *(int *) flag_var |= option->var_value; + } else - *(int *) flag_var &= ~option->var_value; + { + if (option->cl_host_wide_int) + *(HOST_WIDE_INT *) flag_var &= ~option->var_value; + else + *(int *) flag_var &= ~option->var_value; + } if (set_flag_var) - *(int *) set_flag_var |= option->var_value; + { + if (option->cl_host_wide_int) + *(HOST_WIDE_INT *) set_flag_var |= option->var_value; + else + *(int *) set_flag_var |= option->var_value; + } break; case CLVC_STRING: @@ -1173,13 +1193,22 @@ option_enabled (int opt_idx, void *opts) return *(int *) flag_var != 0; case CLVC_EQUAL: - return *(int *) flag_var == option->var_value; + if (option->cl_host_wide_int) + return *(HOST_WIDE_INT *) flag_var == option->var_value; + else + return *(int *) flag_var == option->var_value; case CLVC_BIT_CLEAR: - return (*(int *) flag_var & option->var_value) == 0; + if (option->cl_host_wide_int) + return (*(HOST_WIDE_INT *) flag_var & option->var_value) == 0; + else + return (*(int *) flag_var & option->var_value) == 0; case CLVC_BIT_SET: - return (*(int *) flag_var & option->var_value) != 0; + if (option->cl_host_wide_int) + return (*(HOST_WIDE_INT *) flag_var & option->var_value) != 0; + else + return (*(int *) flag_var & option->var_value) != 0; case CLVC_STRING: case CLVC_ENUM: @@ -1206,7 +1235,9 @@ get_option_state (struct gcc_options *opts, int option, case CLVC_BOOLEAN: case CLVC_EQUAL: state->data = flag_var; - state->size = sizeof (int); + state->size = (cl_options[option].cl_host_wide_int + ? sizeof (HOST_WIDE_INT) + : sizeof (int)); break; case CLVC_BIT_CLEAR: |