From patchwork Wed Jan 29 21:28:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 315229 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F35FB2C00D2 for ; Thu, 30 Jan 2014 08:29:01 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=AESYQbjCRDAnRQz2R Kv7r52Hck5uSMYYtexXVcVRc+fhOs+++DcdSwowDXxwoDHqVOwrqbNu3hiE8OlEp CRh24ul9Q7Lurc4B31bTf/8ibjNvmqFw9cPFwDwxAnzfvwAENXWZXfeWN5gxUHKX P3Zmi/xUHuiff6HSaXwO5TVj8Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=R/Y09I3mjiVZ0Ogsvmm9ujH tOEQ=; b=sP+XyFRG6pL/RyKf7ioOUP4s+pmiz15/6jffAN43rGnbrAhD14WBnw2 6xkTVGfXhAtDDX9EWCszWKl265JBy3wiXZjqHnhutZ75tgYPvPmjZyJGqph2Hgl4 6VQ9e2Bj74skOjp+jBkW7JkV+MH790jjjo8ke9rGSNNkBqIl0/hc= Received: (qmail 22114 invoked by alias); 29 Jan 2014 21:28:52 -0000 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 Received: (qmail 21991 invoked by uid 89); 29 Jan 2014 21:28:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 29 Jan 2014 21:28:50 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0TLSjWK027665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 29 Jan 2014 21:28:47 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0TLSjL1003790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 29 Jan 2014 21:28:45 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0TLSi5F003781; Wed, 29 Jan 2014 21:28:45 GMT Received: from [192.168.1.4] (/79.52.211.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Jan 2014 13:28:44 -0800 Message-ID: <52E9728A.6060503@oracle.com> Date: Wed, 29 Jan 2014 22:28:42 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Jason Merrill , gcc-patches List Subject: Re: C++ PATCH for c++/53756 (-g and C++1y auto) References: <52E7E353.3020604@redhat.com> <52E7F80B.7000202@oracle.com> <52E81B01.6090401@redhat.com> <52E8229D.8010502@oracle.com> <52E92F89.7070304@redhat.com> <52E930CD.4020502@oracle.com> <52E933B5.5070601@redhat.com> <52E93F3D.9000204@oracle.com> <52E96942.2000405@redhat.com> In-Reply-To: <52E96942.2000405@redhat.com> X-IsSubscribed: yes Hi, On 01/29/2014 09:49 PM, Jason Merrill wrote: > OK, thanks. Applied. >> By the way, when I said 3/4 uses (in fact, at least 4 in the file), I >> meant the pattern: >> >> tree name = TYPE_NAME (type); >> if (TREE_CODE (name) == TYPE_DECL) >> name = DECL_NAME (name); >> >> which I noticed yesterday. Could be a new macro? (post 4.9 maybe) > > Sure. Maybe call it TYPE_IDENTIFIER, replacing the one in cp-tree.h > with a conditional one in tree.h. Interesting. If you like we can do now the below, as preparatory clean-up for the above, which I would do when 4.9 branches. Thanks, Paolo. ///////////////////// 2014-01-29 Paolo Carlini * decl.c (duplicate_decls, typename_hash, typename_compare): Use TYPE_IDENTIFIER. * error.c (dump_type): Likewise. * mangle.c (dump_substitution_candidates): Likewise. Index: decl.c =================================================================== --- decl.c (revision 207281) +++ decl.c (working copy) @@ -1381,7 +1381,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool if (TYPE_PTR_P (t) && TYPE_NAME (TREE_TYPE (t)) - && DECL_NAME (TYPE_NAME (TREE_TYPE (t))) + && TYPE_IDENTIFIER (TREE_TYPE (t)) == get_identifier ("FILE") && compparms (TREE_CHAIN (t1), TREE_CHAIN (t2))) { @@ -3213,7 +3213,7 @@ typename_hash (const void* k) const_tree const t = (const_tree) k; hash = (htab_hash_pointer (TYPE_CONTEXT (t)) - ^ htab_hash_pointer (DECL_NAME (TYPE_NAME (t)))); + ^ htab_hash_pointer (TYPE_IDENTIFIER (t))); return hash; } @@ -3235,7 +3235,7 @@ typename_compare (const void * k1, const void * k2 const_tree const t1 = (const_tree) k1; const typename_info *const t2 = (const typename_info *) k2; - return (DECL_NAME (TYPE_NAME (t1)) == t2->name + return (TYPE_IDENTIFIER (t1) == t2->name && TYPE_CONTEXT (t1) == t2->scope && TYPENAME_TYPE_FULLNAME (t1) == t2->template_id && TYPENAME_IS_ENUM_P (t1) == t2->enum_p Index: error.c =================================================================== --- error.c (revision 207281) +++ error.c (working copy) @@ -512,7 +512,7 @@ dump_type (cxx_pretty_printer *pp, tree t, int fla pp_cxx_colon_colon (pp); } pp_cxx_ws_string (pp, "template"); - dump_type (pp, DECL_NAME (TYPE_NAME (t)), flags); + dump_type (pp, TYPE_IDENTIFIER (t), flags); break; case TYPEOF_TYPE: Index: mangle.c =================================================================== --- mangle.c (revision 207281) +++ mangle.c (working copy) @@ -323,7 +323,7 @@ dump_substitution_candidates (void) else if (TREE_CODE (el) == TREE_LIST) name = IDENTIFIER_POINTER (DECL_NAME (TREE_VALUE (el))); else if (TYPE_NAME (el)) - name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (el))); + name = IDENTIFIER_POINTER (TYPE_IDENTIFIER (el)); fprintf (stderr, " S%d_ = ", i - 1); if (TYPE_P (el) && (CP_TYPE_RESTRICT_P (el)