From 6c52831d98b00d02a3c11b46fbf80991ef0dc0fa Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 23 May 2017 16:28:35 +0200 Subject: [PATCH] Move symtab_node::dump_table to symbol_table::dump 2017-05-23 Martin Liska * cgraph.h: Move symtab_node::dump_table to symbol_table::dump and symtab_node::debug_symtab to symbol_table::debug. * cgraphunit.c (analyze_functions): Use the renamed function. (symbol_table::compile): Likewise. * ipa-cp.c (ipcp_verify_propagated_values): Likewise. * ipa-icf.c (sem_item_optimizer::execute): Likewise. * passes.c (execute_todo): Likewise. * symtab.c (symbol_table::dump): New function. * tree-ssa-structalias.c (ipa_pta_execute): Use the renamed function. 2017-05-23 Martin Liska * lto.c (read_cgraph_and_symbols): Use the renamed function. (do_whole_program_analysis): Use the renamed function. From-SVN: r248368 --- gcc/ChangeLog | 12 ++++++++++++ gcc/cgraph.h | 15 +++++++++------ gcc/cgraphunit.c | 8 ++++---- gcc/ipa-cp.c | 2 +- gcc/ipa-icf.c | 2 +- gcc/lto/ChangeLog | 5 +++++ gcc/lto/lto.c | 6 +++--- gcc/passes.c | 2 +- gcc/symtab.c | 13 +------------ gcc/tree-ssa-structalias.c | 2 +- 10 files changed, 38 insertions(+), 29 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e5d00ec3bea..4c0b64d7b40 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2017-05-23 Martin Liska + + * cgraph.h: Move symtab_node::dump_table to symbol_table::dump + and symtab_node::debug_symtab to symbol_table::debug. + * cgraphunit.c (analyze_functions): Use the renamed function. + (symbol_table::compile): Likewise. + * ipa-cp.c (ipcp_verify_propagated_values): Likewise. + * ipa-icf.c (sem_item_optimizer::execute): Likewise. + * passes.c (execute_todo): Likewise. + * symtab.c (symbol_table::dump): New function. + * tree-ssa-structalias.c (ipa_pta_execute): Use the renamed function. + 2017-05-23 Jan Hubicka * ipa-fnsummary.c (estimate_node_size_and_time): Do not sanity check diff --git a/gcc/cgraph.h b/gcc/cgraph.h index f27e2419390..e07a7dd4250 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -411,12 +411,6 @@ public: Return NULL if there's no such node. */ static symtab_node *get_for_asmname (const_tree asmname); - /* Dump symbol table to F. */ - static void dump_table (FILE *); - - /* Dump symbol table to stderr. */ - static void DEBUG_FUNCTION debug_symtab (void); - /* Verify symbol table for internal consistency. */ static DEBUG_FUNCTION void verify_symtab_nodes (void); @@ -2178,6 +2172,15 @@ public: /* Set the DECL_ASSEMBLER_NAME and update symtab hashtables. */ void change_decl_assembler_name (tree decl, tree name); + /* Dump symbol table to F. */ + void dump (FILE *f); + + /* Dump symbol table to stderr. */ + inline DEBUG_FUNCTION void debug (void) + { + dump (stderr); + } + /* Return true if assembler names NAME1 and NAME2 leads to the same symbol name. */ static bool assembler_names_equal_p (const char *name1, const char *name2); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index c1f4293778c..34f8aaba128 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1208,7 +1208,7 @@ analyze_functions (bool first_time) if (symtab->dump_file) { fprintf (symtab->dump_file, "\n\nInitial "); - symtab_node::dump_table (symtab->dump_file); + symtab->dump (symtab->dump_file); } if (first_time) @@ -1278,7 +1278,7 @@ analyze_functions (bool first_time) if (symtab->dump_file) { fprintf (symtab->dump_file, "\n\nReclaimed "); - symtab_node::dump_table (symtab->dump_file); + symtab->dump (symtab->dump_file); } bitmap_obstack_release (NULL); ggc_collect (); @@ -2485,7 +2485,7 @@ symbol_table::compile (void) if (dump_file) { fprintf (dump_file, "Optimized "); - symtab_node:: dump_table (dump_file); + symtab->dump (dump_file); } if (post_ipa_mem_report) { @@ -2551,7 +2551,7 @@ symbol_table::compile (void) if (dump_file) { fprintf (dump_file, "\nFinal "); - symtab_node::dump_table (dump_file); + symtab->dump (dump_file); } if (!flag_checking) return; diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index e68a151c753..f35e5159a76 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1399,7 +1399,7 @@ ipcp_verify_propagated_values (void) { if (dump_file) { - symtab_node::dump_table (dump_file); + symtab->dump (dump_file); fprintf (dump_file, "\nIPA lattices after constant " "propagation, before gcc_unreachable:\n"); print_all_lattices (dump_file, true, false); diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 39f230924c7..c5b5bd34d67 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -2643,7 +2643,7 @@ sem_item_optimizer::execute (void) bool merged_p = merge_classes (prev_class_count); if (dump_file && (dump_flags & TDF_DETAILS)) - symtab_node::dump_table (dump_file); + symtab->dump (dump_file); return merged_p; } diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 9802d869161..2d8e95b8c31 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2017-05-23 Martin Liska + + * lto.c (read_cgraph_and_symbols): Use the renamed function. + (do_whole_program_analysis): Use the renamed function. + 2017-05-22 Jan Hubicka * lto.c: Replace ipa-inline.h by ipa-fnsummary.h diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index f5dbbedafcf..6671d8a9622 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2927,7 +2927,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) if (symtab->dump_file) { fprintf (symtab->dump_file, "Before merging:\n"); - symtab_node::dump_table (symtab->dump_file); + symtab->dump (symtab->dump_file); } if (!flag_ltrans) { @@ -3092,7 +3092,7 @@ do_whole_program_analysis (void) symtab->function_flags_ready = true; if (symtab->dump_file) - symtab_node::dump_table (symtab->dump_file); + symtab->dump (symtab->dump_file); bitmap_obstack_initialize (NULL); symtab->state = IPA_SSA; @@ -3105,7 +3105,7 @@ do_whole_program_analysis (void) if (symtab->dump_file) { fprintf (symtab->dump_file, "Optimized "); - symtab_node::dump_table (symtab->dump_file); + symtab->dump (symtab->dump_file); } symtab_node::checking_verify_symtab_nodes (); diff --git a/gcc/passes.c b/gcc/passes.c index e7c5d194010..98e05e4ba7a 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -2040,7 +2040,7 @@ execute_todo (unsigned int flags) if ((flags & TODO_dump_symtab) && dump_file && !current_function_decl) { gcc_assert (!cfun); - symtab_node::dump_table (dump_file); + symtab->dump (dump_file); /* Flush the file. If verification fails, we won't be able to close the file before aborting. */ fflush (dump_file); diff --git a/gcc/symtab.c b/gcc/symtab.c index 6c41dcff4b7..13dca7f0dbd 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -913,10 +913,8 @@ symtab_node::dump (FILE *f) vnode->dump (f); } -/* Dump symbol table to F. */ - void -symtab_node::dump_table (FILE *f) +symbol_table::dump (FILE *f) { symtab_node *node; fprintf (f, "Symbol table:\n\n"); @@ -924,15 +922,6 @@ symtab_node::dump_table (FILE *f) node->dump (f); } -/* Dump symbol table to stderr. */ - -DEBUG_FUNCTION void -symtab_node::debug_symtab (void) -{ - dump_table (stderr); -} - - /* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME. Return NULL if there's no such node. */ diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 5c2fee00a5a..a4abd28c57a 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -7800,7 +7800,7 @@ ipa_pta_execute (void) if (dump_file && (dump_flags & TDF_DETAILS)) { - symtab_node::dump_table (dump_file); + symtab->dump (dump_file); fprintf (dump_file, "\n"); } -- 2.30.2