diff options
author | Anthony Green <green@cygnus.com> | 2000-02-26 05:12:27 +0000 |
---|---|---|
committer | Anthony Green <green@gcc.gnu.org> | 2000-02-26 05:12:27 +0000 |
commit | 3ff9925ce0be6f6e72f8da4d8ec96aad25e593f2 (patch) | |
tree | cfe8d050a2c658d4be3700810c5e25cbdfe9806d /gcc/java/java-tree.h | |
parent | 985dae7cdd18b543af8396c61c5332d685e47745 (diff) | |
download | gcc-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/java-tree.h')
-rw-r--r-- | gcc/java/java-tree.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 288a6cb..536fdc1 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -25,6 +25,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ /* Hacked by Per Bothner <bothner@cygnus.com> February 1996. */ +#include "hash.h" + /* Java language-specific tree codes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, enum java_tree_code { @@ -368,6 +370,12 @@ struct lang_identifier /* How specific the function is (for method selection - Java source code front-end */ #define DECL_SPECIFIC_COUNT(DECL) DECL_ARG_SLOT_COUNT(DECL) +/* For each function decl, init_test_table contains a hash table whose + entries are keyed on class names, and whose values are local + boolean decls. The variables are intended to be TRUE when the + class has been initialized in this function, and FALSE otherwise. */ +#define DECL_FUNCTION_INIT_TEST_TABLE(DECL) \ + (DECL_LANG_SPECIFIC(DECL)->init_test_table) /* In a LABEL_DECL, a TREE_VEC that saves the type_map at that point. */ #define LABEL_TYPE_STATE(NODE) (DECL_INITIAL (NODE)) @@ -429,6 +437,11 @@ struct lang_identifier #define DECL_LOCAL_SLOT_CHAIN(NODE) \ (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->slot_chain) +/* For a local VAR_DECL, holds the index into a words bitstring that + specifies if this decl is definitively assigned. + A DECL_BIT_INDEX of -1 means we no longer care. */ +#define DECL_BIT_INDEX(DECL) DECL_FIELD_SIZE(DECL) + /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */ struct lang_decl { @@ -443,8 +456,18 @@ struct lang_decl tree function_decl_body; /* Hold all function's statements */ tree called_constructor; /* When decl is a constructor, the list of other constructor it calls. */ + struct hash_table init_test_table; + /* Class initialization test variables. */ +}; + +/* init_test_table hash table entry structure. */ +struct init_test_hash_entry +{ + struct hash_entry root; + tree init_test_decl; }; + /* DECL_LANG_SPECIFIC for VAR_DECL and PARM_DECL. */ struct lang_decl_var { |