From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E290BC5AC7A for ; Fri, 7 Aug 2026 16:04:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wsN2y-00035l-A1; Fri, 07 Aug 2026 12:03:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsN2s-00035K-MK for qemu-devel@nongnu.org; Fri, 07 Aug 2026 12:03:43 -0400 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsN2q-0005UC-UI for qemu-devel@nongnu.org; Fri, 07 Aug 2026 12:03:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=4xaPM6LJ+69Wy0NRDvEtl5VSXE1EP6kgiBfaByQVSu8=; b=IreI3MpfcNLvgrB GwiUAkjQRurqIOui0E6iwjfF+pFb0U+YlRK2BxG+9ljpMNqhzWMDU6rn5lN7PCJSoP8Dl5WSfEA0V uFVftYpB1zOC921w3ba4EzxEFX1i1un1NLh6O/h6ZHnzOZAmoBujZvv89eu1izjzb3TknhxvapiD9 7A=; Date: Fri, 7 Aug 2026 18:03:30 +0200 To: Anton Johansson Cc: qemu-devel@nongnu.org, brian.cain@oss.qualcomm.com, pierrick.bouvier@oss.qualcomm.com, philmd@mailo.com Subject: Re: [PATCH v2 13/50] helper-to-tcg: PrepareForOptPass, demangle function names Message-ID: <20260807180326.6e915537@spawn> In-Reply-To: <20260730031025.12926-14-anjo@rev.ng> References: <20260730031025.12926-1-anjo@rev.ng> <20260730031025.12926-14-anjo@rev.ng> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=94.130.142.21; envelope-from=ale@rev.ng; helo=rev.ng X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Alessandro Di Federico From: Alessandro Di Federico via qemu development Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Thu, 30 Jul 2026 05:09:47 +0200 Anton Johansson wrote: > + Index = DemangledName.find_last_of(':'); > + if (Index != std::string::npos) { > + FunctionName = DemangledName.substr(Index + 1); > + } > + // Remove arguments > + Index = FunctionName.find_first_of('('); > + if (Index != std::string::npos) { > + FunctionName = FunctionName.substr(0, Index); > + } LLVM provides a dedicated function to parse mangled names: getFunctionBaseName. It's in LLVM, so new dependencies (I thought was in clang). The current code wouldn't handle `ns::function(ns::type)`. Also, more in general: why are we setting the function name to the name of the original C++ function name? It's a feature worth documenting in the README along with its ratio. Reviewed-by: Alessandro Di Federico -- Alessandro Di Federico rev.ng Labs