aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-10-01 19:19:30 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-10-01 19:19:30 +0000
commitf15b9af9843e58e7c03df81098a8a15646f5058e (patch)
tree0d6ccc526e9f4b851ecc829d656097c5b7e9c8f8 /gcc/java/parse.y
parent51296ba047eb7f4f266f97d7a26748dc108f7fd5 (diff)
downloadgcc-f15b9af9843e58e7c03df81098a8a15646f5058e.zip
gcc-f15b9af9843e58e7c03df81098a8a15646f5058e.tar.gz
gcc-f15b9af9843e58e7c03df81098a8a15646f5058e.tar.bz2
c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only.
* 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. From-SVN: r36687
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y45
1 files changed, 44 insertions, 1 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index e6aeb32..9ebeb44 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -323,6 +323,7 @@ static void add_inner_class_fields PARAMS ((tree, tree));
static tree build_dot_class_method PARAMS ((tree));
static tree build_dot_class_method_invocation PARAMS ((tree));
static void create_new_parser_context PARAMS ((int));
+static void mark_parser_ctxt PARAMS ((void *));
/* Number of error found so far. */
int java_error_count;
@@ -332,7 +333,7 @@ int java_warning_count;
int do_not_fold;
/* Cyclic inheritance report, as it can be set by layout_class */
char *cyclic_inheritance_report;
-
+
/* Tell when we're within an instance initializer */
static int in_instance_initializer;
@@ -597,6 +598,12 @@ goal:
ggc_add_tree_root (&package_list, 1);
ggc_add_tree_root (&current_this, 1);
ggc_add_tree_root (&currently_caught_type_list, 1);
+ ggc_add_root (&ctxp, 1,
+ sizeof (struct parser_ctxt *),
+ mark_parser_ctxt);
+ ggc_add_root (&ctxp_for_generation, 1,
+ sizeof (struct parser_ctxt *),
+ mark_parser_ctxt);
}
compilation_unit
{}
@@ -15215,3 +15222,39 @@ resolve_qualified_name (name, context)
{
}
#endif
+
+/* Mark P, which is really a `struct parser_ctxt **' for GC. */
+
+static void
+mark_parser_ctxt (p)
+ void *p;
+{
+ struct parser_ctxt *pc = *((struct parser_ctxt **) p);
+ int i;
+
+ if (!pc)
+ return;
+
+#ifndef JC1_LITE
+ for (i = 0; i < 11; ++i)
+ ggc_mark_tree (pc->modifier_ctx[i]);
+ ggc_mark_tree (pc->class_type);
+ ggc_mark_tree (pc->function_decl);
+ ggc_mark_tree (pc->package);
+ ggc_mark_tree (pc->incomplete_class);
+ ggc_mark_tree (pc->gclass_list);
+ ggc_mark_tree (pc->class_list);
+ ggc_mark_tree (pc->current_parsed_class);
+ ggc_mark_tree (pc->current_parsed_class_un);
+ ggc_mark_tree (pc->non_static_initialized);
+ ggc_mark_tree (pc->static_initialized);
+ ggc_mark_tree (pc->instance_initializers);
+ ggc_mark_tree (pc->import_list);
+ ggc_mark_tree (pc->import_demand_list);
+ ggc_mark_tree (pc->current_loop);
+ ggc_mark_tree (pc->current_labeled_block);
+#endif /* JC1_LITE */
+
+ if (pc->next)
+ mark_parser_ctxt (&pc->next);
+}