> Hello. > > Following mechanical change moves the function to symbol_table where one would > expect such a function. > > Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. > > Ready to be installed? OK, thanks! Honza > Martin
> >From f12a6fc831eb0d78d57572b8fcbb9f170d84d773 Mon Sep 17 00:00:00 2001 > From: marxin <mli...@suse.cz> > Date: Mon, 13 Feb 2017 15:10:07 +0100 > Subject: [PATCH] Move symtab_node::dump_table to symbol_table::dump > > gcc/ChangeLog: > > 2017-02-13 Martin Liska <mli...@suse.cz> > > * 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. > > gcc/lto/ChangeLog: > > 2017-02-13 Martin Liska <mli...@suse.cz> > > * lto.c (read_cgraph_and_symbols): Use the renamed function. > (do_whole_program_analysis): Use the renamed function. > --- > gcc/cgraph.h | 15 +++++++++------ > gcc/cgraphunit.c | 8 ++++---- > gcc/ipa-cp.c | 2 +- > gcc/ipa-icf.c | 2 +- > gcc/lto/lto.c | 6 +++--- > gcc/passes.c | 2 +- > gcc/symtab.c | 13 +------------ > gcc/tree-ssa-structalias.c | 2 +- > 8 files changed, 21 insertions(+), 29 deletions(-) > > diff --git a/gcc/cgraph.h b/gcc/cgraph.h > index be4eaee71e2..c630b9e623a 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 4a949ca9d73..6ec5223c568 100644 > --- a/gcc/cgraphunit.c > +++ b/gcc/cgraphunit.c > @@ -1200,7 +1200,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) > @@ -1270,7 +1270,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 (); > @@ -2477,7 +2477,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) > { > @@ -2543,7 +2543,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 b97d7af854f..676f555718e 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 b9a5b4f2546..92b93b53b85 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/lto.c b/gcc/lto/lto.c > index a7d5e450ea0..94fd165b3e0 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.12.2 >