This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Delete remaining #include "c-tree.h" from backend files
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 Jun 2003 00:56:03 -0400 (EDT)
- Subject: Delete remaining #include "c-tree.h" from backend files
This patch cleans up the remaining places where we include "c-tree.h"
in backend files. (I need to clean this for something else I'm
working on, details later. But it's a good idea IMHO regardless.)
In the cases of the ${cpu}.c files, I couldn't find any negative
consequence from removing it. (I.e. no additional warnings or missing
decls.) If it's truly necessary for something, my understanding is
that the correct mechanism is to create a ${cpu}-c.c file and link
that only into the C frontend via `c_target_objs'. Having it in plain
${cpu}.c is a potential conflict whenever compiling/linking non-C
frontends.
In the langhooks.c case, that file is also included in libbackend.a so
it shouldn't be including a frontend tree header either. It seems to
have included "c-tree.h" to obtain a prototype for the `poplevel'
function. This function is required to be defined by all language
frontends. As such, I put a definition in tree.h so it's handled just
like `builtin_function'. I.e. declared in a frontend-neutral file.
The remaining includes of c-tree.h were all in C/objc frontend files.
Also there was one in config/darwin-c.c which, if I understand things
correctly, is the right place to do it.
This patch was bootstrapped on sparc-sun-solaris2.7 (minus java), no
regressions. And I also ran the c4x and hppa subset in my target
farm. I built cc1/xgcc cross-compilers for the following targets, all
compiled successfully:
c4x-unknown-elf c4x-unknown-rtems
hppa1.0-hp-hpux10 hppa1.0-hp-hpux11 hppa1.1-hp-hpux10
hppa1.1-hp-hpux11 hppa1.1-unknown-bsd hppa1.1-unknown-linux-gnu
hppa1.1-unknown-osf hppa1.1-unknown-proelf hppa1.1-unknown-rtems
hppa64-hp-hpux11 hppa64-unknown-linux-gnu
Ok to install?
Thanks,
--Kaveh
PS: I didn't see any Makefile dependencies related to these.
2003-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/c4x/c4x.c: Don't include "c-tree.h".
* config/pa/pa.c: Likewise.
* langhooks.c: Likewise.
* tree.h (poplevel): Declare.
diff -rup orig/egcc-CVS20030615/gcc/config/c4x/c4x.c egcc-CVS20030615/gcc/config/c4x/c4x.c
--- orig/egcc-CVS20030615/gcc/config/c4x/c4x.c 2003-06-07 20:01:49.000000000 -0400
+++ egcc-CVS20030615/gcc/config/c4x/c4x.c 2003-06-15 19:22:33.126490000 -0400
@@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "loop.h"
#include "recog.h"
-#include "c-tree.h"
#include "ggc.h"
#include "cpplib.h"
#include "toplev.h"
diff -rup orig/egcc-CVS20030615/gcc/config/pa/pa.c egcc-CVS20030615/gcc/config/pa/pa.c
--- orig/egcc-CVS20030615/gcc/config/pa/pa.c 2003-06-13 10:10:23.000000000 -0400
+++ egcc-CVS20030615/gcc/config/pa/pa.c 2003-06-15 19:17:16.613718000 -0400
@@ -39,7 +39,6 @@ Boston, MA 02111-1307, USA. */
#include "optabs.h"
#include "libfuncs.h"
#include "reload.h"
-#include "c-tree.h"
#include "integrate.h"
#include "function.h"
#include "obstack.h"
diff -rup orig/egcc-CVS20030615/gcc/langhooks.c egcc-CVS20030615/gcc/langhooks.c
--- orig/egcc-CVS20030615/gcc/langhooks.c 2003-06-11 20:01:20.000000000 -0400
+++ egcc-CVS20030615/gcc/langhooks.c 2003-06-15 18:37:38.277314000 -0400
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
#include "tm.h"
#include "toplev.h"
#include "tree.h"
-#include "c-tree.h"
#include "tree-inline.h"
#include "rtl.h"
#include "insn-config.h"
diff -rup orig/egcc-CVS20030615/gcc/tree.h egcc-CVS20030615/gcc/tree.h
--- orig/egcc-CVS20030615/gcc/tree.h 2003-06-14 14:32:17.000000000 -0400
+++ egcc-CVS20030615/gcc/tree.h 2003-06-15 18:42:19.712431000 -0400
@@ -2644,6 +2644,10 @@ extern GTY(()) tree current_function_fun
extern int all_types_permanent;
+/* Exit a binding level. This function is provided by each language
+ frontend. */
+extern tree poplevel (int, int, int);
+
/* Declare a predefined function. Return the declaration. This function is
provided by each language frontend. */
extern tree builtin_function PARAMS ((const char *, tree, int,