aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-write.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-09-23 17:09:39 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-09-23 17:09:39 +0000
commit19e223db83b86b7262db77c9ea67e7d6d32a0d73 (patch)
tree95f1fa9690fd278ef5602931fc5a32ddfca8d2bd /gcc/java/jcf-write.c
parenta3b434a23543ba4fe8ac546382475e145b8be83f (diff)
downloadgcc-19e223db83b86b7262db77c9ea67e7d6d32a0d73.zip
gcc-19e223db83b86b7262db77c9ea67e7d6d32a0d73.tar.gz
gcc-19e223db83b86b7262db77c9ea67e7d6d32a0d73.tar.bz2
Make-lang.in (JAVA_SRCS): Include java-tree.h.
* Make-lang.in (JAVA_SRCS): Include java-tree.h. * Makefile.in (parse.o): Depend on ggc.h. (class.o): Likewise. (constants.o): Likewise. (decl.o): Likewise. (expr.o): Likewise. (jcf-parse.o): Likewise. (jcf-write.o): Likewise. (mangle.o): Likewise. * class.c: Include ggc.h. (build_static_field_ref): Register GC roots. (layout_class): Likewise. (init_class_processing): Likewise. * constants.c: Include ggc.h. (current_constant_pool_data_ref): Remove. (tag_nodes): Move it to ... (get_tag_node): ... here. Register GC roots. * decl.c: Include ggc.h. Remove many global tree definitions. (throw_node): Define. (java_global_trees): Likewise. (predef_filenames): Make the size a constant. (init_decl_processing): Adjust accordingly. (init_decl_processing): Call init_jcf_parse. Register GC roots. * expr.c: Include ggc.h. (init_expr_processing): Register GC roots. (build_invokeinterface): Likewise. * java-tree.h: Replace extern tree declarations with macros. (java_global_trees): New variable. (java_tree_index): New enumeration. (init_jcf_parse): Declare. * jcf-parse.c: Include ggc.h. (current_class): Remove declaration. (main_class): Likewise. (all_class_list): Likewise. (predefined_filename_p): Adjust for constant size of predef_filenames. (init_jcf_parse): New function. * jcf-write.c: Include ggc.h. (generate_classfile): Register GC roots. (append_synthetic_attribute): Likewise. (append_innerclass_attribute_entry): Likewise. * lang.c: Include ggc.h. (lang_print_error): Register GC roots. * parse.h (struct parser_ctxt): Rename fields to avoid conflicts with macros. * parse.y: Include ggc.h. (wfl_operator): Remove. (goal): Register GC roots. (java_pop_parser_context): Adjust for new field names. (java_parser_context_save_global): Likewse. (java_parser_context_restore_global): Likewise. (java_parser_context_suspend): Likewise. (java_parser_context_resume): Likewise. (verify_constructor_circularity): Register GC roots. (lookup_cl): Likewise. (java_reorder_fields): Likewise. (build_current_this): Likewise. (class_in_current_package): Likewise. (argument_types_convertible): Likewise. (patch_cast): Rename wfl_op parameter to avoid macro conflicts. From-SVN: r36581
Diffstat (limited to 'gcc/java/jcf-write.c')
-rw-r--r--gcc/java/jcf-write.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 6a6d7e1..e08b37d 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -34,6 +34,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "parse.h" /* for BLOCK_EXPR_BODY */
#include "buffer.h"
#include "toplev.h"
+#include "ggc.h"
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
@@ -3100,7 +3101,11 @@ generate_classfile (clas, state)
/* generate the SourceFile attribute. */
if (SourceFile_node == NULL_TREE)
- SourceFile_node = get_identifier ("SourceFile");
+ {
+ SourceFile_node = get_identifier ("SourceFile");
+ ggc_add_tree_root (&SourceFile_node, 1);
+ }
+
i = find_utf8_constant (&state->cpool, SourceFile_node);
PUT2 (i); /* attribute_name_index */
PUT4 (2);
@@ -3126,7 +3131,10 @@ append_synthetic_attribute (state)
int i;
if (Synthetic_node == NULL_TREE)
- Synthetic_node = get_identifier ("Synthetic");
+ {
+ Synthetic_node = get_identifier ("Synthetic");
+ ggc_add_tree_root (&Synthetic_node, 1);
+ }
i = find_utf8_constant (&state->cpool, Synthetic_node);
PUT2 (i); /* Attribute string index */
PUT4 (0); /* Attribute length */
@@ -3150,8 +3158,11 @@ append_innerclasses_attribute (state, class)
ptr = append_chunk (NULL, 8, state); /* 2+4+2 */
- if (InnerClasses_node == NULL_TREE)
- InnerClasses_node = get_identifier ("InnerClasses");
+ if (InnerClasses_node == NULL_TREE)
+ {
+ InnerClasses_node = get_identifier ("InnerClasses");
+ ggc_add_tree_root (&InnerClasses_node, 1);
+ }
i = find_utf8_constant (&state->cpool, InnerClasses_node);
PUT2 (i);
length_marker = ptr; PUT4 (0); /* length, to be later patched */
@@ -3198,8 +3209,11 @@ append_innerclasses_attribute_entry (state, decl, name)
unsigned char *ptr = append_chunk (NULL, 8, state);
if (!anonymous_name)
- anonymous_name = get_identifier ("");
-
+ {
+ anonymous_name = get_identifier ("");
+ ggc_add_tree_root (&anonymous_name, 1);
+ }
+
icii = find_class_constant (&state->cpool, TREE_TYPE (decl));
ocii = find_class_constant (&state->cpool, TREE_TYPE (DECL_CONTEXT (decl)));