From: Martin Liska Date: Mon, 1 Jun 2015 12:42:45 +0000 (+0200) Subject: Change use to type-based pool allocator in X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2cc777fbf4b866db1477f25e06358b1de7fb3500;p=gcc.git Change use to type-based pool allocator in * tree-ssa-math-opts.c (occ_new): Use new type-based pool allocator. (free_bb): Likewise. (pass_cse_reciprocals::execute): Likewise. From-SVN: r223957 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec7f5b7ac9d..7f28f205fa4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-06-01 Martin Liska + + * tree-ssa-math-opts.c (occ_new): Use new type-based pool allocator. + (free_bb): Likewise. + (pass_cse_reciprocals::execute): Likewise. + 2015-06-01 Martin Liska * tree-sra.c (sra_initialize): Use new type-based pool allocator. diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 98e2c495333..0df755b8d17 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -229,7 +229,7 @@ static struct static struct occurrence *occ_head; /* Allocation pool for getting instances of "struct occurrence". */ -static alloc_pool occ_pool; +static pool_allocator *occ_pool; @@ -240,7 +240,7 @@ occ_new (basic_block bb, struct occurrence *children) { struct occurrence *occ; - bb->aux = occ = (struct occurrence *) pool_alloc (occ_pool); + bb->aux = occ = occ_pool->allocate (); memset (occ, 0, sizeof (struct occurrence)); occ->bb = bb; @@ -468,7 +468,7 @@ free_bb (struct occurrence *occ) next = occ->next; child = occ->children; occ->bb->aux = NULL; - pool_free (occ_pool, occ); + occ_pool->remove (occ); /* Now ensure that we don't recurse unless it is necessary. */ if (!child) @@ -572,9 +572,8 @@ pass_cse_reciprocals::execute (function *fun) basic_block bb; tree arg; - occ_pool = create_alloc_pool ("dominators for recip", - sizeof (struct occurrence), - n_basic_blocks_for_fn (fun) / 3 + 1); + occ_pool = new pool_allocator + ("dominators for recip", n_basic_blocks_for_fn (fun) / 3 + 1); memset (&reciprocal_stats, 0, sizeof (reciprocal_stats)); calculate_dominance_info (CDI_DOMINATORS); @@ -704,7 +703,7 @@ pass_cse_reciprocals::execute (function *fun) free_dominance_info (CDI_DOMINATORS); free_dominance_info (CDI_POST_DOMINATORS); - free_alloc_pool (occ_pool); + delete occ_pool; return 0; }