diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-10-12 22:22:53 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-10-12 22:22:53 +0000 |
commit | 2a22f99cb12d82712dd93cfef808b1cef543601b (patch) | |
tree | c828063f153ceb609ce5c7d44ea9f00391b32950 /gcc/java/java-tree.h | |
parent | 7b262a51ea2310bdb6cc901de00f04b0e7be0a4e (diff) | |
download | gcc-2a22f99cb12d82712dd93cfef808b1cef543601b.zip gcc-2a22f99cb12d82712dd93cfef808b1cef543601b.tar.gz gcc-2a22f99cb12d82712dd93cfef808b1cef543601b.tar.bz2 |
move many gc hashtab to hash_table
gcc/
* asan.c, cfgloop.c, cfgloop.h, cgraph.c, cgraph.h,
config/darwin.c, config/m32c/m32c.c, config/mep/mep.c,
config/mips/mips.c, config/rs6000/rs6000.c, dwarf2out.c,
function.c, function.h, gimple-ssa.h, libfuncs.h, optabs.c,
output.h, rtl.h, sese.c, symtab.c, tree-cfg.c, tree-dfa.c,
tree-ssa.c, varasm.c: Use hash-table instead of hashtab.
* doc/gty.texi (for_user): Document new option.
* gengtype.c (create_user_defined_type): Don't try to get a struct for
char.
(walk_type): Don't error out on for_user option.
(write_func_for_structure): Emit user marking routines if requested by
for_user option.
(write_local_func_for_structure): Likewise.
(main): Mark types with for_user option as used.
* ggc.h (gt_pch_nx): Add overload for unsigned int.
* hash-map.h (hash_map::hash_entry::pch_nx_helper): AddOverloads.
* hash-table.h (ggc_hasher): New struct.
(hash_table::create_ggc): New function.
(gt_pch_nx): New overload for hash_table.
java/
* class.c, decl.c, except.c, expr.c, java-tree.h, lang.c: Use
hash_table instead of hashtab.
objc/
* objc-act.c: use hash_table instead of hashtab.
cp/
* cp-gimplify.c, cp-tree.h, decl.c, mangle.c, name-lookup.c,
pt.c, semantics.c, tree.c, typeck2.c: Use hash_table instead of
hashtab.
fortran/
* trans-decl.c, trans.c, trans.h: Use hash_table instead of hashtab.
c-family/
* c-common.c: Use hash_table instead of hashtab.
From-SVN: r216127
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); |