summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-27 12:57:59 +0000
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-27 12:57:59 +0000
commita0b14cdf2bb8be79366cb5af2a90492f3237cdf2 (patch)
treea67f0eebb357d7ecd40cf64d83c7d946d9b0b498
parent97903452f9f3c998c3627a360e51b8d0d991248b (diff)
downloadgcc-a0b14cdf2bb8be79366cb5af2a90492f3237cdf2.tar.gz
2009-05-27 Rafael Avila de Espindola <espindola@google.com>
* g++.dg/plugin/attribute_plugin.c: Include gcc-plugin.h first. * g++.dg/plugin/dumb_plugin.c: Include gcc-plugin.h first. * g++.dg/plugin/selfassign.c: Include gcc-plugin.h first. * gcc.dg/plugin/selfassign.c: Include gcc-plugin.h first. 2009-05-27 Rafael Avila de Espindola <espindola@google.com> * Makefile.in (GCC_PLUGIN_H): New. Replace all uses of gcc-plugin.h with it. * doc/plugins.texi: Document that gcc-plugin.h must be the first to be included. * gcc-plugin.h: Include config.h and system.h. (IN_GCC): Define if not defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147908 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/Makefile.in7
-rw-r--r--gcc/doc/plugins.texi2
-rw-r--r--gcc/gcc-plugin.h7
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/plugin/attribute_plugin.c2
-rw-r--r--gcc/testsuite/g++.dg/plugin/dumb_plugin.c2
-rw-r--r--gcc/testsuite/g++.dg/plugin/selfassign.c2
-rw-r--r--gcc/testsuite/gcc.dg/plugin/selfassign.c2
9 files changed, 33 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 28cbc2813c5..7b7258f8260 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-27 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.in (GCC_PLUGIN_H): New. Replace all uses of gcc-plugin.h with
+ it.
+ * doc/plugins.texi: Document that gcc-plugin.h must be the first to be
+ included.
+ * gcc-plugin.h: Include config.h and system.h.
+ (IN_GCC): Define if not defined.
+
2009-05-27 Hans-Peter Nilsson <hp@axis.com>
PR middle-end/40249
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index b140688b292..872f5b7720a 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -893,7 +893,8 @@ EBIMAP_H = ebitmap.h sbitmap.h
IPA_PROP_H = ipa-prop.h $(TREE_H) vec.h $(CGRAPH_H)
GSTAB_H = gstab.h stab.def
BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
-PLUGIN_H = plugin.h gcc-plugin.h
+GCC_PLUGIN_H = gcc-plugin.h $(CONFIG_H) $(SYSTEM_H)
+PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
PLUGIN_VERSION_H = plugin-version.h configargs.h
#
@@ -4035,8 +4036,8 @@ installdirs:
$(mkinstalldirs) $(DESTDIR)$(man7dir)
PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TOPLEV_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_PASS_H) gcc-plugin.h intl.h \
- $(PLUGIN_VERSION_H)
+ $(TOPLEV_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_PASS_H) $(GCC_PLUGIN_H) \
+ intl.h $(PLUGIN_VERSION_H)
# Install the headers needed to build a plugin.
install-plugin: installdirs
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index 7f2f5a510f3..287619c404d 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -30,6 +30,8 @@ Plugins are activated by the compiler at specific events as defined in
call @code{register_callback} specifying the name of the event and
address of the callback function that will handle that event.
+The header @file{gcc-plugin.h} must be the first gcc header to be included.
+
@subsection Plugin initialization
Every plugin should export a function called @code{plugin_init} that
diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h
index 2567bf730d2..1588bca372c 100644
--- a/gcc/gcc-plugin.h
+++ b/gcc/gcc-plugin.h
@@ -20,6 +20,13 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_PLUGIN_H
#define GCC_PLUGIN_H
+#ifndef IN_GCC
+#define IN_GCC
+#endif
+
+#include "config.h"
+#include "system.h"
+
/* Event names. Keep in sync with plugin_event_name[]. */
enum plugin_event
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b8ca82cf7b5..f54f138eeb6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-27 Rafael Avila de Espindola <espindola@google.com>
+
+ * g++.dg/plugin/attribute_plugin.c: Include gcc-plugin.h first.
+ * g++.dg/plugin/dumb_plugin.c: Include gcc-plugin.h first.
+ * g++.dg/plugin/selfassign.c: Include gcc-plugin.h first.
+ * gcc.dg/plugin/selfassign.c: Include gcc-plugin.h first.
+
2009-05-27 Kai TIetz <kai.tietz@onevision.com>
* g++.old-deja/g++.brendan/array1.C (array): Use __SIZE_TYPE__
diff --git a/gcc/testsuite/g++.dg/plugin/attribute_plugin.c b/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
index 2624ea2da0c..16b34964350 100644
--- a/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
@@ -1,5 +1,6 @@
/* Demonstrates how to add custom attributes */
+#include "gcc-plugin.h"
#include <stdlib.h>
#include "config.h"
#include "system.h"
@@ -7,7 +8,6 @@
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
-#include "gcc-plugin.h"
/* Attribute handler callback */
diff --git a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
index 81e68eb5e51..24da5440391 100644
--- a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
@@ -1,6 +1,7 @@
/* A trivial (dumb) plugin example that shows how to use the GCC plugin
mechanism. */
+#include "gcc-plugin.h"
#include <stdlib.h>
#include "config.h"
#include "system.h"
@@ -8,7 +9,6 @@
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
-#include "gcc-plugin.h"
/* Callback function to invoke after GCC finishes parsing a struct. */
diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c
index 9e7e84c2db0..2bc1d861358 100644
--- a/gcc/testsuite/g++.dg/plugin/selfassign.c
+++ b/gcc/testsuite/g++.dg/plugin/selfassign.c
@@ -2,6 +2,7 @@
self-assignment statements. */
/* { dg-options "-O" } */
+#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -12,7 +13,6 @@
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
-#include "gcc-plugin.h"
/* Indicate whether to check overloaded operator '=', which is performed by
diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c
index 9e7e84c2db0..2bc1d861358 100644
--- a/gcc/testsuite/gcc.dg/plugin/selfassign.c
+++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -2,6 +2,7 @@
self-assignment statements. */
/* { dg-options "-O" } */
+#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -12,7 +13,6 @@
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
-#include "gcc-plugin.h"
/* Indicate whether to check overloaded operator '=', which is performed by