Commit 565e3f3e by Mark Mitchell

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
parent 7a3842b3
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> Sun Sep 5 17:34:33 1999 Richard Henderson <rth@cygnus.com>
* clipper/clipper.c (clipper_va_start): Fix typos. * clipper/clipper.c (clipper_va_start): Fix typos.
...@@ -48,7 +67,7 @@ Sun Sep 5 00:35:17 1999 Richard Henderson <rth@cygnus.com> ...@@ -48,7 +67,7 @@ Sun Sep 5 00:35:17 1999 Richard Henderson <rth@cygnus.com>
(simplify_cond): Likewise. (simplify_cond): Likewise.
(simplify_text_exp): Likewise. (simplify_text_exp): Likewise.
(optimize_attrs): 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. GC'ing.
(gencode): Generate a #include for ggc.h. (gencode): Generate a #include for ggc.h.
* ggc-callbacks.c (ggc_p): Define it to zero. * ggc-callbacks.c (ggc_p): Define it to zero.
......
...@@ -1433,7 +1433,7 @@ dumpvers: dumpvers.c ...@@ -1433,7 +1433,7 @@ dumpvers: dumpvers.c
version.o: version.c version.o: version.c
ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_BASE_H) $(TREE_H) flags.h \ 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 ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_BASE_H) ggc.h
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "ggc.h" #include "ggc.h"
#include "flags.h" #include "flags.h"
#include "varray.h" #include "varray.h"
#include "hash.h"
/* Debugging flags. */ /* Debugging flags. */
#undef GGC_DUMP #undef GGC_DUMP
...@@ -98,6 +99,9 @@ static void ggc_free_tree PROTO ((struct ggc_tree *t)); ...@@ -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_rtx_ptr PROTO ((void *elt));
static void ggc_mark_tree_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_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 /* These allocators are dreadfully simple, with no caching whatsoever so
that Purify-like tools that do allocation versioning can catch errors. that Purify-like tools that do allocation versioning can catch errors.
...@@ -486,6 +490,26 @@ ggc_mark_tree_varray (v) ...@@ -486,6 +490,26 @@ ggc_mark_tree_varray (v)
ggc_mark_tree (VARRAY_TREE (v, i)); 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 void
ggc_mark_string (s) ggc_mark_string (s)
char *s; char *s;
...@@ -659,7 +683,7 @@ ggc_add_tree_root (base, nelt) ...@@ -659,7 +683,7 @@ ggc_add_tree_root (base, nelt)
ggc_add_root (base, nelt, sizeof(tree), ggc_mark_tree_ptr); 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 void
ggc_add_tree_varray_root (base, nelt) ggc_add_tree_varray_root (base, nelt)
...@@ -670,6 +694,18 @@ ggc_add_tree_varray_root (base, nelt) ...@@ -670,6 +694,18 @@ ggc_add_tree_varray_root (base, nelt)
ggc_mark_tree_varray_ptr); 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 void
ggc_del_root (base) ggc_del_root (base)
void *base; void *base;
...@@ -716,6 +752,17 @@ ggc_mark_tree_varray_ptr (elt) ...@@ -716,6 +752,17 @@ ggc_mark_tree_varray_ptr (elt)
ggc_mark_tree_varray (*(varray_type *)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 #ifdef GGC_DUMP
/* Don't enable this unless you want a really really lot of data. */ /* Don't enable this unless you want a really really lot of data. */
static void __attribute__((constructor)) static void __attribute__((constructor))
......
...@@ -37,6 +37,7 @@ struct emit_status; ...@@ -37,6 +37,7 @@ struct emit_status;
struct stmt_status; struct stmt_status;
struct varasm_status; struct varasm_status;
struct varray_head_tag; struct varray_head_tag;
struct hash_table;
/* Startup */ /* Startup */
...@@ -60,12 +61,15 @@ void ggc_add_root PROTO ((void *base, int nelt, int size, ...@@ -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_rtx_root PROTO ((struct rtx_def **, int nelt));
void ggc_add_tree_root PROTO ((union tree_node **, 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_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)); void ggc_del_root PROTO ((void *base));
/* Mark nodes from the gc_add_root callback. */ /* Mark nodes from the gc_add_root callback. */
void ggc_mark_rtx PROTO ((struct rtx_def *)); void ggc_mark_rtx PROTO ((struct rtx_def *));
void ggc_mark_rtvec PROTO ((struct rtvec_def *)); void ggc_mark_rtvec PROTO ((struct rtvec_def *));
void ggc_mark_tree PROTO ((union tree_node *)); 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 *)); void ggc_mark_string PROTO ((char *));
/* Callbacks to the languages. */ /* Callbacks to the languages. */
......
...@@ -1651,7 +1651,6 @@ output_func_start_profiler () ...@@ -1651,7 +1651,6 @@ output_func_start_profiler ()
/* Synthesize a constructor function to invoke __bb_init_func with a /* Synthesize a constructor function to invoke __bb_init_func with a
pointer to this object file's profile block. */ pointer to this object file's profile block. */
start_sequence ();
/* Try and make a unique name given the "file function name". /* Try and make a unique name given the "file function name".
......
...@@ -47,7 +47,7 @@ struct const_equiv_data { ...@@ -47,7 +47,7 @@ struct const_equiv_data {
pseudos that contain pointers into the replacement area allocated for pseudos that contain pointers into the replacement area allocated for
this inline instance. These pseudos are then marked as being equivalent this inline instance. These pseudos are then marked as being equivalent
to the appropriate address and substituted if valid. */ 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 /* Record the valid age for each entry. The entry is invalid if its
age is less than const_age. */ age is less than const_age. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment