This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Target config headers out of config.h


Currently, the entire compiler depends on the target description
headers (the headers normally referred to as "tm.h"), even though
large regions of it should have no reason to use the target macros.
This patch attempts to change that.  The changes made are:

(1) Add another config.h-alike, called "tm.h", which includes all the
    target description headers.  tconfig.h continues to include them;
    hconfig.h and config.h don't.

(2) Also, tconfig.h is now the only mkconfig.h-generated header that
    contains (deliberately unusable except in further declarations)
    definitions of the tree, rtx, rtvec typedefs.  The real
    definitions go back to system.h.

[Rationale: They were in config.h/hconfig.h only so that tm.h could
use them.  It makes more sense for them to be in system.h.  With tm.h
a separate header that can be included after system.h, they can go
back there.

It is not really safe for target code to include target description
macros, but they are currently necessary - to fix in a later patch;
the fake definitions in tconfig.h make that continue to work.]

(3) configure doesn't put $(tm_file) into $(*xm_file) anymore.

(4) Apply heuristics to determine which source files actually needed
    tm.h, then include it in those files directly.  The heuristics
    were: if it includes rtl.h or function.h, or if an i386-linux
    "make all" blows up without it.

(5) Where it was obvious that the above heuristics were wrong, correct
    that.  For instance: bitmap.c has no need of rtl.h at all; only
    about half of the C++ front end needs function.h, but it was being
    included from cp-tree.h.

(6) Edit all the Makefiles to match.

We end up with just over half of the compiler genuinely needing tm.h
(207 .c files with, 204 without - all front ends except Chill)  I
think that number can be decreased further with some work to remove
machine dependencies from rtl.h and function.h.

This has survived "make all" on i386-linux.  I'm going to do
i386-linux and powerpc-eabisim bootstraps starting now.

zw

	* mkconfig.sh: Add multiple-include guard to generated file.
	Don't provide rtx/rtvec/tree typedefs, except dummies for
	tconfig.h.  Include insn-constants.h and insn-config.h only in tm.h.

	* Makefile.in (tm_file_list, tm_file): Add to be substituted.
	(GCONFIG_H): Kill.
	(TCONFIG_H): Depend on $(tm_file_list).
	(GTM_H, TM_H): New.
	(tm.h, cs-tm.h): New rules.
	(cs-hconfig.h, cs-config.h, cs-tconfig.h): Don't set
	TARGET_CPU_DEFAULT.

	* Makefile.in, ada/Makefile.in, cp/Make-lang.in,
	java/Make-lang.in, f/Make-lang.in, objc/Make-lang.in:
	Update all dependencies to match changes to files.

	* bitmap.c: Don't include rtl.h or flags.h.
	* timevar.c: Don't include rtl.h.

	* alias.c attribs.c bb-reorder.c builtins.c caller-save.c
	calls.c cfg.c cfganal.c cfgbuild.c cfgcleanup.c cfglayout.c
	cfgloop.c cfgrtl.c combine.c conflict.c convert.c cse.c
	cselib.c dbxout.c dependence.c df.c doloop.c dominance.c
	dwarf2asm.c dwarf2out.c dwarfout.c emit-rtl.c except.c
	explow.c expmed.c expr.c final.c flow.c fold-const.c
	function.c gcc.c gcse.c genattr.c genattrtab.c gencodes.c
	genconfig.c genconstants.c genemit.c genextract.c genflags.c
	gengenrtl.c genopinit.c genoutput.c genpeep.c genpreds.c
	genrecog.c gensupport.c ggc-common.c ggc-page.c ggc-simple.c
	global.c graph.c haifa-sched.c halfpic.c ifcvt.c integrate.c
	jump.c langhooks.c lcm.c lists.c local-alloc.c loop.c optabs.c
	predict.c print-rtl.c profile.c read-rtl.c real.c recog.c
	reg-stack.c regclass.c regmove.c regrename.c reload.c
	reload1.c reorg.c resource.c rtl-error.c rtl.c rtlanal.c
	sbitmap.c sched-deps.c sched-ebb.c sched-rgn.c sched-vis.c
	sdbout.c sibcall.c simplify-rtx.c ssa-ccp.c ssa-dce.c ssa.c
	stmt.c stor-layout.c toplev.c tree-inline.c tree.c unroll.c
	varasm.c varray.c vmsdbgout.c xcoffout.c config/1750a/1750a.c
	config/a29k/a29k.c config/alpha/alpha.c config/arc/arc.c
	config/arm/arm.c config/arm/pe.c config/avr/avr.c
	config/c4x/c4x.c config/clipper/clipper.c
	config/convex/convex.c config/cris/cris.c config/d30v/d30v.c
	config/darwin.c config/dsp16xx/dsp16xx.c config/elxsi/elxsi.c
	config/fr30/fr30.c config/h8300/h8300.c config/i370/i370.c
	config/i386/i386.c config/i386/interix.c config/i386/winnt.c
	config/i860/i860.c config/i960/i960.c config/ia64/ia64.c
	config/m32r/m32r.c config/m68hc11/m68hc11.c config/m68k/m68k.c
	config/m88k/m88k.c config/mcore/mcore.c config/mips/mips.c
	config/mmix/mmix.c config/mn10200/mn10200.c
	config/mn10300/mn10300.c config/nextstep.c
	config/ns32k/ns32k.c config/pa/pa.c config/pdp11/pdp11.c
	config/pj/pj.c config/romp/romp.c config/rs6000/rs6000.c
	config/s390/s390.c config/sh/sh.c config/sparc/sparc.c
	config/stormy16/stormy16.c config/v850/v850.c config/vax/vax.c
	config/we32k/we32k.c config/xtensa/xtensa.c:
	Include tm.h.

	* genattrtab.c genemit.c genextract.c genopinit.c genoutput.c
	genpeep.c genrecog.c: Include tm.h from generated file.

	* gengenrtl.c: Include tm.h in generated file.  Remove obstack
	gunge from generated file.

	* ggc-callbacks.c: Delete file.

	* c-common.c c-decl.c c-lex.c c-objc-common.c c-pragma.c
	c-semantics.c c-typeck.c cppexp.c cppinit.c cpplex.c
	tradcif.y: Include tm.h.

	* ada/decl.c ada/misc.c ada/targtyps.c ada/trans.c ada/utils.c
	ada/utils2.c: Include tm.h.

	* cp/call.c cp/class.c cp/cvt.c cp/decl.c cp/decl2.c cp/error.c
	cp/except.c cp/expr.c cp/friend.c cp/init.c cp/lex.c
	cp/method.c cp/optimize.c cp/parse.y cp/pt.c cp/search.c
	cp/semantics.c cp/spew.c cp/tree.c cp/typeck.c cp/typeck2.c:
	Include tm.h.
	* cp/cp-tree.h: Don't include function.h.
	* cp/call.c cp/class.c cp/decl.c cp/decl2.c cp/except.c
	cp/init.c cp/method.c cp/parse.c cp/semantics.c cp/spew.c
	cp/tree.c cp/typeck.c: Include function.h.

	* f/com.c f/lex.c f/ste.c: Include tm.h.

	* java/boehm.c java/check-init.c java/class.c java/decl.c
	java/except.c java/expr.c java/jcf-parse.c java/jcf-write.c
	java/lang.c java/parse.y: Include tm.h.

	* objc/objc-act.c: Include tm.h.

Attachment: shrink-deps-1.diff.gz
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]