On Thu, Mar 14, 2019 at 3:00 PM marxin <mli...@suse.cz> 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  <hrishikeshpa...@gmail.com>
>             Martin Liska  <mli...@suse.cz>
>
>         * 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  <hrishikeshpa...@gmail.com>
>             Martin Liska  <mli...@suse.cz>
>
>         * 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
>

Reply via email to