aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c44
1 files changed, 7 insertions, 37 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 7444c90..818c290 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -271,28 +271,13 @@ struct access
/* Set when we discover that this pointer is not safe to dereference in the
caller. */
unsigned grp_not_necessarilly_dereferenced : 1;
-
- /* Pool allocation new operator. */
- inline void *operator new (size_t)
- {
- return pool.allocate ();
- }
-
- /* Delete operator utilizing pool allocation. */
- inline void operator delete (void *ptr)
- {
- pool.remove ((access *) ptr);
- }
-
- /* Memory allocation pool. */
- static pool_allocator<access> pool;
};
typedef struct access *access_p;
/* Alloc pool for allocating access structures. */
-pool_allocator<struct access> access::pool ("SRA accesses", 16);
+static object_allocator<struct access> access_pool ("SRA accesses", 16);
/* A structure linking lhs and rhs accesses from an aggregate assignment. They
are used to propagate subaccesses from rhs to lhs as long as they don't
@@ -301,25 +286,10 @@ struct assign_link
{
struct access *lacc, *racc;
struct assign_link *next;
-
- /* Pool allocation new operator. */
- inline void *operator new (size_t)
- {
- return pool.allocate ();
- }
-
- /* Delete operator utilizing pool allocation. */
- inline void operator delete (void *ptr)
- {
- pool.remove ((assign_link *) ptr);
- }
-
- /* Memory allocation pool. */
- static pool_allocator<assign_link> pool;
};
/* Alloc pool for allocating assign link structures. */
-pool_allocator<assign_link> assign_link::pool ("SRA links", 16);
+static object_allocator<assign_link> assign_link_pool ("SRA links", 16);
/* Base (tree) -> Vector (vec<access_p> *) map. */
static hash_map<tree, auto_vec<access_p> > *base_access_vec;
@@ -706,8 +676,8 @@ sra_deinitialize (void)
candidates = NULL;
BITMAP_FREE (should_scalarize_away_bitmap);
BITMAP_FREE (cannot_scalarize_away_bitmap);
- access::pool.release ();
- assign_link::pool.release ();
+ access_pool.release ();
+ assign_link_pool.release ();
obstack_free (&name_obstack, NULL);
delete base_access_vec;
@@ -859,7 +829,7 @@ mark_parm_dereference (tree base, HOST_WIDE_INT dist, gimple stmt)
static struct access *
create_access_1 (tree base, HOST_WIDE_INT offset, HOST_WIDE_INT size)
{
- struct access *access = new struct access;
+ struct access *access = access_pool.allocate ();
memset (access, 0, sizeof (struct access));
access->base = base;
@@ -1235,7 +1205,7 @@ build_accesses_from_assign (gimple stmt)
{
struct assign_link *link;
- link = new assign_link;
+ link = assign_link_pool.allocate ();
memset (link, 0, sizeof (struct assign_link));
link->lacc = lacc;
@@ -2394,7 +2364,7 @@ create_artificial_child_access (struct access *parent, struct access *model,
gcc_assert (!model->grp_unscalarizable_region);
- struct access *access = new struct access;
+ struct access *access = access_pool.allocate ();
memset (access, 0, sizeof (struct access));
if (!build_user_friendly_ref_for_offset (&expr, TREE_TYPE (expr), new_offset,
model->type))