Hello All, The gengtype state is persisted into a textual file with a lispy (actually MELT-y) appearence.
This is very important for plugins (notably those using GTY). The gengtype state is generated by gcc/Makefile.in rule: s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \ gtyp-input.list # First, parse all files and save a state file. $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \ -S $(srcdir) -I gtyp-input.list -w gtype.state Notice that the $(srcdir) above is actually the gcc/ subdirectory of GCC source tree. With Jeremie Salvucci, I tried to make the state file not too sensitive of the source tree path. The intent is that if the source directory changes -and everything else stays the same- the state file should not change a lot (so that a diff would find only a few lines of changes, not many thousands). The reason is that gengtype.state should be installed somewhere. The gengtype state file contains source location information related to GTY. So it does contain (conceptually) lots of references to the source tree. To have the gengtype state file not too sensitive to the source tree location in the filesystem, we added tricks into gengtype-state.c (e.g. functions write_state_fileloc & write_state_files_list). However, some source files considered by gengtype are outside of $(srcdir) because they are somewhere else in the GCC source tree. To be specific, examine the gtype.state file (with an editor like emacs). You'll find things like (!srcfile 511 "defaults.h") (!file 511 "/usr/src/Lang/basile-melt-gcc/include/hashtab.h") (!file 511 "/usr/src/Lang/basile-melt-gcc/include/splay-tree.h") (!srcfile 511 "bitmap.h") (!srcfile 511 "alias.h") (!srcfile 511 "coverage.c") (!srcfile 511 "rtl.h") (!srcfile 511 "optabs.h") (!srcfile 511 "tree.h") (!srcfile 511 "libfuncs.h") (!file 511 "/usr/src/Lang/basile-melt-gcc/libcpp/include/symtab.h") (!file 511 "/usr/src/Lang/basile-melt-gcc/include/obstack.h") (!srcfile 511 "real.h") (!srcfile 511 "function.h") (!srcfile 511 "insn-addr.h") (!srcfile 511 "hwint.h") (!srcfile 511 "fixed-value.h") (!srcfile 511 "output.h") (!srcfile 511 "cfgloop.h") (!srcfile 511 "cselib.h") (!srcfile 511 "basic-block.h") (!srcfile 511 "ipa-ref.h") (!srcfile 511 "cgraph.h") (!srcfile 511 "reload.h") (!srcfile 511 "caller-save.c") (!srcfile 511 "alias.c") (!srcfile 511 "bitmap.c") (!srcfile 511 "cselib.c") (!srcfile 511 "cgraph.c") (!srcfile 511 "ipa-prop.c") (!srcfile 511 "ipa-cp.c") (!srcfile 511 "ipa-inline.c") (!srcfile 511 "matrix-reorg.c") (!srcfile 511 "dbxout.c") (!srcfile 511 "ipa-struct-reorg.c") (!srcfile 511 "dwarf2out.c") (!srcfile 511 "dwarf2asm.c") (!srcfile 511 "tree-vect-generic.c") (!srcfile 511 "dojump.c") (!srcfile 511 "emit-rtl.c") (!srcfile 511 "except.h") (!srcfile 511 "explow.c") (!srcfile 511 "expr.c") (!srcfile 511 "expr.h") (!srcfile 511 "function.c") (!srcfile 511 "except.c") (!srcfile 511 "gcse.c") (!srcfile 511 "godump.c") (!srcfile 511 "integrate.c") (!srcfile 511 "lists.c") (!srcfile 511 "optabs.c") (!srcfile 511 "profile.c") So most of the source files considered by gengtype are indeed in the $(srcdir) of the gcc/Makefile.in that is in the gcc/ subdirectory of GCC source tree. But some are outside, e.g. in include/ or libcpp/ I feel we could improve that by passing the GCC source tree as the -S argument to GCC, etc. Do you think it is worth working on that now? Could such a minor patch be accepted for 4.6 (I believe that no, but I am not sure). If yes, what is the canonical way to get the GCC source tree topdirectory (the one containing gcc/ & include/ & libcpp/ etc.) from a gcc/Makefile.in rule? Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***