+2015-06-01 Martin Liska <mliska@suse.cz>
+
+ * tree-ssa-strlen.c (new_strinfo): Use new type-based pool allocator.
+ (free_strinfo): Likewise.
+ (pass_strlen::execute): Likewise.
+
2015-06-01 Martin Liska <mliska@suse.cz>
* tree-ssa-sccvn.c (vn_reference_insert): Use new type-based pool allocator.
} *strinfo;
/* Pool for allocating strinfo_struct entries. */
-static alloc_pool strinfo_pool;
+static pool_allocator<strinfo_struct> strinfo_pool ("strinfo_struct pool", 64);
/* Vector mapping positive string indexes to strinfo, for the
current basic block. The first pointer in the vector is special,
static strinfo
new_strinfo (tree ptr, int idx, tree length)
{
- strinfo si = (strinfo) pool_alloc (strinfo_pool);
+ strinfo si = strinfo_pool.allocate ();
si->length = length;
si->ptr = ptr;
si->stmt = NULL;
free_strinfo (strinfo si)
{
if (si && --si->refcount == 0)
- pool_free (strinfo_pool, si);
+ strinfo_pool.remove (si);
}
/* Set strinfo in the vector entry IDX to SI. */
{
ssa_ver_to_stridx.safe_grow_cleared (num_ssa_names);
max_stridx = 1;
- strinfo_pool = create_alloc_pool ("strinfo_struct pool",
- sizeof (struct strinfo_struct), 64);
calculate_dominance_info (CDI_DOMINATORS);
strlen_dom_walker (CDI_DOMINATORS).walk (fun->cfg->x_entry_block_ptr);
ssa_ver_to_stridx.release ();
- free_alloc_pool (strinfo_pool);
+ strinfo_pool.release ();
if (decl_to_stridxlist_htab)
{
obstack_free (&stridx_obstack, NULL);