diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-06-24 13:21:35 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-06-24 13:21:35 +0000 |
commit | c203e8a73b2f12a1da52a16a0c4a50e62b42445b (patch) | |
tree | b8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/ipa-devirt.c | |
parent | fbc2a724d481bb5c205baeaaa955533451226d01 (diff) | |
download | gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.zip gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.tar.gz gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.tar.bz2 |
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index a90d1dc..604b809 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -324,8 +324,8 @@ odr_hasher::remove (value_type *v) /* ODR type hash used to lookup ODR type based on tree type node. */ -typedef hash_table <odr_hasher> odr_hash_type; -static odr_hash_type odr_hash; +typedef hash_table<odr_hasher> odr_hash_type; +static odr_hash_type *odr_hash; /* ODR types are also stored into ODR_TYPE vector to allow consistent walking. Bases appear before derived types. Vector is garbage collected @@ -473,7 +473,8 @@ get_odr_type (tree type, bool insert) type = TYPE_MAIN_VARIANT (type); gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type); hash = hash_type_name (type); - slot = odr_hash.find_slot_with_hash (type, hash, insert ? INSERT : NO_INSERT); + slot + = odr_hash->find_slot_with_hash (type, hash, insert ? INSERT : NO_INSERT); if (!slot) return NULL; @@ -611,11 +612,11 @@ build_type_inheritance_graph (void) FILE *inheritance_dump_file; int flags; - if (odr_hash.is_created ()) + if (odr_hash) return; timevar_push (TV_IPA_INHERITANCE); inheritance_dump_file = dump_begin (TDI_inheritance, &flags); - odr_hash.create (23); + odr_hash = new odr_hash_type (23); /* We reconstruct the graph starting of types of all methods seen in the the unit. */ @@ -1011,9 +1012,9 @@ polymorphic_call_target_hasher::remove (value_type *v) /* Polymorphic call target query cache. */ -typedef hash_table <polymorphic_call_target_hasher> +typedef hash_table<polymorphic_call_target_hasher> polymorphic_call_target_hash_type; -static polymorphic_call_target_hash_type polymorphic_call_target_hash; +static polymorphic_call_target_hash_type *polymorphic_call_target_hash; /* Destroy polymorphic call target query cache. */ @@ -1022,7 +1023,8 @@ free_polymorphic_call_targets_hash () { if (cached_polymorphic_call_targets) { - polymorphic_call_target_hash.dispose (); + delete polymorphic_call_target_hash; + polymorphic_call_target_hash = NULL; pointer_set_destroy (cached_polymorphic_call_targets); cached_polymorphic_call_targets = NULL; } @@ -1599,7 +1601,7 @@ possible_polymorphic_call_targets (tree otr_type, bool skipped = false; /* If ODR is not initialized, return empty incomplete list. */ - if (!odr_hash.is_created ()) + if (!odr_hash) { if (completep) *completep = false; @@ -1656,7 +1658,8 @@ possible_polymorphic_call_targets (tree otr_type, if (!cached_polymorphic_call_targets) { cached_polymorphic_call_targets = pointer_set_create (); - polymorphic_call_target_hash.create (23); + polymorphic_call_target_hash + = new polymorphic_call_target_hash_type (23); if (!node_removal_hook_holder) { node_removal_hook_holder = @@ -1670,7 +1673,7 @@ possible_polymorphic_call_targets (tree otr_type, key.type = type; key.otr_token = otr_token; key.context = context; - slot = polymorphic_call_target_hash.find_slot (&key, INSERT); + slot = polymorphic_call_target_hash->find_slot (&key, INSERT); if (cache_token) *cache_token = (void *)*slot; if (*slot) @@ -1865,7 +1868,7 @@ possible_polymorphic_call_target_p (tree otr_type, || fcode == BUILT_IN_TRAP)) return true; - if (!odr_hash.is_created ()) + if (!odr_hash) return true; targets = possible_polymorphic_call_targets (otr_type, otr_token, ctx, &final); for (i = 0; i < targets.length (); i++) @@ -1888,7 +1891,7 @@ update_type_inheritance_graph (void) { struct cgraph_node *n; - if (!odr_hash.is_created ()) + if (!odr_hash) return; free_polymorphic_call_targets_hash (); timevar_push (TV_IPA_INHERITANCE); |