From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67172 invoked by alias); 26 Apr 2019 12:47:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 67064 invoked by uid 89); 26 Apr 2019 12:47:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=langopt, lang.opt, H*RU:209.85.208.195, HX-Spam-Relays-External:209.85.208.195 X-HELO: mail-lj1-f195.google.com Received: from mail-lj1-f195.google.com (HELO mail-lj1-f195.google.com) (209.85.208.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Apr 2019 12:47:10 +0000 Received: by mail-lj1-f195.google.com with SMTP id z26so2841120ljj.2 for ; Fri, 26 Apr 2019 05:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u2CZTypesO44Hb3bEqXFf1hJFgcomRT/JsCtKkVdDok=; b=Qb1w+twGgGiy6oW1/oHrsFCoIM6PDwMZK12rsyOzdnvzm8MIDwDqpoutkblWLenCVS Fffi/SfsVp89+Sz8qogmr56PYP5SdxbnQgjCHgPA2UMXVeDVK8HHjZH6A3mKX/na4/3k tim3mQMgcLPQxY6qwq6/JVUMNUtcjjzPoY4xu/0jNzFSdCuYOq55RQX7m5aLT3r3p7cB 41VCdV+WVaqCKF8Nvclwx+4idReMlIuQZOGq8Wm6CfimbsGTQgK3WQeBVmN/SdeoX3qA XTxD8ZkoqhVTw0wOcn8EdvUw491usIh8UaaDhJ1h64tfdK6JWQpSN7KZieufg3fd9nsw q3uA== MIME-Version: 1.0 References: <00d68e39b80bb63105d123a2481b218b3b1e66cc.1552571776.git.mliska@suse.cz> In-Reply-To: <00d68e39b80bb63105d123a2481b218b3b1e66cc.1552571776.git.mliska@suse.cz> From: Richard Biener Date: Fri, 26 Apr 2019 13:14:00 -0000 Message-ID: Subject: Re: [PATCH 2/3] Add lto-dump tool. To: marxin Cc: GCC Patches , hrishikeshparag@gmail.com, Jan Hubicka Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg01045.txt.bz2 On Thu, Mar 14, 2019 at 3:00 PM marxin wrote: > I think it's a good start. Some minor nits: +/* Dump the visibility of the symbol. */ + +const char * +symtab_node::dump_visibility () const +{ + static const char * const visibility_types[] + = { "default", "protected", "hidden", "internal" }; + return visibility_types[DECL_VISIBILITY (decl)]; +} + +/* Dump the type_name of the symbol. */ +const char * +symtab_node::dump_type_name () const +{ + return symtab_type_names[type]; +} Both method names are not very good. I guess the first should be get_visibilitiy_string and the second get_symtab_type_string? Because they do not actually dump. For the function statistics I wonder if we really need the untransformed body or if we can resort to inline information that must be also in the LTO stream. Otherwise looks OK to me. Thanks, Richard. > gcc/ChangeLog: > > 2019-03-14 Hrishikesh Kulkarni > Martin Liska > > * Makefile.in: Add lto-dump.texi. > * cgraph.h: Add new functions dump_visibility and > dump_type_name. > * doc/gcc.texi: Include lto-dump section. > * doc/lto-dump.texi: New file. > * dumpfile.c (dump_switch_p_1): Use parse_dump_option. > (parse_dump_option): Factor out this function. > * dumpfile.h (enum dump_flag): Add new value TDF_ERROR. > (parse_dump_option): Export the function. > * symtab.c (symtab_node::dump_visibility): New function. > (symtab_node::dump_type_name): Likewise. > > gcc/lto/ChangeLog: > > 2019-03-14 Hrishikesh Kulkarni > Martin Liska > > * Make-lang.in: Add lto_dump-related definition. > * config-lang.in: Likewise. > * lang.opt: Add new language LTODump and options related > to LTO dump tool. > * lto-common.c (lto_read_decls): Support type statistics dump. > (lto_file_read): Likewise for object files. > * lto-dump.c: New file. > * lto-lang.c (lto_option_lang_mask): Move from .. > * lto.c (lto_option_lang_mask): .. here. > * lto.h (lto_option_lang_mask): New declaration. > --- > gcc/Makefile.in | 2 +- > gcc/cgraph.h | 6 + > gcc/doc/gcc.texi | 5 + > gcc/doc/lto-dump.texi | 131 ++++++++++++++++ > gcc/dumpfile.c | 85 ++++++---- > gcc/dumpfile.h | 5 + > gcc/lto/Make-lang.in | 20 ++- > gcc/lto/config-lang.in | 4 +- > gcc/lto/lang.opt | 62 ++++++++ > gcc/lto/lto-common.c | 40 +++++ > gcc/lto/lto-dump.c | 344 +++++++++++++++++++++++++++++++++++++++++ > gcc/lto/lto-lang.c | 6 - > gcc/lto/lto.c | 6 + > gcc/lto/lto.h | 2 + > gcc/symtab.c | 17 ++ > 15 files changed, 692 insertions(+), 43 deletions(-) > create mode 100644 gcc/doc/lto-dump.texi > create mode 100644 gcc/lto/lto-dump.c >