Commit f00e3d4e by Nathan Sidwell Committed by Nathan Sidwell

context.h (context::set_passes): New.

	* context.h (context::set_passes): New.
	* context.c (context::context): Do not create pass manager.
	* toplev.c (general_init): Create pass manager here.

From-SVN: r248268
parent f710ca61
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> 2017-05-19 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (splitter to load of -1 and mask): Don't * config/rs6000/rs6000.md (splitter to load of -1 and mask): Don't
......
...@@ -29,14 +29,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -29,14 +29,9 @@ along with GCC; see the file COPYING3. If not see
gcc::context *g; gcc::context *g;
gcc::context::context () gcc::context::context ()
: m_passes (NULL), m_dumps (new gcc::dump_manager ())
{ {
have_offload = false; 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 () gcc::context::~context ()
......
...@@ -39,6 +39,12 @@ public: ...@@ -39,6 +39,12 @@ public:
/* Pass-management. */ /* 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; } pass_manager *get_passes () { gcc_assert (m_passes); return m_passes; }
/* Handling dump files. */ /* Handling dump files. */
......
...@@ -1154,9 +1154,13 @@ general_init (const char *argv0, bool init_signals) ...@@ -1154,9 +1154,13 @@ general_init (const char *argv0, bool init_signals)
processing. */ processing. */
init_ggc_heuristics (); init_ggc_heuristics ();
/* Create the singleton holder for global state. /* Create the singleton holder for global state. This creates the
Doing so also creates the pass manager and with it the passes. */ dump manager. */
g = new gcc::context (); g = new gcc::context ();
/* Create the passes. */
g->set_passes (new gcc::pass_manager (g));
symtab = new (ggc_cleared_alloc <symbol_table> ()) symbol_table (); symtab = new (ggc_cleared_alloc <symbol_table> ()) symbol_table ();
statistics_early_init (); statistics_early_init ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment