From: Martin Liska Date: Tue, 29 Oct 2019 08:44:52 +0000 (+0100) Subject: Print header in dump_memory_report. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3518424d4bf6a9654c7fea7f046ed839e888b1d6;p=gcc.git Print header in dump_memory_report. 2019-10-29 Martin Liska * cgraphunit.c (symbol_table::compile): Pass title as dump_memory_report argument. * toplev.c (dump_memory_report): New argument. (finalize): Pass new argument. * toplev.h (dump_memory_report): Add argument. 2019-10-29 Martin Liska * lto.c (do_whole_program_analysis): Pass title as dump_memory_report argument. From-SVN: r277559 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f5c26e14a9..51097bba544 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-10-29 Martin Liska + + * cgraphunit.c (symbol_table::compile): Pass + title as dump_memory_report argument. + * toplev.c (dump_memory_report): New argument. + (finalize): Pass new argument. + * toplev.h (dump_memory_report): Add argument. + 2019-10-29 Martin Liska * ggc-common.c: Move Leak to the first column. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 9873b9b7aac..6ec24432351 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2602,10 +2602,7 @@ symbol_table::compile (void) timevar_push (TV_CGRAPHOPT); if (pre_ipa_mem_report) - { - fprintf (stderr, "Memory consumption before IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption before IPA"); if (!quiet_flag) fprintf (stderr, "Performing interprocedural optimizations\n"); state = IPA; @@ -2637,10 +2634,7 @@ symbol_table::compile (void) symtab->dump (dump_file); } if (post_ipa_mem_report) - { - fprintf (stderr, "Memory consumption after IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption after IPA"); timevar_pop (TV_CGRAPHOPT); /* Output everything. */ diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 2aefc366701..3592dda2559 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2019-10-29 Martin Liska + + * lto.c (do_whole_program_analysis): Pass + title as dump_memory_report argument. + 2019-10-29 Martin Liska * lto.c (do_whole_program_analysis): Remove argument. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 5dca73ffdb3..27ea341e04c 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -455,10 +455,7 @@ do_whole_program_analysis (void) timevar_push (TV_WHOPR_WPA); if (pre_ipa_mem_report) - { - fprintf (stderr, "Memory consumption before IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption before IPA"); symtab->function_flags_ready = true; @@ -537,16 +534,13 @@ do_whole_program_analysis (void) timevar_stop (TV_PHASE_STREAM_OUT); if (post_ipa_mem_report) - { - fprintf (stderr, "Memory consumption after IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption after IPA"); /* Show the LTO report before launching LTRANS. */ if (flag_lto_report || (flag_wpa && flag_lto_report_wpa)) print_lto_report_1 (); if (mem_report_wpa) - dump_memory_report (); + dump_memory_report ("Final"); } /* Create artificial pointers for "omp declare target link" vars. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 8a152b8e3b1..00a5e832126 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1994,8 +1994,17 @@ target_reinit (void) } void -dump_memory_report () +dump_memory_report (const char *header) { + /* Print significant header. */ + fputc ('\n', stderr); + for (unsigned i = 0; i < 80; i++) + fputc ('#', stderr); + fprintf (stderr, "\n# %-77s#\n", header); + for (unsigned i = 0; i < 80; i++) + fputc ('#', stderr); + fputs ("\n\n", stderr); + dump_line_table_statistics (); ggc_print_statistics (); stringpool_statistics (); @@ -2058,7 +2067,7 @@ finalize (bool no_backend) } if (mem_report) - dump_memory_report (); + dump_memory_report ("Final"); if (profile_report) dump_profile_report (); diff --git a/gcc/toplev.h b/gcc/toplev.h index 91e346570db..8814a5e11f8 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -66,7 +66,8 @@ extern bool wrapup_global_declarations (tree *, int); extern void global_decl_processing (void); -extern void dump_memory_report (); +extern void +dump_memory_report (const char *); extern void dump_profile_report (void); extern void target_reinit (void);