diff options
Diffstat (limited to 'gcc/java/java-tree.h')
-rw-r--r-- | gcc/java/java-tree.h | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index e832f44..40b687d 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -710,6 +710,25 @@ union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"), && TREE_CODE (TREE_TYPE (NODE)) != POINTER_TYPE) \ || TREE_CODE (NODE) == REAL_CST) +struct GTY((for_user)) treetreehash_entry { + tree key; + tree value; +}; + +struct treetreehasher : ggc_hasher<treetreehash_entry *> +{ + typedef tree compare_type; + + static hashval_t hash (treetreehash_entry *); + static bool equal (treetreehash_entry *, tree); +}; + +struct ict_hasher : ggc_hasher<tree_node *> +{ + static hashval_t hash (tree t) { return htab_hash_pointer (t); } + static bool equal (tree a, tree b) { return a == b; } +}; + /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */ struct GTY(()) lang_decl_func { /* tree chain; not yet used. */ @@ -726,10 +745,10 @@ struct GTY(()) lang_decl_func { tree exc_obj; /* Decl holding the exception object. */ /* Class initialization test variables */ - htab_t GTY ((param_is (struct treetreehash_entry))) init_test_table; + hash_table<treetreehasher> *init_test_table; /* Initialized (static) Class Table */ - htab_t GTY ((param_is (union tree_node))) ict; + hash_table<ict_hasher> *ict; unsigned int native : 1; /* Nonzero if this is a native method */ unsigned int strictfp : 1; @@ -742,11 +761,6 @@ struct GTY(()) lang_decl_func { unsigned int varargs : 1; /* Varargs method. */ }; -struct GTY(()) treetreehash_entry { - tree key; - tree value; -}; - /* These represent the possible assertion_codes that can be emitted in the type assertion table. */ enum @@ -778,15 +792,21 @@ typedef enum JV_ANNOTATION_DEFAULT_KIND } jv_attr_kind; -typedef struct GTY(()) type_assertion { +typedef struct GTY((for_user)) type_assertion { int assertion_code; /* 'opcode' for the type of this assertion. */ tree op1; /* First operand. */ tree op2; /* Second operand. */ } type_assertion; -extern tree java_treetreehash_find (htab_t, tree); -extern tree * java_treetreehash_new (htab_t, tree); -extern htab_t java_treetreehash_create (size_t size); +struct type_assertion_hasher : ggc_hasher<type_assertion *> +{ + static hashval_t hash (type_assertion *); + static bool equal (type_assertion *, type_assertion *); +}; + +extern tree java_treetreehash_find (hash_table<treetreehasher> *, tree); +extern tree * java_treetreehash_new (hash_table<treetreehasher> *, tree); +extern hash_table<treetreehasher> *java_treetreehash_create (size_t size); /* DECL_LANG_SPECIFIC for VAR_DECL, PARM_DECL and sometimes FIELD_DECL (access methods on outer class fields) and final fields. */ @@ -893,11 +913,11 @@ struct GTY(()) lang_type { type matcher. */ vec<constructor_elt, va_gc> *catch_classes; - htab_t GTY ((param_is (struct treetreehash_entry))) type_to_runtime_map; + hash_table<treetreehasher> *type_to_runtime_map; /* The mapping of classes to exception region markers. */ - htab_t GTY ((param_is (struct type_assertion))) type_assertions; + hash_table<type_assertion_hasher> *type_assertions; /* Table of type assertions to be evaluated by the runtime when this class is loaded. */ @@ -1013,7 +1033,7 @@ extern void maybe_rewrite_invocation (tree *, vec<tree, va_gc> **, tree *, extern tree build_known_method_ref (tree, tree, tree, tree, vec<tree, va_gc> *, tree); extern tree build_class_init (tree, tree); -extern int attach_init_test_initialization_flags (void **, void *); +extern int attach_init_test_initialization_flags (treetreehash_entry **, tree); extern tree build_invokevirtual (tree, tree, tree); extern tree build_invokeinterface (tree, tree); extern tree build_jni_stub (tree); |