/* context.c - Holder for global state
- Copyright (C) 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013-2016 Free Software Foundation, Inc.
This file is part of GCC.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "ggc.h"
#include "context.h"
#include "pass_manager.h"
+#include "dumpfile.h"
/* The singleton holder of global state: */
gcc::context *g;
-void *
-gcc::context::operator new (std::size_t size)
+gcc::context::context ()
{
- return ggc_internal_cleared_alloc_stat (size MEM_STAT_INFO);
-}
-
-gcc::context::context()
-{
- passes_ = new gcc::pass_manager (this);
-}
+ have_offload = false;
-/* Functions relating to the garbage collector. */
-void
-gcc::context::gt_ggc_mx ()
-{
- /* Currently a no-op. */
-}
-
-void
-gcc::context::gt_pch_nx ()
-{
- /* Currently a no-op. */
+ /* 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);
}
-void
-gcc::context::gt_pch_nx (gt_pointer_operator op ATTRIBUTE_UNUSED,
- void *cookie ATTRIBUTE_UNUSED)
+gcc::context::~context ()
{
- /* Currently a no-op. */
+ delete m_passes;
+ delete m_dumps;
}