diff options
author | Martin Liska <mliska@suse.cz> | 2015-06-01 14:40:47 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2015-06-01 12:40:47 +0000 |
commit | 295e70472859075e8cc0c8b00ff1f13aac57a628 (patch) | |
tree | e4baafc4f2eb2a2db56240f8ada32cd5f00acd44 /gcc | |
parent | a78a26f11e2e95d4bb43f1782f891d8210d03e0d (diff) | |
download | gcc-295e70472859075e8cc0c8b00ff1f13aac57a628.zip gcc-295e70472859075e8cc0c8b00ff1f13aac57a628.tar.gz gcc-295e70472859075e8cc0c8b00ff1f13aac57a628.tar.bz2 |
Change use to type-based pool allocator in
* df-problems.c (df_chain_create):Use new type-based pool allocator.
(df_chain_unlink_1) Likewise.
(df_chain_unlink) Likewise.
(df_chain_remove_problem) Likewise.
(df_chain_alloc) Likewise.
(df_chain_free) Likewise.
* df.h (struct dataflow) Likewise.
From-SVN: r223953
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/df-problems.c | 14 | ||||
-rw-r--r-- | gcc/df.h | 2 |
3 files changed, 18 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3723ec..561dac3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 2015-06-01 Martin Liska <mliska@suse.cz> + * df-problems.c (df_chain_create):Use new type-based pool allocator. + (df_chain_unlink_1) Likewise. + (df_chain_unlink) Likewise. + (df_chain_remove_problem) Likewise. + (df_chain_alloc) Likewise. + (df_chain_free) Likewise. + * df.h (struct dataflow) Likewise. + +2015-06-01 Martin Liska <mliska@suse.cz> + * cselib.c (new_elt_list):Use new type-based pool allocator. (new_elt_loc_list) Likewise. (unchain_one_elt_list) Likewise. diff --git a/gcc/df-problems.c b/gcc/df-problems.c index ff08abd..7700157 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -1879,7 +1879,7 @@ struct df_link * df_chain_create (df_ref src, df_ref dst) { struct df_link *head = DF_REF_CHAIN (src); - struct df_link *link = (struct df_link *) pool_alloc (df_chain->block_pool); + struct df_link *link = df_chain->block_pool->allocate (); DF_REF_CHAIN (src) = link; link->next = head; @@ -1904,7 +1904,7 @@ df_chain_unlink_1 (df_ref ref, df_ref target) prev->next = chain->next; else DF_REF_CHAIN (ref) = chain->next; - pool_free (df_chain->block_pool, chain); + df_chain->block_pool->remove (chain); return; } prev = chain; @@ -1924,7 +1924,7 @@ df_chain_unlink (df_ref ref) struct df_link *next = chain->next; /* Delete the other side if it exists. */ df_chain_unlink_1 (chain->ref, ref); - pool_free (df_chain->block_pool, chain); + df_chain->block_pool->remove (chain); chain = next; } DF_REF_CHAIN (ref) = NULL; @@ -1956,7 +1956,7 @@ df_chain_remove_problem (void) /* Wholesale destruction of the old chains. */ if (df_chain->block_pool) - free_alloc_pool (df_chain->block_pool); + delete df_chain->block_pool; EXECUTE_IF_SET_IN_BITMAP (df_chain->out_of_date_transfer_functions, 0, bb_index, bi) { @@ -2010,8 +2010,8 @@ static void df_chain_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) { df_chain_remove_problem (); - df_chain->block_pool = create_alloc_pool ("df_chain_block pool", - sizeof (struct df_link), 50); + df_chain->block_pool = new pool_allocator<df_link> ("df_chain_block pool", + 50); df_chain->optional_p = true; } @@ -2146,7 +2146,7 @@ df_chain_finalize (bitmap all_blocks) static void df_chain_free (void) { - free_alloc_pool (df_chain->block_pool); + delete df_chain->block_pool; BITMAP_FREE (df_chain->out_of_date_transfer_functions); free (df_chain); } @@ -305,7 +305,7 @@ struct dataflow unsigned int block_info_size; /* The pool to allocate the block_info from. */ - alloc_pool block_pool; + pool_allocator<df_link> *block_pool; /* The lr and live problems have their transfer functions recomputed only if necessary. This is possible for them because, the |