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/tree-ssa-strlen.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/tree-ssa-strlen.c')
-rw-r--r-- | gcc/tree-ssa-strlen.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index bc3d712..b452d9d 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -158,7 +158,7 @@ stridxlist_hasher::equal (const value_type *v, const compare_type *c) /* Hash table for mapping decls to a chained list of offset -> idx mappings. */ -static hash_table <stridxlist_hasher> decl_to_stridxlist_htab; +static hash_table<stridxlist_hasher> *decl_to_stridxlist_htab; /* Obstack for struct stridxlist and struct decl_stridxlist_map. */ static struct obstack stridx_obstack; @@ -183,7 +183,7 @@ get_addr_stridx (tree exp) struct stridxlist *list; tree base; - if (!decl_to_stridxlist_htab.is_created ()) + if (!decl_to_stridxlist_htab) return 0; base = get_addr_base_and_unit_offset (exp, &off); @@ -191,7 +191,7 @@ get_addr_stridx (tree exp) return 0; ent.base.from = base; - e = decl_to_stridxlist_htab.find_with_hash (&ent, DECL_UID (base)); + e = decl_to_stridxlist_htab->find_with_hash (&ent, DECL_UID (base)); if (e == NULL) return 0; @@ -279,14 +279,14 @@ addr_stridxptr (tree exp) if (base == NULL_TREE || !DECL_P (base)) return NULL; - if (!decl_to_stridxlist_htab.is_created ()) + if (!decl_to_stridxlist_htab) { - decl_to_stridxlist_htab.create (64); + decl_to_stridxlist_htab = new hash_table<stridxlist_hasher> (64); gcc_obstack_init (&stridx_obstack); } ent.base.from = base; - slot = decl_to_stridxlist_htab.find_slot_with_hash (&ent, DECL_UID (base), - INSERT); + slot = decl_to_stridxlist_htab->find_slot_with_hash (&ent, DECL_UID (base), + INSERT); if (*slot) { int i; @@ -2106,10 +2106,11 @@ pass_strlen::execute (function *fun) ssa_ver_to_stridx.release (); free_alloc_pool (strinfo_pool); - if (decl_to_stridxlist_htab.is_created ()) + if (decl_to_stridxlist_htab) { obstack_free (&stridx_obstack, NULL); - decl_to_stridxlist_htab.dispose (); + delete decl_to_stridxlist_htab; + decl_to_stridxlist_htab = NULL; } laststmt.stmt = NULL; laststmt.len = NULL_TREE; |