xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/context.c (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg /* context.c - Holder for global state
2*8feb0f0bSmrg    Copyright (C) 2013-2020 Free Software Foundation, Inc.
31debfc3dSmrg 
41debfc3dSmrg This file is part of GCC.
51debfc3dSmrg 
61debfc3dSmrg GCC is free software; you can redistribute it and/or modify it under
71debfc3dSmrg the terms of the GNU General Public License as published by the Free
81debfc3dSmrg Software Foundation; either version 3, or (at your option) any later
91debfc3dSmrg version.
101debfc3dSmrg 
111debfc3dSmrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
121debfc3dSmrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
131debfc3dSmrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141debfc3dSmrg for more details.
151debfc3dSmrg 
161debfc3dSmrg You should have received a copy of the GNU General Public License
171debfc3dSmrg along with GCC; see the file COPYING3.  If not see
181debfc3dSmrg <http://www.gnu.org/licenses/>.  */
191debfc3dSmrg 
201debfc3dSmrg #include "config.h"
211debfc3dSmrg #include "system.h"
221debfc3dSmrg #include "coretypes.h"
231debfc3dSmrg #include "context.h"
241debfc3dSmrg #include "pass_manager.h"
251debfc3dSmrg #include "dumpfile.h"
261debfc3dSmrg #include "realmpfr.h"
271debfc3dSmrg 
281debfc3dSmrg /* The singleton holder of global state: */
291debfc3dSmrg gcc::context *g;
301debfc3dSmrg 
context()311debfc3dSmrg gcc::context::context ()
32a2dc1f3fSmrg   : m_passes (NULL), m_dumps (new gcc::dump_manager ())
331debfc3dSmrg {
341debfc3dSmrg   have_offload = false;
351debfc3dSmrg }
361debfc3dSmrg 
~context()371debfc3dSmrg gcc::context::~context ()
381debfc3dSmrg {
391debfc3dSmrg   delete m_passes;
401debfc3dSmrg   delete m_dumps;
411debfc3dSmrg 
421debfc3dSmrg   /* Release MPFR caches to avoid Valgrind leak reports.  */
431debfc3dSmrg   mpfr_free_cache ();
441debfc3dSmrg }
45