Makefile.in (ggc-simple.o): Depend on hash.h.

* Makefile.in (ggc-simple.o): Depend on hash.h.
	* ggc.h (ggc_add_tree_hash_table_root): Declare.
	(ggc_mark_tree_varray): Likewise.
	(ggc_mark_tree_hash_table): Likewise.
	* ggc-simple.c: Include hash.h.
	(ggc_mark_tree_hash_table_ptr): New function.
	(ggc_mark_tree_hash_table_entry): Likewise.
	(ggc_mark_tree_hash_table): Likewise.
	(ggc_add_tree_hash_table_root): Likewise.
	* varray.h (const_equiv_data): Use struct rtx_def *, rather than

	* profile.c (output_func_start_profiler): Remove apparently
	nonsensical call to start_sequence.

From-SVN: r29134
This commit is contained in:
Mark Mitchell 1999-09-06 02:10:03 +00:00
parent 7a3842b33e
commit 565e3f3ec2
6 changed files with 74 additions and 5 deletions

View File

@ -1,3 +1,22 @@
Sun Sep 5 18:57:42 1999 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (ggc-simple.o): Depend on hash.h.
* ggc.h (ggc_add_tree_hash_table_root): Declare.
(ggc_mark_tree_varray): Likewise.
(ggc_mark_tree_hash_table): Likewise.
* ggc-simple.c: Include hash.h.
(ggc_mark_tree_hash_table_ptr): New function.
(ggc_mark_tree_hash_table_entry): Likewise.
(ggc_mark_tree_hash_table): Likewise.
(ggc_add_tree_hash_table_root): Likewise.
* varray.h (const_equiv_data): Use struct rtx_def *, rather than
rtx, when defining fields.
Sun Sep 5 18:57:42 1999 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* profile.c (output_func_start_profiler): Remove apparently
nonsensical call to start_sequence.
Sun Sep 5 17:34:33 1999 Richard Henderson <rth@cygnus.com>
* clipper/clipper.c (clipper_va_start): Fix typos.
@ -48,7 +67,7 @@ Sun Sep 5 00:35:17 1999 Richard Henderson <rth@cygnus.com>
(simplify_cond): Likewise.
(simplify_text_exp): Likewise.
(optimize_attrs): Likewise.
* gengentrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
* gengenrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
GC'ing.
(gencode): Generate a #include for ggc.h.
* ggc-callbacks.c (ggc_p): Define it to zero.

View File

@ -1433,7 +1433,7 @@ dumpvers: dumpvers.c
version.o: version.c
ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_BASE_H) $(TREE_H) flags.h \
ggc.h varray.h
ggc.h varray.h hash.h
ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_BASE_H) ggc.h

View File

@ -25,6 +25,7 @@
#include "ggc.h"
#include "flags.h"
#include "varray.h"
#include "hash.h"
/* Debugging flags. */
#undef GGC_DUMP
@ -98,6 +99,9 @@ static void ggc_free_tree PROTO ((struct ggc_tree *t));
static void ggc_mark_rtx_ptr PROTO ((void *elt));
static void ggc_mark_tree_ptr PROTO ((void *elt));
static void ggc_mark_tree_varray_ptr PROTO ((void *elt));
static void ggc_mark_tree_hash_table_ptr PROTO ((void *elt));
static boolean ggc_mark_tree_hash_table_entry PROTO ((struct hash_entry *,
hash_table_key));
/* These allocators are dreadfully simple, with no caching whatsoever so
that Purify-like tools that do allocation versioning can catch errors.
@ -486,6 +490,26 @@ ggc_mark_tree_varray (v)
ggc_mark_tree (VARRAY_TREE (v, i));
}
/* Mark the hash table-entry HE. It's key field is really a tree. */
static boolean
ggc_mark_tree_hash_table_entry (he, k)
struct hash_entry *he;
hash_table_key k ATTRIBUTE_UNUSED;
{
ggc_mark_tree ((tree) he->key);
return true;
}
/* Mark all the elements of the hash-table H, which contains trees. */
void
ggc_mark_tree_hash_table (ht)
struct hash_table *ht;
{
hash_traverse (ht, ggc_mark_tree_hash_table_entry, /*info=*/0);
}
void
ggc_mark_string (s)
char *s;
@ -659,7 +683,7 @@ ggc_add_tree_root (base, nelt)
ggc_add_root (base, nelt, sizeof(tree), ggc_mark_tree_ptr);
}
/* Add vV (a varray full of trees) to the list of GC roots. */
/* Add V (a varray full of trees) to the list of GC roots. */
void
ggc_add_tree_varray_root (base, nelt)
@ -670,6 +694,18 @@ ggc_add_tree_varray_root (base, nelt)
ggc_mark_tree_varray_ptr);
}
/* Add HT (a hash-table where ever key is a tree) to the list of GC
roots. */
void
ggc_add_tree_hash_table_root (base, nelt)
struct hash_table **base;
int nelt;
{
ggc_add_root (base, nelt, sizeof (struct hash_table *),
ggc_mark_tree_hash_table_ptr);
}
void
ggc_del_root (base)
void *base;
@ -716,6 +752,17 @@ ggc_mark_tree_varray_ptr (elt)
ggc_mark_tree_varray (*(varray_type *)elt);
}
/* Type-correct function to pass to ggc_add_root. It just forwards
ELT (which is really a struct hash_table **) to
ggc_mark_tree_hash_table. */
static void
ggc_mark_tree_hash_table_ptr (elt)
void *elt;
{
ggc_mark_tree_hash_table (*(struct hash_table **) elt);
}
#ifdef GGC_DUMP
/* Don't enable this unless you want a really really lot of data. */
static void __attribute__((constructor))

View File

@ -37,6 +37,7 @@ struct emit_status;
struct stmt_status;
struct varasm_status;
struct varray_head_tag;
struct hash_table;
/* Startup */
@ -60,12 +61,15 @@ void ggc_add_root PROTO ((void *base, int nelt, int size,
void ggc_add_rtx_root PROTO ((struct rtx_def **, int nelt));
void ggc_add_tree_root PROTO ((union tree_node **, int nelt));
void ggc_add_tree_varray_root PROTO ((struct varray_head_tag **, int nelt));
void ggc_add_tree_hash_table_root PROTO ((struct hash_table **, int nelt));
void ggc_del_root PROTO ((void *base));
/* Mark nodes from the gc_add_root callback. */
void ggc_mark_rtx PROTO ((struct rtx_def *));
void ggc_mark_rtvec PROTO ((struct rtvec_def *));
void ggc_mark_tree PROTO ((union tree_node *));
void ggc_mark_tree_varray PROTO ((struct varray_head_tag *));
void ggc_mark_tree_hash_table PROTO ((struct hash_table *));
void ggc_mark_string PROTO ((char *));
/* Callbacks to the languages. */

View File

@ -1651,7 +1651,6 @@ output_func_start_profiler ()
/* Synthesize a constructor function to invoke __bb_init_func with a
pointer to this object file's profile block. */
start_sequence ();
/* Try and make a unique name given the "file function name".

View File

@ -47,7 +47,7 @@ struct const_equiv_data {
pseudos that contain pointers into the replacement area allocated for
this inline instance. These pseudos are then marked as being equivalent
to the appropriate address and substituted if valid. */
rtx rtx;
struct rtx_def *rtx;
/* Record the valid age for each entry. The entry is invalid if its
age is less than const_age. */