diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-19 12:32:48 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-19 12:32:48 +0000 |
commit | 28d73004918cc573a75155cb7eccfa79ca66ed6c (patch) | |
tree | 139ddb25f5f33f8cd0aafe729081e7145d9480dc | |
parent | bdb31910b79767f12fdfedd953413c98a0b357c3 (diff) | |
download | gcc-28d73004918cc573a75155cb7eccfa79ca66ed6c.tar.gz |
* context.h (context::set_passes): New.
* context.c (context::context): Do not create pass manager.
* toplev.c (general_init): Create pass manager here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248268 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/context.c | 7 | ||||
-rw-r--r-- | gcc/context.h | 6 | ||||
-rw-r--r-- | gcc/toplev.c | 8 |
4 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9006383293e..b11d20dee41 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-05-19 Nathan Sidwell <nathan@acm.org> + + * context.h (context::set_passes): New. + * context.c (context::context): Do not create pass manager. + * toplev.c (general_init): Create pass manager here. + 2017-05-19 Segher Boessenkool <segher@kernel.crashing.org> * config/rs6000/rs6000.md (splitter to load of -1 and mask): Don't diff --git a/gcc/context.c b/gcc/context.c index bacad5a5e77..22d91b4fdf6 100644 --- a/gcc/context.c +++ b/gcc/context.c @@ -29,14 +29,9 @@ along with GCC; see the file COPYING3. If not see gcc::context *g; gcc::context::context () + : m_passes (NULL), m_dumps (new gcc::dump_manager ()) { have_offload = false; - - /* The pass manager's constructor uses the dump manager (to set up - dumps for the various passes), so the dump manager must be set up - before the pass manager. */ - m_dumps = new gcc::dump_manager (); - m_passes = new gcc::pass_manager (this); } gcc::context::~context () diff --git a/gcc/context.h b/gcc/context.h index e9113a4ca73..4573f705c46 100644 --- a/gcc/context.h +++ b/gcc/context.h @@ -39,6 +39,12 @@ public: /* Pass-management. */ + void set_passes (pass_manager *m) + { + gcc_assert (!m_passes); + m_passes = m; + } + pass_manager *get_passes () { gcc_assert (m_passes); return m_passes; } /* Handling dump files. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index f1384fc2fda..814193a4509 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1154,9 +1154,13 @@ general_init (const char *argv0, bool init_signals) processing. */ init_ggc_heuristics (); - /* Create the singleton holder for global state. - Doing so also creates the pass manager and with it the passes. */ + /* Create the singleton holder for global state. This creates the + dump manager. */ g = new gcc::context (); + + /* Create the passes. */ + g->set_passes (new gcc::pass_manager (g)); + symtab = new (ggc_cleared_alloc <symbol_table> ()) symbol_table (); statistics_early_init (); |