From patchwork Fri May 15 08:47:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1290956 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=RVH6vCLp; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Nhry4Wv0z9sTM for ; Fri, 15 May 2020 18:48:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF522386F82C; Fri, 15 May 2020 08:48:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF522386F82C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589532503; bh=dDy4xHmlChdfr42IT1JrOumPV2ll5OQ3y7rYhltP3DA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=RVH6vCLptlhv38mbXtxZ4N4uCjG1ZlIgvq2pBW/tziEzFuVqEed7n8pBI3yCwvi3J oRiyiILxaaG+ZrLYhsSzYWWmlnQL5MxbDBGz35yk4dKazf/DQm/FNX8KLtBDBtrXCr mtFKCjV0t3R9YUdPLYiULhR/TfK8AkGCadaGIvGQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050::465:202]) by sourceware.org (Postfix) with ESMTPS id C30B1386F457 for ; Fri, 15 May 2020 08:48:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C30B1386F457 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 49NhrT1TNFzQlHP; Fri, 15 May 2020 10:48:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id rStyxGu-qTJ3; Fri, 15 May 2020 10:48:05 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] libiberty: Handle @live attribute in D demangler. Date: Fri, 15 May 2020 10:47:55 +0200 Message-Id: <20200515084755.10147-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 3789C1809 X-Rspamd-Score: 1.32 / 15.00 / 15.00 X-Spam-Status: No, score=-19.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Cc: ian@airs.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch adds support for demangling D functions annotated with the new ownership/borrowing system attribute. Following Jeff's advice from the last patch review, this has been regression tested and committed to mainline. Firstly, as it is assumed this falls under my D front-end maintainer status, secondly, this change is quite obvious, so there ought to be no objections to it. Regards Iain. --- libiberty/ChangeLog: * d-demangle.c (dlang_attributes): Add @live attribute. * testsuite/d-demangle-expected: Add new tests. --- libiberty/d-demangle.c | 4 ++++ libiberty/testsuite/d-demangle-expected | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index 5856bc2930f..f2d6946ecad 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -578,6 +578,10 @@ dlang_attributes (string *decl, const char *mangled) mangled++; string_append (decl, "scope "); continue; + case 'm': /* @live */ + mangled++; + string_append (decl, "@live "); + continue; default: /* unknown attribute */ return NULL; diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index 47b24ea48ae..e3f32e31d7b 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -462,6 +462,10 @@ _D8demangle4testFDFNiZaZv demangle.test(char() @nogc delegate) # --format=dlang +_D8demangle4testFDFNmZaZv +demangle.test(char() @live delegate) +# +--format=dlang _D8demangle4testFDFNaNbZaZv demangle.test(char() pure nothrow delegate) # @@ -538,6 +542,10 @@ _D8demangle4testFPFNiZaZv demangle.test(char() @nogc function) # --format=dlang +_D8demangle4testFPFNmZaZv +demangle.test(char() @live function) +# +--format=dlang _D8demangle4testFPFNaNbZaZv demangle.test(char() pure nothrow function) #