summaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
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/c-lex.c
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/c-lex.c')
-rw-r--r--gcc/c-lex.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index f6dee4d5867..693615361fc 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -149,6 +149,8 @@ static tree lex_string PARAMS ((const char *, unsigned int, int));
static tree lex_charconst PARAMS ((const char *, unsigned int, int));
static void update_header_times PARAMS ((const char *));
static int dump_one_header PARAMS ((splay_tree_node, void *));
+static int mark_splay_tree_node PARAMS ((splay_tree_node, void *));
+static void mark_splay_tree PARAMS ((void *));
#if !USE_CPPLIB
static int skip_white_space PARAMS ((int));
@@ -176,7 +178,10 @@ init_c_lex (filename)
file_info_tree = splay_tree_new ((splay_tree_compare_fn)strcmp,
0,
(splay_tree_delete_value_fn)free);
- toplevel = get_fileinfo ("<top level>");
+ /* Make sure to mark the filenames in the tree for GC. */
+ ggc_add_root (&file_info_tree, 1, sizeof (file_info_tree),
+ mark_splay_tree);
+ toplevel = get_fileinfo (ggc_strdup ("<top level>"));
if (flag_detailed_statistics)
{
header_time = 0;
@@ -2540,3 +2545,25 @@ lex_charconst (str, len, wide)
return value;
}
+
+/* Mark for GC a node in a splay tree whose keys are strings. */
+
+static int
+mark_splay_tree_node (n, data)
+ splay_tree_node n;
+ void *data ATTRIBUTE_UNUSED;
+{
+ ggc_mark_string ((char *) n->key);
+ return 0;
+}
+
+/* Mark for GC a splay tree whose keys are strings. */
+
+static void
+mark_splay_tree (p)
+ void *p;
+{
+ splay_tree st = *(splay_tree *) p;
+
+ splay_tree_foreach (st, mark_splay_tree_node, NULL);
+}