From patchwork Thu Nov 15 21:54:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 199442 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 174C02C04F9 for ; Fri, 16 Nov 2012 08:57:57 +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=1353621478; 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=D7CK35H NRPoYA4IkSSOXiTrkRKo=; b=YcV1V9CWCOtqKKQDkPEHqQm5Pvh1t2bH3zuuIiC sOMgGQcdeYA8izYw7O3moVXS9b2LFHg5FyZaLpbHsN8Wr3RDynK/hhR2wbxrfxQq Piw8l+cSac0c7Jy7/j6vwrw7kCHVkFrv4wiQkagf0YfOcjETFZFtK9ZZHy8I8QDt 1KkM= 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=gV0f/BVKsS2Mjt2IHX0036XkVlPa2IxwkrWL8nK6wMazZrOLxmtNHsMZfaGydP Ehqofyg3eEVsWbxfgkWQRafnGALk7wIIfsKaryiclPf/P94a7c+xS/mpcf8ONPRR /YxXakt+KDlROMNx+1ppbQvTvEW0H6h9By6aDhzIm6HW4=; Received: (qmail 11702 invoked by alias); 15 Nov 2012 21:54:37 -0000 Received: (qmail 11574 invoked by uid 22791); 15 Nov 2012 21:54:36 -0000 X-SWARE-Spam-Status: No, hits=-4.4 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, TW_DB X-Spam-Check-By: sourceware.org Received: from mail-wi0-f201.google.com (HELO mail-wi0-f201.google.com) (209.85.212.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 21:54:29 +0000 Received: by mail-wi0-f201.google.com with SMTP id hm2so137591wib.2 for ; Thu, 15 Nov 2012 13:54:28 -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=z7NcsDfvwrGiBIu41nm9H8PbZaxX9wSMcZdxYhBHxfI=; b=Y4G0zASlLv2rv8dbS/A4POzq6oZQMdgniYgPHzJjjJsXntx7uIzQ+F/fCbIMtHPxpl 7vIeVAzesn8ZOurl0WByxCLjpEbi4I6RoxhS1dv1UyeVdntS+qfUPYqm5FV18duqDhjN RFDMj+Iwm+VBGJMYwZi9G72Fa9ZGLf3XYuYccCtDuj45ieNn0Q3Gc15Lapk1TaVaH4Vx KJmgVFphWvd0Wsxbmepza6BEOtze0lWk3gC989M+McDMbSwFrNJ99rphuXPHK3AhbUHv AbcryVdsJUiJKWGAUX6NsyPxndEm6s9ZW6BZapYstfwMKHMB5/2sBHnXlY/H0KVU2u/P G4BQ== Received: by 10.14.215.136 with SMTP id e8mr3299131eep.6.1353016468562; Thu, 15 Nov 2012 13:54:28 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si4117377een.1.2012.11.15.13.54.28 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 15 Nov 2012 13:54:28 -0800 (PST) Received: from torture.tor.corp.google.com (torture.tor.corp.google.com [172.30.222.16]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 199372000E9; Thu, 15 Nov 2012 13:54:28 -0800 (PST) Received: by torture.tor.corp.google.com (Postfix, from userid 54752) id 8E215C0916; Thu, 15 Nov 2012 16:54:27 -0500 (EST) Date: Thu, 15 Nov 2012 16:54:27 -0500 To: gingold@adacore.com, gcc-patches@gcc.gnu.org Subject: VEC re-write [patch 23/25] User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20121115215427.8E215C0916@torture.tor.corp.google.com> From: dnovillo@google.com (Diego Novillo) X-Gm-Message-State: ALoCoQnjpTcJt99BndPlKywDugPLFRSyIqroNps5kXCUBMoDD0NmAIWsqt7WqkhVRPZqsf+7yylZm4poeVe7IZKS3akm7K9fkRVLTyU9De8LKX6VBDYWR8Ub6BFpeQTK/Jubx3WXvXxPiaCmQBpQDNnlWognx4LjrIK8hjEUa2dTgrlnTa5konaEeczAXY2FbS8dnUm5zi0Z 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/vms/vms.c: Use new vec API in vec.h. * vmsdbgout.c: Likewise. diff --git a/gcc/config/vms/vms.c b/gcc/config/vms/vms.c index d23e8a8..65bf42a 100644 --- a/gcc/config/vms/vms.c +++ b/gcc/config/vms/vms.c @@ -101,7 +101,7 @@ static const struct vms_crtl_name vms_crtl_names[] = /* List of aliased identifiers. They must be persistent across gc. */ -static GTY(()) VEC(tree,gc) *aliases_id; +static GTY(()) vec *aliases_id; /* Add a CRTL translation. This simply use the transparent alias mechanism, which is platform independent and works with the @@ -120,7 +120,7 @@ vms_add_crtl_xlat (const char *name, size_t nlen, IDENTIFIER_TRANSPARENT_ALIAS (targ) = 1; TREE_CHAIN (targ) = get_identifier_with_length (id_str, id_len); - VEC_safe_push (tree, gc, aliases_id, targ); + vec_safe_push (aliases_id, targ); } /* Do VMS specific stuff on builtins: disable the ones that are not diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c index 5472ac5..cb8479f 100644 --- a/gcc/vmsdbgout.c +++ b/gcc/vmsdbgout.c @@ -101,11 +101,9 @@ static unsigned int file_info_table_in_use; #define FILE_TABLE_INCREMENT 64 typedef char *char_p; -DEF_VEC_P(char_p); -DEF_VEC_ALLOC_P(char_p,heap); -static VEC(char_p,heap) *funcnam_table; -static VEC(unsigned,heap) *funcnum_table; +static vec funcnam_table; +static vec funcnum_table; #define FUNC_TABLE_INITIAL 256 /* Local pointer to the name of the main input file. Initialized in @@ -641,7 +639,7 @@ write_rtnbeg (int rtnnum, int dosizeonly) DST_ROUTINE_BEGIN rtnbeg; DST_PROLOG prolog; - rtnname = VEC_index (char_p, funcnam_table, rtnnum); + rtnname = funcnam_table[rtnnum]; rtnnamelen = strlen (rtnname); rtnentryname = concat (rtnname, "..en", NULL); @@ -714,7 +712,7 @@ write_rtnbeg (int rtnnum, int dosizeonly) ASM_GENERATE_INTERNAL_LABEL (label, FUNC_PROLOG_LABEL, - VEC_index (unsigned, funcnum_table, rtnnum)); + funcnum_table[rtnnum]); totsize += write_debug_addr (label, "prolog breakpoint addr", dosizeonly); } @@ -748,10 +746,10 @@ write_rtnend (int rtnnum, int dosizeonly) ASM_GENERATE_INTERNAL_LABEL (label1, FUNC_BEGIN_LABEL, - VEC_index (unsigned, funcnum_table, rtnnum)); + funcnum_table[rtnnum]); ASM_GENERATE_INTERNAL_LABEL (label2, FUNC_END_LABEL, - VEC_index (unsigned, funcnum_table, rtnnum)); + funcnum_table[rtnnum]); totsize += write_debug_delta4 (label2, label1, "routine size", dosizeonly); return totsize; @@ -1264,9 +1262,8 @@ vmsdbgout_begin_function (tree decl) (*dwarf2_debug_hooks.begin_function) (decl); /* Add the new entry to the end of the function name table. */ - VEC_safe_push (char_p, heap, funcnam_table, xstrdup (name)); - VEC_safe_push (unsigned, heap, funcnum_table, - current_function_funcdef_no); + funcnam_table.safe_push (xstrdup (name)); + funcnum_table.safe_push (current_function_funcdef_no); } static char fullname_buff [4096]; @@ -1447,8 +1444,8 @@ vmsdbgout_init (const char *filename) /* Skip the first entry - file numbers begin at 1. */ file_info_table_in_use = 1; - funcnam_table = VEC_alloc (char_p, heap, FUNC_TABLE_INITIAL); - funcnum_table = VEC_alloc (unsigned, heap, FUNC_TABLE_INITIAL); + funcnam_table.create (FUNC_TABLE_INITIAL); + funcnum_table.create (FUNC_TABLE_INITIAL); /* Allocate the initial hunk of the line_info_table. */ line_info_table = XCNEWVEC (dst_line_info_entry, LINE_INFO_TABLE_INCREMENT); @@ -1564,7 +1561,7 @@ vmsdbgout_finish (const char *filename ATTRIBUTE_UNUSED) ASM_OUTPUT_ALIGN (asm_out_file, 0); totsize = write_modbeg (1); - FOR_EACH_VEC_ELT (unsigned, funcnum_table, i, ifunc) + FOR_EACH_VEC_ELT (funcnum_table, i, ifunc) { totsize += write_rtnbeg (i, 1); totsize += write_rtnend (i, 1); @@ -1572,7 +1569,7 @@ vmsdbgout_finish (const char *filename ATTRIBUTE_UNUSED) totsize += write_pclines (1); write_modbeg (0); - FOR_EACH_VEC_ELT (unsigned, funcnum_table, i, ifunc) + FOR_EACH_VEC_ELT (funcnum_table, i, ifunc) { write_rtnbeg (i, 0); write_rtnend (i, 0);