aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-09-04 11:25:41 -0700
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-09-04 18:25:41 +0000
commit0a25f1f5e2a425425b7d09e24a530bb6e0247393 (patch)
tree068cd2859713068d2e717951d385915d6b99a4df /gcc/ggc.h
parent482cbc74aacb9f764edb4d97722fb0df3c3fd73e (diff)
downloadgcc-0a25f1f5e2a425425b7d09e24a530bb6e0247393.zip
gcc-0a25f1f5e2a425425b7d09e24a530bb6e0247393.tar.gz
gcc-0a25f1f5e2a425425b7d09e24a530bb6e0247393.tar.bz2
Makefile.in (GGC, GGC_LIB): New.
* Makefile.in (GGC, GGC_LIB): New. (HOST_RTL): Include ggc-none.o. (ggc-simple.o): New target. (ggc-none.o): Likewise. * tree.h (tree_common): Add gc_mark. * rtl.h (struct rtx_def): Steal a bit from code to make gc_mark. (struct rtvec_def): Add gc_mark. * emit-rtl.c (global_rtl): Update static initializers to contain enough initializers. * ggc.h, ggc-none.c, ggc-simple.c: New files. * toplev.c (gc_time): New variable. (all_time): New variable. (compile_file): Print gc time. (print_time): Calculate percentage of the whole. From-SVN: r29106
Diffstat (limited to 'gcc/ggc.h')
-rw-r--r--gcc/ggc.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/gcc/ggc.h b/gcc/ggc.h
new file mode 100644
index 0000000..bb0be13
--- /dev/null
+++ b/gcc/ggc.h
@@ -0,0 +1,72 @@
+/* Garbage collection for the GNU compiler.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "gansidecl.h"
+
+/* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with
+ an external gc library that might be linked in. */
+
+/* Startup */
+
+extern void init_ggc PROTO ((void));
+
+/* Allocation. */
+
+struct rtx_def *ggc_alloc_rtx PROTO ((int nslots));
+struct rtvec_def *ggc_alloc_rtvec PROTO ((int nelt));
+union tree_node *ggc_alloc_tree PROTO ((int length));
+char *ggc_alloc_string PROTO ((const char *contents, int length));
+
+/* Invoke the collector. This is really just a hint, but in the case of
+ the simple collector, the only time it will happen. */
+
+void ggc_collect PROTO ((void));
+
+/* Manipulate global roots that are needed between calls to gc. */
+void ggc_add_root PROTO ((void *base, int nelt, int size,
+ void (*)(void *)));
+void ggc_add_rtx_root PROTO ((struct rtx_def **, int nelt));
+void ggc_add_tree_root PROTO ((union tree_node **, 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_string PROTO ((char *));
+
+/* Callbacks to the languages. */
+
+/* This is the language's opportunity to mark nodes held through
+ the lang_specific hooks in the tree. */
+void lang_mark_tree PROTO ((union tree_node *));
+
+/* And similarly to free that data when the tree node is released. */
+void lang_cleanup_tree PROTO ((union tree_node *));
+
+/* Mark functions for various structs scattered about. */
+
+void mark_temp_slot PROTO ((void *));
+void mark_function_chain PROTO ((void *));
+void mark_eh_state PROTO ((void *));
+void mark_stmt_state PROTO ((void *));
+void mark_emit_state PROTO ((void *));
+void mark_varasm_state PROTO ((void *));
+void mark_optab PROTO ((void *));