From patchwork Wed Oct 13 15:59:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lu=C3=ADs_Ferreira?= X-Patchwork-Id: 46176 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB99F3857C7F for ; Wed, 13 Oct 2021 15:59:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from 9.mo583.mail-out.ovh.net (9.mo583.mail-out.ovh.net [178.32.96.204]) by sourceware.org (Postfix) with ESMTPS id 234D73858C27 for ; Wed, 13 Oct 2021 15:59:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 234D73858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lsferreira.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lsferreira.net Received: from player735.ha.ovh.net (unknown [10.110.115.29]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id E2D32235F1 for ; Wed, 13 Oct 2021 15:59:23 +0000 (UTC) Received: from lsferreira.net (252.131.62.94.rev.vodafone.pt [94.62.131.252]) (Authenticated sender: contact@lsferreira.net) by player735.ha.ovh.net (Postfix) with ESMTPSA id 2CA5A22F0BCBB; Wed, 13 Oct 2021 15:59:22 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-102R004cd9b2502-3312-4be4-8ac3-45afdeb6ddae, A8D098B9B29251AE790F9592EC533D14122901BA) smtp.auth=contact@lsferreira.net X-OVh-ClientIp: 94.62.131.252 From: =?utf-8?q?Lu=C3=ADs_Ferreira?= To: gcc-patches@gcc.gnu.org Subject: [PATCH] libiberty: d-demangle: write distinguishable variadics on demangled symbol Date: Wed, 13 Oct 2021 16:59:15 +0100 Message-Id: <20211013155915.180150-1-contact@lsferreira.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Ovh-Tracer-Id: 169729413894961400 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddutddgleefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpefnuhovshcuhfgvrhhrvghirhgruceotghonhhtrggttheslhhsfhgvrhhrvghirhgrrdhnvghtqeenucggtffrrghtthgvrhhnpeelvddvtddtffdukeffffejtdfgkeegudelhfehveeuudejueegjeduueefgedukeenucfkpheptddrtddrtddrtddpleegrdeivddrudefuddrvdehvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejfeehrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghonhhtrggttheslhhsfhgvrhhrvghirhgrrdhnvghtpdhrtghpthhtohepghgttgdqphgrthgthhgvshesghgttgdrghhnuhdrohhrgh X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: =?utf-8?q?Lu=C3=ADs_Ferreira?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Currently _D8demangle4testFYv and _D8demangle4testFXv report the same demangled symbol and they are not the same. The official demangler reports "demangle.test(, ...)", which is the distinguishable way to do it. Signed-off-by: Luís Ferreira libiberty/ChangeLog: * d-demangle.c (dlang_function_args): change Y variadic to always report ", ...". * testsuite/d-demangle-expected: change test for Y variadic and add a missing test for X variadic. --- libiberty/d-demangle.c | 4 +--- libiberty/testsuite/d-demangle-expected | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index 880f2ec85a4..4ec94316dad 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -690,9 +690,7 @@ dlang_function_args (string *decl, const char *mangled, struct dlang_info *info) return mangled; case 'Y': /* (variadic T t, ...) style. */ mangled++; - if (n != 0) - string_append (decl, ", "); - string_append (decl, "..."); + string_append (decl, ", ..."); return mangled; case 'Z': /* Normal function. */ mangled++; diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index 44a3649c429..ec481d27dbe 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -359,6 +359,10 @@ demangle.test(char, char, ...) # --format=dlang _D8demangle4testFYv +demangle.test(, ...) +# +--format=dlang +_D8demangle4testFXv demangle.test(...) # --format=dlang