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/asan.c | |
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/asan.c')
-rw-r--r-- | gcc/asan.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -2368,15 +2368,15 @@ initialize_sanitizer_builtins (void) /* Called via htab_traverse. Count number of emitted STRING_CSTs in the constant hash table. */ -static int -count_string_csts (void **slot, void *data) +int +count_string_csts (constant_descriptor_tree **slot, + unsigned HOST_WIDE_INT *data) { - struct constant_descriptor_tree *desc - = (struct constant_descriptor_tree *) *slot; + struct constant_descriptor_tree *desc = *slot; if (TREE_CODE (desc->value) == STRING_CST && TREE_ASM_WRITTEN (desc->value) && asan_protect_global (desc->value)) - ++*((unsigned HOST_WIDE_INT *) data); + ++*data; return 1; } @@ -2389,20 +2389,18 @@ struct asan_add_string_csts_data vec<constructor_elt, va_gc> *v; }; -/* Called via htab_traverse. Call asan_add_global +/* Called via hash_table::traverse. Call asan_add_global on emitted STRING_CSTs from the constant hash table. */ -static int -add_string_csts (void **slot, void *data) +int +add_string_csts (constant_descriptor_tree **slot, + asan_add_string_csts_data *aascd) { - struct constant_descriptor_tree *desc - = (struct constant_descriptor_tree *) *slot; + struct constant_descriptor_tree *desc = *slot; if (TREE_CODE (desc->value) == STRING_CST && TREE_ASM_WRITTEN (desc->value) && asan_protect_global (desc->value)) { - struct asan_add_string_csts_data *aascd - = (struct asan_add_string_csts_data *) data; asan_add_global (SYMBOL_REF_DECL (XEXP (desc->rtl, 0)), aascd->type, aascd->v); } @@ -2440,8 +2438,9 @@ asan_finish_file (void) if (TREE_ASM_WRITTEN (vnode->decl) && asan_protect_global (vnode->decl)) ++gcount; - htab_t const_desc_htab = constant_pool_htab (); - htab_traverse (const_desc_htab, count_string_csts, &gcount); + hash_table<tree_descriptor_hasher> *const_desc_htab = constant_pool_htab (); + const_desc_htab->traverse<unsigned HOST_WIDE_INT *, count_string_csts> + (&gcount); if (gcount) { tree type = asan_global_struct (), var, ctor; @@ -2465,7 +2464,8 @@ asan_finish_file (void) struct asan_add_string_csts_data aascd; aascd.type = TREE_TYPE (type); aascd.v = v; - htab_traverse (const_desc_htab, add_string_csts, &aascd); + const_desc_htab->traverse<asan_add_string_csts_data *, add_string_csts> + (&aascd); ctor = build_constructor (type, v); TREE_CONSTANT (ctor) = 1; TREE_STATIC (ctor) = 1; |