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: 59514 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 97535382A2F9 for ; Thu, 27 Oct 2022 08:42:58 +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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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 (); } }