* 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
+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.
(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.
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
#include "ggc.h"
#include "flags.h"
#include "varray.h"
+#include "hash.h"
/* Debugging flags. */
#undef GGC_DUMP
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.
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;
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)
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;
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))
struct stmt_status;
struct varasm_status;
struct varray_head_tag;
+struct hash_table;
/* Startup */
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. */
/* 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".
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. */