From patchwork Thu Nov 15 21:54:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: VEC re-write [patch 21/25] X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 199439 Message-Id: <20121115215421.70D54C0916@torture.tor.corp.google.com> To: nickc@redhat.com, gcc-patches@gcc.gnu.org Date: Thu, 15 Nov 2012 16:54:21 -0500 From: dnovillo@google.com (Diego Novillo) List-Id: 2012-11-15 Diego Novillo Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * config/rx/rx.c: Use new vec API in vec.h. diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 5d31eac..8cd9253 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -2614,43 +2614,43 @@ rx_option_override (void) { unsigned int i; cl_deferred_option *opt; - VEC(cl_deferred_option,heap) *vec - = (VEC(cl_deferred_option,heap) *) rx_deferred_options; + vec *v = (vec *) rx_deferred_options; - FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt) - { - switch (opt->opt_index) - { - case OPT_mint_register_: - switch (opt->value) - { - case 4: - fixed_regs[10] = call_used_regs [10] = 1; - /* Fall through. */ - case 3: - fixed_regs[11] = call_used_regs [11] = 1; - /* Fall through. */ - case 2: - fixed_regs[12] = call_used_regs [12] = 1; - /* Fall through. */ - case 1: - fixed_regs[13] = call_used_regs [13] = 1; - /* Fall through. */ - case 0: - rx_num_interrupt_regs = opt->value; - break; - default: - rx_num_interrupt_regs = 0; - /* Error message already given because rx_handle_option - returned false. */ - break; - } - break; + if (v) + FOR_EACH_VEC_ELT (*v, i, opt) + { + switch (opt->opt_index) + { + case OPT_mint_register_: + switch (opt->value) + { + case 4: + fixed_regs[10] = call_used_regs [10] = 1; + /* Fall through. */ + case 3: + fixed_regs[11] = call_used_regs [11] = 1; + /* Fall through. */ + case 2: + fixed_regs[12] = call_used_regs [12] = 1; + /* Fall through. */ + case 1: + fixed_regs[13] = call_used_regs [13] = 1; + /* Fall through. */ + case 0: + rx_num_interrupt_regs = opt->value; + break; + default: + rx_num_interrupt_regs = 0; + /* Error message already given because rx_handle_option + returned false. */ + break; + } + break; - default: - gcc_unreachable (); - } - } + default: + gcc_unreachable (); + } + } /* This target defaults to strict volatile bitfields. */ if (flag_strict_volatile_bitfields < 0 && abi_version_at_least(2))