From patchwork Thu Oct 27 08:42:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 11656 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp108064wru; Thu, 27 Oct 2022 01:43:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70ZmuUkguEWQIWAzzLdXuL3DdpzEoNmbHvXlZ/nhC0qOtkkElziNQBKYoqTeT6jGkNSrN2 X-Received: by 2002:a17:907:a46:b0:782:1c1c:8141 with SMTP id be6-20020a1709070a4600b007821c1c8141mr41006348ejc.549.1666860189933; Thu, 27 Oct 2022 01:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666860189; cv=none; d=google.com; s=arc-20160816; b=d25jmOma5I7obp5/B+fZ1EVVFaYWPWhTeMnz1/hnHTiGZNEmK/V0EOhtZKn6bpnTd/ JQ0HYO4ZZT+7z+vbIslsZW0Tpe7PVEYCwHf9My98vrFohBf5xzgCIQfWprJVP2wlof/h v53uSz88GNlJFG6NBRl6rm9qCtiokpRJ2gpKyA58mXoAgQyFjZglvY1Fwr5ZHC/62rPk herfvJk18kGGWzJ02gK8Q+4JSvvYwZNr0EBWyB8wn7xCbb+/TiSbEcTpy17UthSNh5rc TxD1EJ+oYDhchaRbVUhUSmnOOYMFSYvompkawzjBd40p7ax0Q2fPNrvrMkpS7jrsmx3g dUYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=EEx9aeJwf5Zs0Uc0zyn0r2jviuh+zIG/n1HdV8VTY3c=; b=v5ZSecjQgWdPeCiO9rMXd6vchxKS5Ze5Y7bVgH2ip8Wo9KBO7BYvzP3zHZwkeMeD5p pewY13iLvyeoo9DrMba7JWpZA1iE64EO3uFD4Y1lBHvukq2ynfR+xlyQ8kb7StXsHpxc vcPiF1ddcOyrjZyCGFuac1J8JvSf1UQZsIJ7QxezP+gFUeM5Wwmx/K+II1B/KgyxUyJy RUjrXU/Iv7xxYFTAVtF1d3n5LN46wEmPT+zw1dV6J6lAd7uPXVFShtP6/3Nq2Q9BQUWo 0DaOD2znQ3vZyCVTIZ64sVAa7lmsdna8cMTy2qoGWvH0AO3QdbVn2ciNFsdNVGl4yWYx CxcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=F2k0NCnV; dkim=neutral (no key) header.i=@gcc.gnu.org header.s=susede2_ed25519; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id j5-20020aa7ca45000000b00462352ef503si860933edt.518.2022.10.27.01.43.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 01:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=F2k0NCnV; dkim=neutral (no key) header.i=@gcc.gnu.org header.s=susede2_ed25519; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F7843887F5C for ; Thu, 27 Oct 2022 08:43:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 6435E3858017 for ; Thu, 27 Oct 2022 08:42:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6435E3858017 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5068D2263E for ; Thu, 27 Oct 2022 08:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1666860121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EEx9aeJwf5Zs0Uc0zyn0r2jviuh+zIG/n1HdV8VTY3c=; b=F2k0NCnVtJkEj0iLFTp8VuoOa6KrFybkx5laoY+Rv76YDsqfjjZv3BkNJovvsUK16rYUc4 VYzXMHDAzJeBmg85Wl/hLVXggn8vOgiyDmY7PSfjmEyAYpvnH24xKL8H903to9hiUX790W KAJDtAPhzZweZ6SQ8t+ut8QC2zWkcfw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1666860121; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EEx9aeJwf5Zs0Uc0zyn0r2jviuh+zIG/n1HdV8VTY3c=; b=uEBS3t6dRfefrnFDiomCZpUNimxdJruyhnZfr1SRkDLEOYVq+NmJt8mumQvOKOj10GQFK0 GP4daJ1R9//eONCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3446B134CA for ; Thu, 27 Oct 2022 08:42:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XKfgC1lEWmM9SAAAMHmgww (envelope-from ) for ; Thu, 27 Oct 2022 08:42:01 +0000 Message-ID: Date: Thu, 27 Oct 2022 10:42:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] lto-dump: modernize a bit To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747829590408762633?= X-GMAIL-MSGID: =?utf-8?q?1747829590408762633?= Hi. Ready to be installed? Thanks, Martin gcc/lto/ChangeLog: * lto-dump.cc (dump_list): Remove trailing return. (dump_symbol): Likewise. (dump_body): Filter name based on mangled name. (dump_tool_help): Use GIMPLE wording. (lto_main): Update wording. --- gcc/lto/lto-dump.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc index cb9782722a9..5c4dbf5d297 100644 --- a/gcc/lto/lto-dump.cc +++ b/gcc/lto/lto-dump.cc @@ -227,7 +227,6 @@ void dump_list (void) { dump_list_functions (); dump_list_variables (); - return; } /* Dump specific variables and functions used in IL. */ @@ -243,7 +242,6 @@ void dump_symbol () printf ("\n"); } } - return; } /* Dump specific gimple body of specified function. */ @@ -259,19 +257,17 @@ void dump_body () return; } cgraph_node *cnode; - FOR_EACH_FUNCTION (cnode) - if (cnode->definition - && !cnode->alias - && !strcmp (cnode->name (), flag_dump_body)) + FOR_EACH_DEFINED_FUNCTION (cnode) + if (!cnode->alias + && !strcmp (cnode->asm_name (), flag_dump_body)) { - printf ("Gimple Body of Function: %s\n", cnode->name ()); + printf ("GIMPLE body of function: %s\n\n", cnode->asm_name ()); cnode->get_untransformed_body (); debug_function (cnode->decl, flags); flag = 1; } if (!flag) error_at (input_location, "Function not found."); - return; } /* List of command line options for dumping. */ @@ -292,13 +288,12 @@ void dump_tool_help () " -callgraph Dump the callgraph in graphviz format.\n" " -type-stats Dump statistics of tree types.\n" " -tree-stats Dump statistics of trees.\n" - " -gimple-stats Dump statistics of gimple statements.\n" - " -dump-body= Dump the specific gimple body.\n" + " -gimple-stats Dump statistics of GIMPLE statements.\n" + " -dump-body= Dump the specific GIMPLE body.\n" " -dump-level= Deciding the optimization level of body.\n" " -help Display the dump tool help.\n"; fputs (msg, stdout); - return; } unsigned int @@ -365,7 +360,7 @@ lto_main (void) "%<--enable-gather-detailed-mem-stats%>."); else { - printf ("Tree Statistics\n"); + printf ("Tree statistics\n"); dump_tree_statistics (); } }