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/opt-functions.awk | |
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/opt-functions.awk')
-rw-r--r-- | gcc/opt-functions.awk | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index 945eeb15418..1f582fb4a16 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -110,6 +110,11 @@ function switch_flags (flags) # Return bit-field initializers for option flags FLAGS. function switch_bit_fields (flags) { + vn = var_name(flags); + if (host_wide_int[vn] == "yes") + hwi = "Host_Wide_Int" + else + hwi = "" result = "" sep_args = opt_args("Args", flags) if (sep_args == "") @@ -126,6 +131,7 @@ function switch_bit_fields (flags) flag_init("RejectNegative", flags) \ flag_init("JoinedOrMissing", flags) \ flag_init("UInteger", flags) \ + flag_init("Host_Wide_Int", hwi) \ flag_init("ToLower", flags) \ flag_init("Report", flags) @@ -140,6 +146,17 @@ function var_name(flags) return nth_arg(0, opt_args("Var", flags)) } +# Return the name of the variable if FLAGS has a HOST_WIDE_INT variable. +# Return the empty string otherwise. +function host_wide_int_var_name(flags) +{ + split (flags, array, "[ \t]+") + if (array[1] == "HOST_WIDE_INT") + return array[2] + else + return "" +} + # Return true if the option described by FLAGS has a globally-visible state. function global_state_p(flags) { @@ -197,8 +214,12 @@ function var_type_struct(flags) return enum_type[en] " " } else if (!flag_set_p("Joined.*", flags) && !flag_set_p("Separate", flags)) { - if (flag_set_p(".*Mask.*", flags)) - return "int " + if (flag_set_p(".*Mask.*", flags)) { + if (host_wide_int[var_name(flags)] == "yes") + return "HOST_WIDE_INT " + else + return "int " + } else return "signed char " } |