summaryrefslogtreecommitdiff
path: root/gcc/context.h
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-25 00:14:01 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-25 00:14:01 +0000
commit8d0badf15d01d37f25956793782c6868801f8317 (patch)
tree59690893637ad56224c275c8da65c63a006aec0b /gcc/context.h
parent36fa8dd01587685c01f490369ed31b03268545ca (diff)
downloadgcc-8d0badf15d01d37f25956793782c6868801f8317.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201230 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/context.h')
-rw-r--r--gcc/context.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/context.h b/gcc/context.h
new file mode 100644
index 00000000000..3caf02fed31
--- /dev/null
+++ b/gcc/context.h
@@ -0,0 +1,42 @@
+/* context.h - 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/>. */
+
+#ifndef GCC_CONTEXT_H
+#define GCC_CONTEXT_H
+
+namespace gcc {
+
+/* GCC's internal state can be divided into zero or more
+ "parallel universe" of state; an instance of this class is one such
+ context of state. */
+class context
+{
+public:
+
+ /* Currently empty. */
+
+}; // class context
+
+} // namespace gcc
+
+/* The global singleton context aka "g".
+ (the name is chosen to be easy to type in a debugger). */
+extern gcc::context *g;
+
+#endif /* ! GCC_CONTEXT_H */