* coretypes.h: Include hash-table.h and hash-set.h for host files. * ggc.h: Don't include statistics.h> * hash-map.h: Remove all includes. * hash-set.h: Likewise. * hash-table.h: Add statistics.h, inchash.h and hash-map-traits.h to the include list. Remove . * inchash.h: Remove all includes. * mem-stats.h: Likewise. * vec.h: No special processing for generators or ggc. Index: coretypes.h =================================================================== --- coretypes.h (revision 224136) +++ coretypes.h (working copy) @@ -307,6 +307,8 @@ #include "double-int.h" #include "real.h" #include "fixed-value.h" -#endif +#include "hash-table.h" +#include "hash-set.h" +#endif /* GENERATOR_FILE && !USED_FOR_TARGET */ #endif /* coretypes.h */ Index: ggc.h =================================================================== --- ggc.h (revision 224135) +++ ggc.h (working copy) @@ -20,7 +20,6 @@ #ifndef GCC_GGC_H #define GCC_GGC_H -#include "statistics.h" /* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with an external gc library that might be linked in. */ Index: hash-map.h =================================================================== --- hash-map.h (revision 224135) +++ hash-map.h (working copy) @@ -21,13 +21,6 @@ #ifndef hash_map_h #define hash_map_h -#include -#include -#include "hash-table.h" -#include "hash-map-traits.h" -#include "mem-stats.h" -#include "vec.h" - template class GTY((user)) hash_map Index: hash-set.h =================================================================== --- hash-set.h (revision 224135) +++ hash-set.h (working copy) @@ -21,8 +21,6 @@ #ifndef hash_set_h #define hash_set_h -#include "hash-table.h" - /* implement default behavior for traits when types allow it. */ struct default_hashset_traits Index: hash-table.h =================================================================== --- hash-table.h (revision 224135) +++ hash-table.h (working copy) @@ -196,10 +196,13 @@ #ifndef TYPED_HASHTAB_H #define TYPED_HASHTAB_H +#include "statistics.h" #include "ggc.h" +#include "vec.h" #include "hashtab.h" -#include +#include "inchash.h" #include "mem-stats-traits.h" +#include "hash-map-traits.h" template class hash_map; template class hash_set; @@ -774,7 +777,6 @@ #include "mem-stats.h" #include "hash-map.h" -#include "vec.h" extern mem_alloc_description hash_table_usage; Index: inchash.h =================================================================== --- inchash.h (revision 224136) +++ inchash.h (working copy) @@ -20,7 +20,6 @@ #ifndef INCHASH_H #define INCHASH_H 1 -#include "hashtab.h" /* This file implements an incremential hash function ADT, to be used by code that incrementially hashes a lot of unrelated data Index: mem-stats.h =================================================================== --- mem-stats.h (revision 224135) +++ mem-stats.h (working copy) @@ -1,11 +1,6 @@ #ifndef GCC_MEM_STATS_H #define GCC_MEM_STATS_H -#include "hash-map-traits.h" -#include "inchash.h" -#include "mem-stats-traits.h" -#include "vec.h" - /* Forward declaration. */ template @@ -358,7 +353,6 @@ reverse_mem_map_t *m_reverse_map; }; -#include "hash-map.h" /* Returns true if instance PTR is registered by the memory description. */ Index: vec.h =================================================================== --- vec.h (revision 224135) +++ vec.h (working copy) @@ -22,39 +22,15 @@ #ifndef GCC_VEC_H #define GCC_VEC_H -/* FIXME - When compiling some of the gen* binaries, we cannot enable GC - support because the headers generated by gengtype are still not - present. In particular, the header file gtype-desc.h is missing, - so compilation may fail if we try to include ggc.h. +/* Some gen* file have no ggc support as the header file gtype-desc.h is + missing. Provide these definitions in case ggc.h has not been included. + This is not a problem because any code that runs before gengtype is built + will never need to use GC vectors.*/ - Since we use some of those declarations, we need to provide them - (even if the GC-based templates are not used). This is not a - problem because the code that runs before gengtype is built will - never need to use GC vectors. But it does force us to declare - these functions more than once. */ -#ifdef GENERATOR_FILE -#define VEC_GC_ENABLED 0 -#else -#define VEC_GC_ENABLED 1 -#endif // GENERATOR_FILE +extern void ggc_free (void *); +extern size_t ggc_round_alloc_size (size_t requested_size); +extern void *ggc_realloc (void *, size_t MEM_STAT_DECL); -#include "statistics.h" // For CXX_MEM_STAT_INFO. - -#if VEC_GC_ENABLED -#include "ggc.h" -#else -# ifndef GCC_GGC_H - /* Even if we think that GC is not enabled, the test that sets it is - weak. There are files compiled with -DGENERATOR_FILE that already - include ggc.h. We only need to provide these definitions if ggc.h - has not been included. Sigh. */ - - extern void ggc_free (void *); - extern size_t ggc_round_alloc_size (size_t requested_size); - extern void *ggc_realloc (void *, size_t MEM_STAT_DECL); -# endif // GCC_GGC_H -#endif // VEC_GC_ENABLED - /* Templated vector type and associated interfaces. The interface functions are typesafe and use inline functions,