aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorAnthony Green <green@cygnus.com>2000-02-26 05:12:27 +0000
committerAnthony Green <green@gcc.gnu.org>2000-02-26 05:12:27 +0000
commit3ff9925ce0be6f6e72f8da4d8ec96aad25e593f2 (patch)
treecfe8d050a2c658d4be3700810c5e25cbdfe9806d /gcc/java/jcf-parse.c
parent985dae7cdd18b543af8396c61c5332d685e47745 (diff)
downloadgcc-3ff9925ce0be6f6e72f8da4d8ec96aad25e593f2.zip
gcc-3ff9925ce0be6f6e72f8da4d8ec96aad25e593f2.tar.gz
gcc-3ff9925ce0be6f6e72f8da4d8ec96aad25e593f2.tar.bz2
expr.c (build_class_init): Mark the decl to be ignored by check_init.
2000-02-25 Anthony Green <green@cygnus.com> * expr.c (build_class_init): Mark the decl to be ignored by check_init. * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c * check-init.c: Move DECL_BIT_INDEX to java-tree.h * class.c (init_test_hash_newfunc): New function. (decl_hash): New function. (decl_compare): New function. * decl.c (emit_init_test_initialization): New function. (complete_start_java_method): Traverse the init test hashtable, calling emit_init_test_initialization. (always_initialize_class_p): Define. * expr.c (build_class_init): Use initialization tests when emitting class initialization code. (always_initialize_class_p): Declare. * jcf-parse.c (parse_class_file): Set always_initialize_class_p to 1. * java-tree.h: Include hash.h. (DECL_FUNCTION_INIT_TEST_TABLE): Define. (struct lang_decl): Add init_test_table field. (init_test_hash_entry): Define. From-SVN: r32166
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index a10f605..770cec6 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -57,6 +57,10 @@ extern struct obstack *saveable_obstack;
extern struct obstack temporary_obstack;
extern struct obstack permanent_obstack;
+/* Set to non-zero value in order to emit class initilization code
+ before static field references. */
+extern int always_initialize_class_p;
+
/* The class we are currently processing. */
tree current_class = NULL_TREE;
@@ -646,6 +650,10 @@ parse_class_file ()
debug_start_source_file (input_filename);
init_outgoing_cpool ();
+ /* Currently we always have to emit calls to _Jv_InitClass when
+ compiling from class files. */
+ always_initialize_class_p = 1;
+
for ( method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class));
method != NULL_TREE; method = TREE_CHAIN (method))
{