aboutsummaryrefslogtreecommitdiff
path: root/gcc/symtab.c
diff options
context:
space:
mode:
authorHrishikesh Kulkarni <hrishikeshparag@gmail.com>2019-05-06 07:23:25 +0000
committerMartin Liska <marxin@gcc.gnu.org>2019-05-06 07:23:25 +0000
commit66d62d9f2e6b059be6a018397fba555147133a9a (patch)
treefab164b40d0f06c1e3b883ed151202724aa28fd7 /gcc/symtab.c
parenta79420f995764129dc40d1abcbf8ce75a0b0f906 (diff)
downloadgcc-66d62d9f2e6b059be6a018397fba555147133a9a.zip
gcc-66d62d9f2e6b059be6a018397fba555147133a9a.tar.gz
gcc-66d62d9f2e6b059be6a018397fba555147133a9a.tar.bz2
Add lto-dump tool.
2019-05-06 Hrishikesh Kulkarni <hrishikeshparag@gmail.com> Martin Liska <mliska@suse.cz> * Makefile.in: Add lto-dump.texi. * cgraph.h: Add new functions get_visibility_string and get_symtab_type_string. * 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::get_visibility_string): New function. (symtab_node::get_symtab_type_string): Likewise. 2019-05-06 Hrishikesh Kulkarni <hrishikeshparag@gmail.com> Martin Liska <mliska@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. Co-Authored-By: Martin Liska <mliska@suse.cz> From-SVN: r270897
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r--gcc/symtab.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c
index d648d28..4bf37a1 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -808,6 +808,23 @@ symtab_node::dump_referring (FILE *file)
static const char * const symtab_type_names[] = {"symbol", "function", "variable"};
+/* Dump the visibility of the symbol. */
+
+const char *
+symtab_node::get_visibility_string () 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::get_symtab_type_string () const
+{
+ return symtab_type_names[type];
+}
+
/* Dump base fields of symtab nodes to F. Not to be used directly. */
void