diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-06-07 10:57:11 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-06-07 10:57:11 +0200 |
commit | 363dc72c15e5191a3f04bde3098793326f681b07 (patch) | |
tree | 112f3d360faa21defe2642147dcd3f2b5b6e39f0 /gcc/dumpfile.c | |
parent | 49e478afe327f4950287bf77e8d8ba19e96a60f2 (diff) | |
download | gcc-363dc72c15e5191a3f04bde3098793326f681b07.zip gcc-363dc72c15e5191a3f04bde3098793326f681b07.tar.gz gcc-363dc72c15e5191a3f04bde3098793326f681b07.tar.bz2 |
dumpfile.h (enum tree_dump_index): Rename TDI_generic to TDI_gimple.
* dumpfile.h (enum tree_dump_index): Rename TDI_generic to
TDI_gimple.
(class dump_manager): Add register_dumps method.
* dumpfile.c: Include langhooks.h.
(dump_files): Use 0 instead of 3/4/5 for TDI_{original,gimple,nested}.
(FIRST_AUTO_NUMBERED_DUMP): Decrease to 1.
(FIRST_ME_AUTO_NUMBERED_DUMP): Define.
(dump_manager::dump_register): Start with 512 entries instead of 32.
(dump_manager::register_dumps): New method.
* toplev.c (general_init): Instead of invoking register_dumps
langhook, invoke register_dumps method on the dump manager.
* gimplify.c (gimplify_function_tree): Use TDI_gimple instead of
TDI_generic.
* gimple-parser.c (c_parser_parse_gimple_body): Use TDI_gimple instead
of TDI_generic.
From-SVN: r248947
Diffstat (limited to 'gcc/dumpfile.c')
-rw-r--r-- | gcc/dumpfile.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index b8bda3c..c746d0b 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see #include "dumpfile.h" #include "context.h" #include "tree-cfg.h" +#include "langhooks.h" /* If non-NULL, return one past-the-end of the matching SUBPART of the WHOLE string. */ @@ -59,10 +60,11 @@ static struct dump_file_info dump_files[TDI_end] = DUMP_FILE_INFO (".cgraph", "ipa-cgraph", DK_ipa, 0), DUMP_FILE_INFO (".type-inheritance", "ipa-type-inheritance", DK_ipa, 0), DUMP_FILE_INFO (".ipa-clones", "ipa-clones", DK_ipa, 0), - DUMP_FILE_INFO (".original", "tree-original", DK_tree, 3), - DUMP_FILE_INFO (".gimple", "tree-gimple", DK_tree, 4), - DUMP_FILE_INFO (".nested", "tree-nested", DK_tree, 5), -#define FIRST_AUTO_NUMBERED_DUMP 3 + DUMP_FILE_INFO (".original", "tree-original", DK_tree, 0), + DUMP_FILE_INFO (".gimple", "tree-gimple", DK_tree, 0), + DUMP_FILE_INFO (".nested", "tree-nested", DK_tree, 0), +#define FIRST_AUTO_NUMBERED_DUMP 1 +#define FIRST_ME_AUTO_NUMBERED_DUMP 3 DUMP_FILE_INFO (NULL, "lang-all", DK_lang, 0), DUMP_FILE_INFO (NULL, "tree-all", DK_tree, 0), @@ -179,7 +181,7 @@ dump_register (const char *suffix, const char *swtch, const char *glob, if (count >= m_extra_dump_files_alloced) { if (m_extra_dump_files_alloced == 0) - m_extra_dump_files_alloced = 32; + m_extra_dump_files_alloced = 512; else m_extra_dump_files_alloced *= 2; m_extra_dump_files = XRESIZEVEC (struct dump_file_info, @@ -200,6 +202,25 @@ dump_register (const char *suffix, const char *swtch, const char *glob, } +/* Allow languages and middle-end to register their dumps before the + optimization passes. */ + +void +gcc::dump_manager:: +register_dumps () +{ + lang_hooks.register_dumps (this); + /* If this assert fails, some FE registered more than + FIRST_ME_AUTO_NUMBERED_DUMP - FIRST_AUTO_NUMBERED_DUMP + dump files. Bump FIRST_ME_AUTO_NUMBERED_DUMP accordingly. */ + gcc_assert (m_next_dump <= FIRST_ME_AUTO_NUMBERED_DUMP); + m_next_dump = FIRST_ME_AUTO_NUMBERED_DUMP; + dump_files[TDI_original].num = m_next_dump++; + dump_files[TDI_gimple].num = m_next_dump++; + dump_files[TDI_nested].num = m_next_dump++; +} + + /* Return the dump_file_info for the given phase. */ struct dump_file_info * |