From patchwork Thu Nov 15 21:54:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 199438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6CB5F2C04F9 for ; Fri, 16 Nov 2012 08:57:18 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353621438; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Date:To:Subject:User-Agent: MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Tb1UgzK MDuZREYjGi/wS1X2X600=; b=DfhXjVRhAmt8K1Ie367mYpZ7LcLm+C5Ug0T9ZOe nYm02+zgIyjC50ywoA8cGobYVTTTGyRejHTSMC0rgznZ9QI8AEScBIvxlV/3utaY BRxIGLgk18EdXR2KOHfRrqZuB1Kzg4yK5DEAkvWcFPPK/sbBWfZcrGppUeTWPeoT 5Ob0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Date:To:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=X4gJztYnvubtvibREHgLJdo5xMlZRHfAAWHoDG8ac1QRxZjelbn5GwBTGznLZr b4/hpRkI1qLipeN5Ab+fa8ILLL8t4x0soLr6TKioPGulVwBi4QKvD8fzVNKYf9Zh rTymxSXbGF+VUf/55pHdbjknvhz4BBKxi8By36man+BNA=; Received: (qmail 11246 invoked by alias); 15 Nov 2012 21:54:27 -0000 Received: (qmail 11187 invoked by uid 22791); 15 Nov 2012 21:54:26 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gg0-f201.google.com (HELO mail-gg0-f201.google.com) (209.85.161.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 21:54:16 +0000 Received: by mail-gg0-f201.google.com with SMTP id i24so229540ggk.2 for ; Thu, 15 Nov 2012 13:54:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:to:subject:user-agent:mime-version:content-type :content-transfer-encoding:message-id:from:x-gm-message-state; bh=Ei9q/QVCklYTzYKDfri15jA71rzTPVj41VS10YUYsPM=; b=VdmXsnZY1dRHh0CBMi4IWNCriGbprIscUEZ1IYVanqcI/qeCWaHk4LVYxtA0jBKJpy yJfwyMyFep7ecXmCjpoX8VqCHPLmclo4CszMovK6/5ARHnm/mXhAPpk8mE1ulGobwAfH G334ied6UOtC2c09FcvbT2arKQxYT7JCJK1Onb7TpMDKMoSX3oAu86y9OYfQh5p2E0NX DIa499DFl7mQIsRlR6ym9jU+YMps8hHSZgblrj2kLRn0N7L5wuIZ/sipPjePwADTqwbD WvHvwVz0+XWXqcC5LU+DrmBFar50NVDPF16AmPFlwpxFgv03MuOwDu5y5A3HjcnO00Pg D32g== Received: by 10.236.35.110 with SMTP id t74mr1860962yha.7.1353016455933; Thu, 15 Nov 2012 13:54:15 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i63si1369561yhk.5.2012.11.15.13.54.15 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 15 Nov 2012 13:54:15 -0800 (PST) Received: from torture.tor.corp.google.com (torture.tor.corp.google.com [172.30.222.16]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 9C8DE100335; Thu, 15 Nov 2012 13:54:15 -0800 (PST) Received: by torture.tor.corp.google.com (Postfix, from userid 54752) id 4FB18C0916; Thu, 15 Nov 2012 16:54:15 -0500 (EST) Date: Thu, 15 Nov 2012 16:54:15 -0500 To: law@redhat.com, gcc-patches@gcc.gnu.org Subject: VEC re-write [patch 19/25] User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20121115215415.4FB18C0916@torture.tor.corp.google.com> From: dnovillo@google.com (Diego Novillo) X-Gm-Message-State: ALoCoQmoiDwGpxE4tIvJAKTZi1MbFthkHwxbZanMXzVm6G3+R6boVO121T4DkdJfJhcG0R01hJxqOVqFozrwhzWO0hRmdQyGlm1USHDzfZDa+5VaXMItYFm1Mlv05KfRAi2M+hVysb2d0txN8FuI10frlU5399x/dwVSkShlyCI9GUr1FDnlwnmJjPx3Phu0tsY0n9b4PMNN7WqEmV0TdadwqSX+gKrdeXqNp0X5G+9ZKv7ji+9BwGA= X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2012-11-15 Diego Novillo Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * config/pa/pa.c: Use new vec API in vec.h. diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index afcfd1a..8b93aa9 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -469,21 +469,22 @@ pa_option_override (void) { unsigned int i; cl_deferred_option *opt; - VEC(cl_deferred_option,heap) *vec - = (VEC(cl_deferred_option,heap) *) pa_deferred_options; + vec *v + = (vec *) pa_deferred_options; - FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt) - { - switch (opt->opt_index) - { - case OPT_mfixed_range_: - fix_range (opt->arg); - break; + if (v) + FOR_EACH_VEC_ELT (*v, i, opt) + { + switch (opt->opt_index) + { + case OPT_mfixed_range_: + fix_range (opt->arg); + break; - default: - gcc_unreachable (); - } - } + default: + gcc_unreachable (); + } + } /* Unconditional branches in the delay slot are not compatible with dwarf2 call frame information. There is no benefit in using this optimization @@ -4401,7 +4402,7 @@ hppa_pic_save_rtx (void) /* Vector of funcdef numbers. */ -static VEC(int,heap) *funcdef_nos; +static vec funcdef_nos; /* Output deferred profile counters. */ static void @@ -4410,20 +4411,20 @@ output_deferred_profile_counters (void) unsigned int i; int align, n; - if (VEC_empty (int, funcdef_nos)) + if (funcdef_nos.is_empty ()) return; switch_to_section (data_section); align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE); ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT)); - for (i = 0; VEC_iterate (int, funcdef_nos, i, n); i++) + for (i = 0; funcdef_nos.iterate (i, &n); i++) { targetm.asm_out.internal_label (asm_out_file, "LP", n); assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1); } - VEC_free (int, heap, funcdef_nos); + funcdef_nos.release (); } void @@ -4465,7 +4466,7 @@ hppa_profile_hook (int label_no) rtx count_label_rtx, addr, r24; char count_label_name[16]; - VEC_safe_push (int, heap, funcdef_nos, label_no); + funcdef_nos.safe_push (label_no); ASM_GENERATE_INTERNAL_LABEL (count_label_name, "LP", label_no); count_label_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (count_label_name)); @@ -9948,11 +9949,9 @@ typedef struct GTY(()) extern_symbol } extern_symbol; /* Define gc'd vector type for extern_symbol. */ -DEF_VEC_O(extern_symbol); -DEF_VEC_ALLOC_O(extern_symbol,gc); /* Vector of extern_symbol pointers. */ -static GTY(()) VEC(extern_symbol,gc) *extern_symbols; +static GTY(()) vec *extern_symbols; #ifdef ASM_OUTPUT_EXTERNAL_REAL /* Mark DECL (name NAME) as an external reference (assembler output @@ -9964,7 +9963,7 @@ pa_hpux_asm_output_external (FILE *file, tree decl, const char *name) { gcc_assert (file == asm_out_file); extern_symbol p = {decl, name}; - VEC_safe_push (extern_symbol, gc, extern_symbols, p); + vec_safe_push (extern_symbols, p); } /* Output text required at the end of an assembler file. @@ -9982,7 +9981,7 @@ pa_hpux_file_end (void) output_deferred_plabels (); - for (i = 0; VEC_iterate (extern_symbol, extern_symbols, i, p); i++) + for (i = 0; vec_safe_iterate (extern_symbols, i, &p); i++) { tree decl = p->decl; @@ -9991,7 +9990,7 @@ pa_hpux_file_end (void) ASM_OUTPUT_EXTERNAL_REAL (asm_out_file, decl, p->name); } - VEC_free (extern_symbol, gc, extern_symbols); + vec_free (extern_symbols); } #endif