aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-05-21 11:23:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-05-21 11:23:50 +0200
commitaeb66e2405094c4e004ea786935b9408015b46bc (patch)
treef6cca34b66e6bf5800938b0183c6a74d5b39ae90
parentd50b3099ec02374e3c45782b7e1dca84bf53e376 (diff)
Use forward declarations of GCC AST where possible
-rw-r--r--odb/gcc-fwd.hxx14
-rw-r--r--odb/gcc.hxx34
-rw-r--r--odb/semantics/elements.hxx4
3 files changed, 34 insertions, 18 deletions
diff --git a/odb/gcc-fwd.hxx b/odb/gcc-fwd.hxx
new file mode 100644
index 0000000..bf54536
--- /dev/null
+++ b/odb/gcc-fwd.hxx
@@ -0,0 +1,14 @@
+// file : odb/gcc-fwd.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_GCC_FWD_HXX
+#define ODB_GCC_FWD_HXX
+
+extern "C"
+{
+#include <coretypes.h>
+}
+
+#endif // ODB_GCC_FWD_HXX
diff --git a/odb/gcc.hxx b/odb/gcc.hxx
index 9d1e3bc..feca3ee 100644
--- a/odb/gcc.hxx
+++ b/odb/gcc.hxx
@@ -3,11 +3,13 @@
// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
-#ifndef ODB_GCC_TREE_HXX
-#define ODB_GCC_TREE_HXX
+#ifndef ODB_GCC_HXX
+#define ODB_GCC_HXX
-// GCC header includes to get the parse tree declarations. The order
-// is important and doesn't follow any kind of logic.
+#include <odb/gcc-fwd.hxx>
+
+// GCC header includes to get the plugin and parse tree declarations.
+// The order is important and doesn't follow any kind of logic.
//
#include <stdlib.h>
@@ -17,20 +19,20 @@
extern "C"
{
-#include "gcc-plugin.h"
+#include <gcc-plugin.h>
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tree.h"
-#include "intl.h"
+#include <config.h>
+#include <system.h>
+#include <coretypes.h>
+#include <tree.h>
+#include <intl.h>
-#include "tm.h"
+#include <tm.h>
-#include "diagnostic.h"
-#include "c-common.h"
-#include "c-pragma.h"
-#include "cp/cp-tree.h"
+#include <diagnostic.h>
+#include <c-common.h>
+#include <c-pragma.h>
+#include <cp/cp-tree.h>
}
#ifndef LOCATION_COLUMN
@@ -41,4 +43,4 @@ extern "C"
#define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
#endif
-#endif // ODB_GCC_TREE_HXX
+#endif // ODB_GCC_HXX
diff --git a/odb/semantics/elements.hxx b/odb/semantics/elements.hxx
index cc3b0be..3c98db8 100644
--- a/odb/semantics/elements.hxx
+++ b/odb/semantics/elements.hxx
@@ -6,8 +6,6 @@
#ifndef ODB_SEMANTICS_ELEMENTS_HXX
#define ODB_SEMANTICS_ELEMENTS_HXX
-#include <odb/gcc.hxx> // Keep it first.
-
#include <map>
#include <list>
#include <vector>
@@ -22,6 +20,8 @@
#include <cutl/container/pointer-iterator.hxx>
#include <cutl/compiler/context.hxx>
+#include <odb/gcc-fwd.hxx>
+
namespace semantics
{
using namespace cutl;