From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 653543857C79 for ; Thu, 17 Feb 2022 16:36:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 653543857C79 Received: by mail-lf1-x12b.google.com with SMTP id j7so310074lfu.6 for ; Thu, 17 Feb 2022 08:36:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IryB1a2vmOZc5g0zjxlrxIvovv88k5y1GrZ7orJAAvs=; b=j2XOMj9K9JNzQdI62232hzJLsI4+Qkq2Yxv/OimxtV0Ym+57BbPqu1gSYrokRlfLpj KrBOUpVIRJi0BkFYi2ARGV48pjWvE1JNHKV7iLRUoNzhT+QD5usCzD2FPOuJrW/8XXZw 3JT0uQ5sSFrOhPwXSRW9YIf52w/cPuYuREYy6AQwpefQom2KSFmjpaYsBVEcS3PuIWNW +8KNqJAqpQIrZmeQIFeTmcBGg0jJSNC4FVEsfr74zYB0ttUf40LufQLrP/aztcGOsBnI +udmLRffuB+MIZQPo3XzdjJMTpHXSfqqsE/J9EbTZ6g/ZCfXmQ/s2d9oUbh+KsMUknID 3gEA== X-Gm-Message-State: AOAM530VNMvmFd4VI09aQnjb0UHQDxNQK3qH+DXzLrAMwj8DBD1pG8pt FhaSCp+n1zR1iXljT67rUugSFOERCCH8jL9bpdau5Q== X-Google-Smtp-Source: ABdhPJw82Z826dxXMZla2/B+sgZavrF6RTHT320jiYhjJb9mSm1oJvjxuCJhUdqiJqhCDhWCBEE7Mekc/m1ca1LTnqY= X-Received: by 2002:a05:6512:ba9:b0:442:c5e6:3af4 with SMTP id b41-20020a0565120ba900b00442c5e63af4mr2528112lfv.13.1645115788895; Thu, 17 Feb 2022 08:36:28 -0800 (PST) MIME-Version: 1.0 References: <20220116003534.52674-1-mark@klomp.org> In-Reply-To: From: Ian Lance Taylor Date: Thu, 17 Feb 2022 08:36:17 -0800 Message-ID: Subject: Re: [PATCHv3] libiberty rust-demangle, ignore .suffix To: Mark Wielaard Cc: gcc-patches@gcc.gnu.org, Nick Nethercote , Eduard-Mihai Burtescu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-16.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: , X-List-Received-Date: Thu, 17 Feb 2022 16:36:32 -0000 On Thu, Feb 17, 2022 at 2:45 AM Mark Wielaard wrote: > > Ping. Is this OK to commit now? > I am not sure who can approve this. > > On Sun, Jan 16, 2022 at 01:35:34AM +0100, Mark Wielaard wrote: > > Rust symbols can have a .suffix because of compiler transformations. > > These can be ignored in the demangled name. Which is what this patch > > implements. By stopping at the first dot for v0 symbols and searching > > backwards to the ending 'E' for legacy symbols. > > > > An alternative implementation could be to follow what C++ does and > > represent these as [clone .suffix] tagged onto the demangled name. > > But this seems somewhat confusing since it results in a demangled > > name that cannot be mangled again. And it would mean trying to > > decode compiler internal naming. > > > > https://bugs.kde.org/show_bug.cgi?id=445916 > > https://github.com/rust-lang/rust/issues/60705 > > > > libiberty/Changelog > > > > * rust-demangle.c (rust_demangle_callback): Ignore everything > > after '.' char in sym for v0. For legacy symbols search > > backwards to find the last 'E' before any '.'. > > * testsuite/rust-demangle-expected: Add new .suffix testcases. This is OK. Thanks. Ian