summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-27 16:02:50 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-27 16:02:50 +0000
commit141acd01436bc952a91b63a4c98a3dc49256989e (patch)
treedcbeeba8fae9dc7970adedeece8672f0c973b716
parentf2d608d8fe241a7349c21c344425c8447e9b9d67 (diff)
downloadgcc-141acd01436bc952a91b63a4c98a3dc49256989e.tar.gz
gcc/ChangeLog:
* Makefile.in (ALL_CFLAGS): Add file-specific CFLAGS. (ALL_HOST_FRONTEND_OBJS): New, for all front-end specific objects. (ALL_HOST_BACKEND_OBJS): New, for all backend and target objects. (ALL_HOST_OBJS): Now a union of the above two. <section "Language makefile fragments">: Add -DIN_GCC_FRONTEND for all files in ALL_HOST_FRONTEND_OBJS. * system.h: Poison GCC_RTL_H if IN_GCC_FRONTEND is defined. * c-common.c: Pretend to be a backend file by undefining IN_GCC_FRONTEND (still need rtl.h here). ada/ChangeLog: * gcc-interface/decl.c: Pretend to be a backend file by undefining IN_GCC_FRONTEND (still need rtl.h here). java/ChangeLog: * buildings.c: Pretend to be a backend file by undefining IN_GCC_FRONTEND (still need rtl.h here). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159927 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/Makefile.in25
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c4
-rw-r--r--gcc/c-common.c7
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/builtins.c3
-rw-r--r--gcc/system.h6
8 files changed, 58 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9bb9b8cc0fd..a981b728c4b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2010-05-27 Steven Bosscher <steven@gcc.gnu.org>
+
+ * Makefile.in (ALL_CFLAGS): Add file-specific CFLAGS.
+ (ALL_HOST_FRONTEND_OBJS): New, for all front-end specific objects.
+ (ALL_HOST_BACKEND_OBJS): New, for all backend and target objects.
+ (ALL_HOST_OBJS): Now a union of the above two.
+ <section "Language makefile fragments">: Add -DIN_GCC_FRONTEND for
+ all files in ALL_HOST_FRONTEND_OBJS.
+ * system.h: Poison GCC_RTL_H if IN_GCC_FRONTEND is defined.
+
+ * c-common.c: Pretend to be a backend file by undefining
+ IN_GCC_FRONTEND (still need rtl.h here).
+
2010-05-27 Jan Hubicka <jh@suse.cz>
* cgraph.h (struct cgraph_node): Mark former_clone_of by GTY ((skip)).
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 42b8a8848c2..677b2d07cf3 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -974,7 +974,7 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile. If you change this,
# you probably want to update BUILD_CFLAGS in configure.ac
-ALL_CFLAGS = $(T_CFLAGS) \
+ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
$(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
# The C++ version.
@@ -1446,15 +1446,19 @@ OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive)
OBJS-onestep = libbackend.o $(OBJS-archive)
-# This lists all host object files, whether they are included in this
-# compilation or not.
-ALL_HOST_OBJS = $(GCC_OBJS) $(C_OBJS) $(OBJS) libbackend.o \
+# This lists all host objects for the front ends.
+ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \
+ $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+
+ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) libbackend.o \
@TREEBROWSER@ main.o gccspec.o version.o intl.o prefix.o cppspec.o \
- $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) \
- $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) \
- mips-tfile.o mips-tdump.o \
+ $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) mips-tfile.o mips-tdump.o \
$(GCOV_OBJS) $(GCOV_DUMP_OBJS)
+# This lists all host object files, whether they are included in this
+# compilation or not.
+ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
+
BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER)
MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
@@ -1572,6 +1576,13 @@ s-alltree: Makefile
$(SHELL) $(srcdir)/../move-if-change tmp-all-tree.def all-tree.def
$(STAMP) s-alltree
+# Now that LANG_MAKEFRAGS are included, we can add special flags to the
+# objects that belong to the front ends. We add an extra define that
+# causes back-end specific include files to be poisoned, in the hope that
+# we can avoid introducing dependencies of the front ends on things that
+# no front end should ever look at (e.g. everything RTL related).
+$(foreach file,$(ALL_HOST_FRONTEND_OBJS),$(eval CFLAGS-$(file) += -DIN_GCC_FRONTEND))
+
#
# -----------------------------
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d3493fcc367..d54d2dc15ce 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-27 Steven Bosscher <steven@gcc.gnu.org>
+
+ * gcc-interface/decl.c: Pretend to be a backend file by undefining
+ IN_GCC_FRONTEND (still need rtl.h here).
+
2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
* gcc-interface/trans.c: Do not include rtl.h, insclude libfuncs.h.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 137d523ddbf..5740a0899b1 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -23,6 +23,10 @@
* *
****************************************************************************/
+/* FIXME: Still need to include rtl.h here (via expr.h) because this file
+ actually generates RTL (search for gen_rtx_* in gnat_to_gnu_entity). */
+#undef IN_GCC_FRONTEND
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-common.c b/gcc/c-common.c
index b8390304a83..1fd11c50c64 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -19,6 +19,10 @@ 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/>. */
+/* FIXME: Still need to include rtl.h here (via expr.h) in a front-end file.
+ Pretend this is a back-end file. */
+#undef IN_GCC_FRONTEND
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -47,9 +51,6 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "libfuncs.h"
-/* FIXME: Still need to include rtl.h here (via expr.h) in a front-end file.
- Pretend this is a back-end file. */
-#define IN_GCC_BACKEND
#include "expr.h" /* For vector_mode_valid_p */
/* FIXME: Needed for TARGET_ENUM_VA_LIST, which should be a target hook. */
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 62839b4fde1..45c1931ed95 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-27 Steven Bosscher <steven@gcc.gnu.org>
+
+ * buildings.c: Pretend to be a backend file by undefining
+ IN_GCC_FRONTEND (still need rtl.h here).
+
2010-05-26 Nathan Froyd <froydnj@codesourcery.com>
* java-tree.h (struct lang_decl_func): Change type of throws_list
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index a3658058a55..74859411758 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -24,6 +24,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* Written by Tom Tromey <tromey@redhat.com>. */
+/* FIXME: Still need to include rtl.h here (see below). */
+#undef IN_GCC_FRONTEND
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/system.h b/gcc/system.h
index e764e584c2d..b87cf0db0d9 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -789,6 +789,12 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
VA_FIXEDARG VA_CLOSE VA_START
#endif /* IN_GCC */
+/* Front ends should never have to include middle-end headers. Enforce
+ this by poisoning the header double-include protection defines. */
+#ifdef IN_GCC_FRONTEND
+#pragma GCC poison GCC_RTL_H
+#endif
+
/* Note: not all uses of the `index' token (e.g. variable names and
structure members) have been eliminated. */
#undef bcopy