From patchwork Thu Nov 15 21:53:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 199434 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 629FA2C0384 for ; Fri, 16 Nov 2012 08:56:24 +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=1353621384; 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=f6qZEsy Idpy0SwoY7aslOmakXjg=; b=u5sa3siXx6JAHtL8u0QKA+CwjPTohQxzpwI6NBT rWZq/NNdPL2tt1aiKZi6XMEtZov+HcpElZPTj8Sz1kY6d+28LxE6WyKNsHFMP76E OUjLOU/3c+nUWmCYcLqr066iGiU3+3F+p6gBQyEbKi3yvch6tU8yzkZk0PdfM6SB mtSo= 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=m+rwxxWg5EynPu/5/ORBpjZYI3i4sKmuWct2PT57f7JT/No5jPUmFEyhFoqAm2 94aTisBvj34+zxSsrTIZsept5uCMqxD7jeik328JZJRov/uYlE9NHQQ6AJroihUJ Qs/o84jnCMOTFsGjgq9+AmEkND/8qgwN74oKbrC+0y+VE=; Received: (qmail 10775 invoked by alias); 15 Nov 2012 21:54:19 -0000 Received: (qmail 10702 invoked by uid 22791); 15 Nov 2012 21:54:16 -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-yh0-f73.google.com (HELO mail-yh0-f73.google.com) (209.85.213.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 21:54:02 +0000 Received: by mail-yh0-f73.google.com with SMTP id i33so230064yhi.2 for ; Thu, 15 Nov 2012 13:54:01 -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=6+pThIMZlS/7AlLaQnLCRhOqUBEArEHGAD/pHI0Yr94=; b=S3mkV0lP2A5Fhft3cB/cfp49RLcBCMxVn+97w7lMOGdEpybbJC1UATaIml8MMdeBqy qJRXkz1Tzp4uGuZBtOUlWyfUhYNfnTSFdjD8belC9lmN+kB4u36Xj+WX8PDdjaokk5kg YEeUy3UPBwbAlpwsKgD4xYSQLiOlWWmGt15pA3alCxhVOwVmJmgSFMNu2l33Y/SjXpWi /ZM5l7RxvCMsxVa0u6TfmxsPbRohqD75VYx1Elinm81SnXsVGjvmeNZoZaC7BFw2XTUV EajnRPTRQIQ+VyBateeEttdqDJrGU6Gk0X4odD5OKbL3e1RLmNKM8ANW83cOhYqGd4Uh Bo3Q== Received: by 10.236.129.106 with SMTP id g70mr1686532yhi.49.1353016440814; Thu, 15 Nov 2012 13:54:00 -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 r6si1369323yhc.7.2012.11.15.13.54.00 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 15 Nov 2012 13:54:00 -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 7489E100314; Thu, 15 Nov 2012 13:54:00 -0800 (PST) Received: by torture.tor.corp.google.com (Postfix, from userid 54752) id EB905C0916; Thu, 15 Nov 2012 16:53:59 -0500 (EST) Date: Thu, 15 Nov 2012 16:53:59 -0500 To: echristo@gmail.com, gcc-patches@gcc.gnu.org Subject: VEC re-write [patch 14/25] User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20121115215359.EB905C0916@torture.tor.corp.google.com> From: dnovillo@google.com (Diego Novillo) X-Gm-Message-State: ALoCoQlRxPMtZs3B/UjQxzOnl6/6SnifEnRY1gA0Xcy+HFWzyC0Evg04Va2sjJyqcMG7EZXcf+s6wAWdQDwERr3JBLhqImMWf/DzUBO6INy4pvKhWXyep7LcjXyZPoGYNEK7XztNmbYckLR4Y85AZKzim90JgdkfbpXb7t9Sut6kmGbKoCQFXbB8iLZZlKtPnDs02WnvzkT54VazfoomU5YfcvwAQ2Q/vxM1cTBDIA+CI99ATy/wGYc= 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/darwin.c: Use new vec API in vec.h. diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index e56205b..6645270 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1791,10 +1791,8 @@ static unsigned int lto_section_num = 0; typedef struct GTY (()) darwin_lto_section_e { const char *sectname; } darwin_lto_section_e ; -DEF_VEC_O(darwin_lto_section_e); -DEF_VEC_ALLOC_O(darwin_lto_section_e, gc); -static GTY (()) VEC (darwin_lto_section_e, gc) * lto_section_names; +static GTY (()) vec *lto_section_names; /* Segment for LTO data. */ #define LTO_SEGMENT_NAME "__GNU_LTO" @@ -1877,8 +1875,8 @@ darwin_asm_named_section (const char *name, TODO: check that we do not revisit sections, that would break the assumption of how this is done. */ if (lto_section_names == NULL) - lto_section_names = VEC_alloc (darwin_lto_section_e, gc, 16); - VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e); + vec_alloc (lto_section_names, 16); + vec_safe_push (lto_section_names, e); } else if (strncmp (name, "__DWARF,", 8) == 0) darwin_asm_dwarf_section (name, flags, decl); @@ -2635,7 +2633,7 @@ darwin_assemble_visibility (tree decl, int vis) "not supported in this configuration; ignored"); } -/* VEC Used by darwin_asm_dwarf_section. +/* vec used by darwin_asm_dwarf_section. Maybe a hash tab would be better here - but the intention is that this is a very short list (fewer than 16 items) and each entry should (ideally, eventually) only be presented once. @@ -2648,11 +2646,9 @@ typedef struct GTY(()) dwarf_sect_used_entry { } dwarf_sect_used_entry; -DEF_VEC_O(dwarf_sect_used_entry); -DEF_VEC_ALLOC_O(dwarf_sect_used_entry, gc); /* A list of used __DWARF sections. */ -static GTY (()) VEC (dwarf_sect_used_entry, gc) * dwarf_sect_names_table; +static GTY (()) vec *dwarf_sect_names_table; /* This is called when we are asked to assemble a named section and the name begins with __DWARF,. We keep a list of the section names (without @@ -2675,10 +2671,10 @@ darwin_asm_dwarf_section (const char *name, unsigned int flags, namelen = strchr (sname, ',') - sname; gcc_assert (namelen); if (dwarf_sect_names_table == NULL) - dwarf_sect_names_table = VEC_alloc (dwarf_sect_used_entry, gc, 16); + vec_alloc (dwarf_sect_names_table, 16); else for (i = 0; - VEC_iterate (dwarf_sect_used_entry, dwarf_sect_names_table, i, ref); + dwarf_sect_names_table->iterate (i, &ref); i++) { if (!ref) @@ -2698,7 +2694,7 @@ darwin_asm_dwarf_section (const char *name, unsigned int flags, fprintf (asm_out_file, "Lsection%.*s:\n", namelen, sname); e.count = 1; e.name = xstrdup (sname); - VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e); + vec_safe_push (dwarf_sect_names_table, e); } } @@ -2813,7 +2809,7 @@ darwin_file_end (void) } /* Output the names and indices. */ - if (lto_section_names && VEC_length (darwin_lto_section_e, lto_section_names)) + if (lto_section_names && lto_section_names->length ()) { int count; darwin_lto_section_e *ref; @@ -2824,7 +2820,7 @@ darwin_file_end (void) /* Emit the names. */ fprintf (asm_out_file, "\t.section %s,%s,regular,debug\n", LTO_SEGMENT_NAME, LTO_NAMES_SECTION); - FOR_EACH_VEC_ELT (darwin_lto_section_e, lto_section_names, count, ref) + FOR_EACH_VEC_ELT (*lto_section_names, count, ref) { fprintf (asm_out_file, "L_GNU_LTO_NAME%d:\n", count); /* We have to jump through hoops to get the values of the intra-section @@ -2847,7 +2843,7 @@ darwin_file_end (void) fputs ("\t.align\t2\n", asm_out_file); fputs ("# Section offset, Section length, Name offset, Name length\n", asm_out_file); - FOR_EACH_VEC_ELT (darwin_lto_section_e, lto_section_names, count, ref) + FOR_EACH_VEC_ELT (*lto_section_names, count, ref) { fprintf (asm_out_file, "%s L$gnu$lto$offs%d\t;# %s\n", op, count, ref->sectname); @@ -3338,7 +3334,7 @@ darwin_build_constant_cfstring (tree str) if (!desc) { tree var, constructor, field; - VEC(constructor_elt,gc) *v = NULL; + vec *v = NULL; int length = TREE_STRING_LENGTH (str) - 1; if (darwin_warn_nonportable_cfstrings)