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/fold-const.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/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 73 |
1 files changed, 30 insertions, 43 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 978b854..f6b72b7 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -14686,7 +14686,7 @@ fold (tree expr) #undef fold static void fold_checksum_tree (const_tree, struct md5_ctx *, - hash_table <pointer_hash <tree_node> >); + hash_table<pointer_hash<tree_node> > *); static void fold_check_failed (const_tree, const_tree); void print_fold_checksum (const_tree); @@ -14700,20 +14700,18 @@ fold (tree expr) tree ret; struct md5_ctx ctx; unsigned char checksum_before[16], checksum_after[16]; - hash_table <pointer_hash <tree_node> > ht; + hash_table<pointer_hash<tree_node> > ht (32); - ht.create (32); md5_init_ctx (&ctx); - fold_checksum_tree (expr, &ctx, ht); + fold_checksum_tree (expr, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before); ht.empty (); ret = fold_1 (expr); md5_init_ctx (&ctx); - fold_checksum_tree (expr, &ctx, ht); + fold_checksum_tree (expr, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after); - ht.dispose (); if (memcmp (checksum_before, checksum_after, 16)) fold_check_failed (expr, ret); @@ -14726,13 +14724,11 @@ print_fold_checksum (const_tree expr) { struct md5_ctx ctx; unsigned char checksum[16], cnt; - hash_table <pointer_hash <tree_node> > ht; + hash_table<pointer_hash<tree_node> > ht (32); - ht.create (32); md5_init_ctx (&ctx); - fold_checksum_tree (expr, &ctx, ht); + fold_checksum_tree (expr, &ctx, &ht); md5_finish_ctx (&ctx, checksum); - ht.dispose (); for (cnt = 0; cnt < 16; ++cnt) fprintf (stderr, "%02x", checksum[cnt]); putc ('\n', stderr); @@ -14746,7 +14742,7 @@ fold_check_failed (const_tree expr ATTRIBUTE_UNUSED, const_tree ret ATTRIBUTE_UN static void fold_checksum_tree (const_tree expr, struct md5_ctx *ctx, - hash_table <pointer_hash <tree_node> > ht) + hash_table<pointer_hash <tree_node> > *ht) { tree_node **slot; enum tree_code code; @@ -14756,7 +14752,7 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx, recursive_label: if (expr == NULL) return; - slot = ht.find_slot (expr, INSERT); + slot = ht->find_slot (expr, INSERT); if (*slot != NULL) return; *slot = CONST_CAST_TREE (expr); @@ -14903,11 +14899,10 @@ debug_fold_checksum (const_tree t) int i; unsigned char checksum[16]; struct md5_ctx ctx; - hash_table <pointer_hash <tree_node> > ht; - ht.create (32); + hash_table<pointer_hash<tree_node> > ht (32); md5_init_ctx (&ctx); - fold_checksum_tree (t, &ctx, ht); + fold_checksum_tree (t, &ctx, &ht); md5_finish_ctx (&ctx, checksum); ht.empty (); @@ -14932,11 +14927,10 @@ fold_build1_stat_loc (location_t loc, #ifdef ENABLE_FOLD_CHECKING unsigned char checksum_before[16], checksum_after[16]; struct md5_ctx ctx; - hash_table <pointer_hash <tree_node> > ht; + hash_table<pointer_hash<tree_node> > ht (32); - ht.create (32); md5_init_ctx (&ctx); - fold_checksum_tree (op0, &ctx, ht); + fold_checksum_tree (op0, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before); ht.empty (); #endif @@ -14947,9 +14941,8 @@ fold_build1_stat_loc (location_t loc, #ifdef ENABLE_FOLD_CHECKING md5_init_ctx (&ctx); - fold_checksum_tree (op0, &ctx, ht); + fold_checksum_tree (op0, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after); - ht.dispose (); if (memcmp (checksum_before, checksum_after, 16)) fold_check_failed (op0, tem); @@ -14975,16 +14968,15 @@ fold_build2_stat_loc (location_t loc, checksum_after_op0[16], checksum_after_op1[16]; struct md5_ctx ctx; - hash_table <pointer_hash <tree_node> > ht; + hash_table<pointer_hash<tree_node> > ht (32); - ht.create (32); md5_init_ctx (&ctx); - fold_checksum_tree (op0, &ctx, ht); + fold_checksum_tree (op0, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_op0); ht.empty (); md5_init_ctx (&ctx); - fold_checksum_tree (op1, &ctx, ht); + fold_checksum_tree (op1, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_op1); ht.empty (); #endif @@ -14995,7 +14987,7 @@ fold_build2_stat_loc (location_t loc, #ifdef ENABLE_FOLD_CHECKING md5_init_ctx (&ctx); - fold_checksum_tree (op0, &ctx, ht); + fold_checksum_tree (op0, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_op0); ht.empty (); @@ -15003,9 +14995,8 @@ fold_build2_stat_loc (location_t loc, fold_check_failed (op0, tem); md5_init_ctx (&ctx); - fold_checksum_tree (op1, &ctx, ht); + fold_checksum_tree (op1, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_op1); - ht.dispose (); if (memcmp (checksum_before_op1, checksum_after_op1, 16)) fold_check_failed (op1, tem); @@ -15031,21 +15022,20 @@ fold_build3_stat_loc (location_t loc, enum tree_code code, tree type, checksum_after_op1[16], checksum_after_op2[16]; struct md5_ctx ctx; - hash_table <pointer_hash <tree_node> > ht; + hash_table<pointer_hash<tree_node> > ht (32); - ht.create (32); md5_init_ctx (&ctx); - fold_checksum_tree (op0, &ctx, ht); + fold_checksum_tree (op0, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_op0); ht.empty (); md5_init_ctx (&ctx); - fold_checksum_tree (op1, &ctx, ht); + fold_checksum_tree (op1, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_op1); ht.empty (); md5_init_ctx (&ctx); - fold_checksum_tree (op2, &ctx, ht); + fold_checksum_tree (op2, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_op2); ht.empty (); #endif @@ -15057,7 +15047,7 @@ fold_build3_stat_loc (location_t loc, enum tree_code code, tree type, #ifdef ENABLE_FOLD_CHECKING md5_init_ctx (&ctx); - fold_checksum_tree (op0, &ctx, ht); + fold_checksum_tree (op0, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_op0); ht.empty (); @@ -15065,7 +15055,7 @@ fold_build3_stat_loc (location_t loc, enum tree_code code, tree type, fold_check_failed (op0, tem); md5_init_ctx (&ctx); - fold_checksum_tree (op1, &ctx, ht); + fold_checksum_tree (op1, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_op1); ht.empty (); @@ -15073,9 +15063,8 @@ fold_build3_stat_loc (location_t loc, enum tree_code code, tree type, fold_check_failed (op1, tem); md5_init_ctx (&ctx); - fold_checksum_tree (op2, &ctx, ht); + fold_checksum_tree (op2, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_op2); - ht.dispose (); if (memcmp (checksum_before_op2, checksum_after_op2, 16)) fold_check_failed (op2, tem); @@ -15099,18 +15088,17 @@ fold_build_call_array_loc (location_t loc, tree type, tree fn, checksum_after_fn[16], checksum_after_arglist[16]; struct md5_ctx ctx; - hash_table <pointer_hash <tree_node> > ht; + hash_table<pointer_hash<tree_node> > ht (32); int i; - ht.create (32); md5_init_ctx (&ctx); - fold_checksum_tree (fn, &ctx, ht); + fold_checksum_tree (fn, &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_fn); ht.empty (); md5_init_ctx (&ctx); for (i = 0; i < nargs; i++) - fold_checksum_tree (argarray[i], &ctx, ht); + fold_checksum_tree (argarray[i], &ctx, &ht); md5_finish_ctx (&ctx, checksum_before_arglist); ht.empty (); #endif @@ -15119,7 +15107,7 @@ fold_build_call_array_loc (location_t loc, tree type, tree fn, #ifdef ENABLE_FOLD_CHECKING md5_init_ctx (&ctx); - fold_checksum_tree (fn, &ctx, ht); + fold_checksum_tree (fn, &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_fn); ht.empty (); @@ -15128,9 +15116,8 @@ fold_build_call_array_loc (location_t loc, tree type, tree fn, md5_init_ctx (&ctx); for (i = 0; i < nargs; i++) - fold_checksum_tree (argarray[i], &ctx, ht); + fold_checksum_tree (argarray[i], &ctx, &ht); md5_finish_ctx (&ctx, checksum_after_arglist); - ht.dispose (); if (memcmp (checksum_before_arglist, checksum_after_arglist, 16)) fold_check_failed (NULL_TREE, tem); |