From patchwork Wed Oct 12 18:12:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 119273 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 83282B6F75 for ; Thu, 13 Oct 2011 05:14:45 +1100 (EST) Received: (qmail 886 invoked by alias); 12 Oct 2011 18:14:42 -0000 Received: (qmail 876 invoked by uid 22791); 12 Oct 2011 18:14:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_XT X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Oct 2011 18:14:25 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p9CIEMaB006239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 12 Oct 2011 18:14:24 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p9CIELFB015901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Oct 2011 18:14:22 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p9CIEGcu005728; Wed, 12 Oct 2011 13:14:16 -0500 Received: from [192.168.1.4] (/79.52.211.215) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Oct 2011 11:14:16 -0700 Message-ID: <4E95D899.40808@oracle.com> Date: Wed, 12 Oct 2011 20:12:41 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Jason Merrill CC: "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch] PR 50594 (C++ front-end bits) References: <4E95797E.5040904@oracle.com> <4E9585A1.4090003@redhat.com> <4E958843.7060707@oracle.com> <4E958EB8.8080505@oracle.com> <4E95939C.5060903@oracle.com> <4E95D4C1.1010506@redhat.com> In-Reply-To: <4E95D4C1.1010506@redhat.com> 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 On 10/12/2011 07:56 PM, Jason Merrill wrote: > On 10/12/2011 09:18 AM, Paolo Carlini wrote: >> newattrs >> = build_tree_list (get_identifier ("alloc_size"), >> build_tree_list (NULL_TREE, integer_one_node)); >> + extvisattr = build_tree_list (get_identifier >> ("externally_visible"), >> + NULL_TREE); >> + newattrs = chainon (newattrs, extvisattr); > Instead of chainon you could build newattrs after extvisattr with > tree_cons. Yes. Like this? Paolo. ///////////////////// Index: decl.c =================================================================== --- decl.c (revision 179859) +++ decl.c (working copy) @@ -3654,7 +3654,7 @@ cxx_init_decl_processing (void) current_lang_name = lang_name_cplusplus; { - tree newattrs; + tree newattrs, extvisattr; tree newtype, deltype; tree ptr_ftype_sizetype; tree new_eh_spec; @@ -3684,12 +3684,15 @@ cxx_init_decl_processing (void) /* Ensure attribs.c is initialized. */ init_attributes (); - newattrs - = build_tree_list (get_identifier ("alloc_size"), - build_tree_list (NULL_TREE, integer_one_node)); + extvisattr = build_tree_list (get_identifier ("externally_visible"), + NULL_TREE); + newattrs = tree_cons (get_identifier ("alloc_size"), + build_tree_list (NULL_TREE, integer_one_node), + extvisattr); newtype = cp_build_type_attribute_variant (ptr_ftype_sizetype, newattrs); newtype = build_exception_variant (newtype, new_eh_spec); - deltype = build_exception_variant (void_ftype_ptr, empty_except_spec); + deltype = cp_build_type_attribute_variant (void_ftype_ptr, extvisattr); + deltype = build_exception_variant (deltype, empty_except_spec); push_cp_library_fn (NEW_EXPR, newtype); push_cp_library_fn (VEC_NEW_EXPR, newtype); global_delete_fndecl = push_cp_library_fn (DELETE_EXPR, deltype);