diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-07-09 03:06:09 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-07-09 03:06:09 +0000 |
commit | f98df77ce31d9b5986c0350c8c9d4e028fc0a49d (patch) | |
tree | fe302b0afef5f45efd91e938d8c2eb16e20e1d0a /gcc/graphite-clast-to-gimple.c | |
parent | 677f36a639850b44bf9645f75aacc5990e9aa1cb (diff) | |
download | gcc-f98df77ce31d9b5986c0350c8c9d4e028fc0a49d.zip gcc-f98df77ce31d9b5986c0350c8c9d4e028fc0a49d.tar.gz gcc-f98df77ce31d9b5986c0350c8c9d4e028fc0a49d.tar.bz2 |
convert some hash_table to hash_map
gcc/
* graphite-htab.h: Use hash_map instead of hash_table.
* graphite-clast-to-gimple.c: Adjust.
* passes.c: Use hash_map instead of hash_table.
* sese.c: Likewise.
* sese.h: Remove now unused code.
From-SVN: r212382
Diffstat (limited to 'gcc/graphite-clast-to-gimple.c')
-rw-r--r-- | gcc/graphite-clast-to-gimple.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 71507a0..296b893 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -1012,34 +1012,16 @@ build_iv_mapping (vec<tree> iv_map, struct clast_user_stmt *user_stmt, mpz_clear (bound_two); } -/* Construct bb_pbb_def with BB and PBB. */ - -static bb_pbb_def * -new_bb_pbb_def (basic_block bb, poly_bb_p pbb) -{ - bb_pbb_def *bb_pbb_p; - - bb_pbb_p = XNEW (bb_pbb_def); - bb_pbb_p->bb = bb; - bb_pbb_p->pbb = pbb; - - return bb_pbb_p; -} - /* Mark BB with it's relevant PBB via hashing table BB_PBB_MAPPING. */ static void mark_bb_with_pbb (poly_bb_p pbb, basic_block bb, bb_pbb_htab_type *bb_pbb_mapping) { - bb_pbb_def tmp; - bb_pbb_def **x; - - tmp.bb = bb; - x = bb_pbb_mapping->find_slot (&tmp, INSERT); - - if (x && !*x) - *x = new_bb_pbb_def (bb, pbb); + bool existed; + poly_bb_p &e = bb_pbb_mapping->get_or_insert (bb, &existed); + if (!existed) + e = pbb; } /* Find BB's related poly_bb_p in hash table BB_PBB_MAPPING. */ @@ -1047,14 +1029,9 @@ mark_bb_with_pbb (poly_bb_p pbb, basic_block bb, poly_bb_p find_pbb_via_hash (bb_pbb_htab_type *bb_pbb_mapping, basic_block bb) { - bb_pbb_def tmp; - bb_pbb_def **slot; - - tmp.bb = bb; - slot = bb_pbb_mapping->find_slot (&tmp, NO_INSERT); - - if (slot && *slot) - return ((bb_pbb_def *) *slot)->pbb; + poly_bb_p *pbb = bb_pbb_mapping->get (bb); + if (pbb) + return *pbb; return NULL; } |