summaryrefslogtreecommitdiff
path: root/gcc/ggc.h
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-01 19:19:30 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-01 19:19:30 +0000
commita4e59c310c504ec95d282ad7bc023e836e4cc0ec (patch)
tree0d6ccc526e9f4b851ecc829d656097c5b7e9c8f8 /gcc/ggc.h
parent6e888188c01b5cc20d5573dfa673974be8c3d4c6 (diff)
downloadgcc-a4e59c310c504ec95d282ad7bc023e836e4cc0ec.tar.gz
* c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only.
(lang_mark_false_label_stack): Remove. * c-lex.c (init_c_lex): Add file_info_tree as GC root. Allocate <top level> string in GC area. (mark_splay_tree_node): New function. (mark_splay_tree): Likewise. * except.c (mark_eh_status): Only call lang_mark_false_label_stack if it exists. * ggc-callbacks.c (lang_mark_false_label_stack): Remove. * ggc-common.c (lang_mark_false_label_stack): Change type. * ggc.h (ggc_alloc_string): Add comment. (ggc_strdup): New function. * decl.c (lang_mark_false_label_stack): Remove. * lex.c (cp_mang_lang_type): Use ggc_alloc_cleared. * com.c (lang_mark_false_label_stack): Remove. Convert to GC. * Make-lang.in (s-java): Don't depend on ggc-callbacks.o. * Makefile.in (BACKEND): Don't include ggc-callbacks.o. (typeck.o): Depend on ggc.h. * class.c (add_method_1): Use GC functions for allocation. (init_class_processing): Register roots. * decl.c (ggc_p): Set to 1. (pending_local_decls): Make it static. (push_jvm_slot): Use GC functions for allocation. (init_decl_processing): Register roots. (give_name_to_locals): Use GC functions for allocation. (lang_mark_tree): New function. * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC functions for allocation. * jcf-parse.c (jcf_parse_source): Use ggc_strdup. * lex.c (java_lex): Use build_string, rather than replicating it inline. * parse.y (goal): Add more roots. (mark_parser_ctxt): New function. * typeck.c: Include ggc.h. * splay-tree.c (splay_tree_insert): Fix formatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc.h')
-rw-r--r--gcc/ggc.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ggc.h b/gcc/ggc.h
index 8796fd1a830..1a5b4d886af 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -142,8 +142,15 @@ void *ggc_alloc_cleared PARAMS ((size_t));
#define ggc_alloc_tree(LENGTH) ((union tree_node *) ggc_alloc (LENGTH))
+/* Allocate a gc-able string. If CONTENTS is null, then the memory will
+ be uninitialized. If LENGTH is -1, then CONTENTS is assumed to be a
+ null-terminated string and the memory sized accordingly. Otherwise,
+ the memory is filled with LENGTH bytes from CONTENTS. */
char *ggc_alloc_string PARAMS ((const char *contents, int length));
+/* Make a copy of S, in GC-able memory. */
+#define ggc_strdup(S) ggc_alloc_string((S), -1)
+
/* 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 PARAMS ((void));
@@ -161,10 +168,11 @@ int ggc_set_mark PARAMS ((const void *));
the lang_specific hooks in the tree. */
void lang_mark_tree PARAMS ((union tree_node *));
-/* The FALSE_LABEL_STACK, declared in except.h, has
- language-dependent semantics. Each front-end should define this
- function appropriately. */
-void lang_mark_false_label_stack PARAMS ((struct label_node *));
+/* The FALSE_LABEL_STACK, declared in except.h, has language-dependent
+ semantics. If a front-end needs to mark the false label stack, it
+ should set this pointer to a non-NULL value. Otherwise, no marking
+ will be done. */
+extern void (*lang_mark_false_label_stack) PARAMS ((struct label_node *));
/* Mark functions for various structs scattered about. */