summaryrefslogtreecommitdiff
path: root/gcc/context.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2013-07-25 00:14:01 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2013-07-25 00:14:01 +0000
commit8c5005ce365a7fcfd0de57b7f247097e3bbb5449 (patch)
tree59690893637ad56224c275c8da65c63a006aec0b /gcc/context.c
parentb0c5dc1655bc88f34ecd1bf93ff297871b650392 (diff)
Introduce context class.
2013-07-24 David Malcolm <dmalcolm@redhat.com> Introduce context class. * Makefile.in (CONTEXT_H): New. (OBJS): Add context.o. (toplev.o): Add CONTEXT_H to dependencies. (context.o): New. * toplev.c (general_init): Create the singleton gcc::context instance. * context.c: New. * context.h: New. From-SVN: r201230
Diffstat (limited to 'gcc/context.c')
-rw-r--r--gcc/context.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/context.c b/gcc/context.c
new file mode 100644
index 00000000000..76e0dde9c0f
--- /dev/null
+++ b/gcc/context.c
@@ -0,0 +1,27 @@
+/* context.c - Holder for global state
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "ggc.h"
+#include "context.h"
+
+/* The singleton holder of global state: */
+gcc::context *g;