From patchwork Tue Jan 10 17:03:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 135265 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 9E4D2B6FCA for ; Wed, 11 Jan 2012 04:04:08 +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=1326819849; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC: Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=RdQt4kSNC9RWEmtLhGB7nkynTB8=; b=eGC4csgzgl8/9iWgGTDBGJ5pAN7AHUgsnCyL3D4nC4Xqzf1rUguRnNmoqwBREl Zvl85PEwXwVIbednQ2m1hyu2xnyelbeYKSabTqpMLJ/WX4A4dd/SG3AcQ7U/ynUI v2cNlFQXWc7lKh+C+9X5LjsG2xLziypSPzWo1n4kVzEmA= 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:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=vnO104Z33Czvr1d37H4Yl8UdEvr+yMnXfh+pFsDfVlad6MTEiYTRHP3DUd6J/0 5MkkyAGbhG4gMmk4kZv5h2AECLxDUr5K7JLztn8IbcXkUd4/5EGLeYmujXWnr1Mx tpZIJEbqO0u3Cl4uVa538Dmsbvvn5nwuYJwFhsPvw3SXo=; Received: (qmail 31051 invoked by alias); 10 Jan 2012 17:04:02 -0000 Received: (qmail 31036 invoked by uid 22791); 10 Jan 2012 17:04:00 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jan 2012 17:03:46 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0AH3ktx025474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 10 Jan 2012 12:03:46 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0AH3kFZ016899; Tue, 10 Jan 2012 12:03:46 -0500 Received: from [0.0.0.0] (ovpn-113-115.phx2.redhat.com [10.3.113.115]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q0AH3iQv001274; Tue, 10 Jan 2012 12:03:45 -0500 Message-ID: <4F0C6F70.4040500@redhat.com> Date: Tue, 10 Jan 2012 12:03:44 -0500 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: gcc-patches List CC: Keith Seitz Subject: Re: C++/libiberty PATCH for many mangling fixes (6057, 48051, 50855, 51322 and more) References: <4F0769D4.2070802@redhat.com> In-Reply-To: <4F0769D4.2070802@redhat.com> 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 Keith pointed out that my demangler changes changed the demangling of overloaded operator delete; this patch corrects that. Tested x86_64-pc-linux-gnu, applying to trunk. commit ee8af40f38391d44549cf96b159dcb00821c2074 Author: Jason Merrill Date: Tue Jan 10 11:16:46 2012 -0500 * cp-demangle.c (d_print_comp) [DEMANGLE_COMPONENT_OPERATOR]: Omit a trailing space in the operator name. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 2dfd67c..18b84a1 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -4357,14 +4357,17 @@ d_print_comp (struct d_print_info *dpi, int options, case DEMANGLE_COMPONENT_OPERATOR: { - char c; + const struct demangle_operator_info *op = dc->u.s_operator.op; + int len = op->len; d_append_string (dpi, "operator"); - c = dc->u.s_operator.op->name[0]; - if (IS_LOWER (c)) + /* Add a space before new/delete. */ + if (IS_LOWER (op->name[0])) d_append_char (dpi, ' '); - d_append_buffer (dpi, dc->u.s_operator.op->name, - dc->u.s_operator.op->len); + /* Omit a trailing space. */ + if (op->name[len-1] == ' ') + --len; + d_append_buffer (dpi, op->name, len); return; } diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 3f3960a..408c4f4 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4058,6 +4058,9 @@ decltype ((::delete {parm#1}),(+{parm#1})) f(int*) _Z1fIiEDTcmdafp_psfp_EPT_ decltype ((delete[] {parm#1}),(+{parm#1})) f(int*) --format=gnu-v3 +_ZN1AdlEPv +A::operator delete(void*) +--format=gnu-v3 _Z2f1IiEDTppfp_ET_ decltype ({parm#1}++) f1(int) --format=gnu-v3