Commit dc5667a3 by Martin Liska Committed by Martin Liska

Change use to type-based pool allocator in

	* tree-ssa-structalias.c (new_var_info): Use new type-based pool allocator.
	(new_constraint): Likewise.
	(init_alias_vars): Likewise.
	(delete_points_to_sets): Likewise.

From-SVN: r223967
parent 33e7d32e
2015-06-01 Martin Liska <mliska@suse.cz> 2015-06-01 Martin Liska <mliska@suse.cz>
* tree-ssa-structalias.c (new_var_info): Use new type-based pool allocator.
(new_constraint): Likewise.
(init_alias_vars): Likewise.
(delete_points_to_sets): Likewise.
2015-06-01 Martin Liska <mliska@suse.cz>
* tree-ssa-strlen.c (new_strinfo): Use new type-based pool allocator. * tree-ssa-strlen.c (new_strinfo): Use new type-based pool allocator.
(free_strinfo): Likewise. (free_strinfo): Likewise.
(pass_strlen::execute): Likewise. (pass_strlen::execute): Likewise.
......
...@@ -354,7 +354,8 @@ static varinfo_t lookup_vi_for_tree (tree); ...@@ -354,7 +354,8 @@ static varinfo_t lookup_vi_for_tree (tree);
static inline bool type_can_have_subvars (const_tree); static inline bool type_can_have_subvars (const_tree);
/* Pool of variable info structures. */ /* Pool of variable info structures. */
static alloc_pool variable_info_pool; static pool_allocator<variable_info> variable_info_pool
("Variable info pool", 30);
/* Map varinfo to final pt_solution. */ /* Map varinfo to final pt_solution. */
static hash_map<varinfo_t, pt_solution *> *final_solutions; static hash_map<varinfo_t, pt_solution *> *final_solutions;
...@@ -395,7 +396,7 @@ static varinfo_t ...@@ -395,7 +396,7 @@ static varinfo_t
new_var_info (tree t, const char *name) new_var_info (tree t, const char *name)
{ {
unsigned index = varmap.length (); unsigned index = varmap.length ();
varinfo_t ret = (varinfo_t) pool_alloc (variable_info_pool); varinfo_t ret = variable_info_pool.allocate ();
ret->id = index; ret->id = index;
ret->name = name; ret->name = name;
...@@ -554,7 +555,7 @@ struct constraint ...@@ -554,7 +555,7 @@ struct constraint
/* List of constraints that we use to build the constraint graph from. */ /* List of constraints that we use to build the constraint graph from. */
static vec<constraint_t> constraints; static vec<constraint_t> constraints;
static alloc_pool constraint_pool; static pool_allocator<constraint> constraint_pool ("Constraint pool", 30);
/* The constraint graph is represented as an array of bitmaps /* The constraint graph is represented as an array of bitmaps
containing successor nodes. */ containing successor nodes. */
...@@ -676,7 +677,7 @@ static constraint_t ...@@ -676,7 +677,7 @@ static constraint_t
new_constraint (const struct constraint_expr lhs, new_constraint (const struct constraint_expr lhs,
const struct constraint_expr rhs) const struct constraint_expr rhs)
{ {
constraint_t ret = (constraint_t) pool_alloc (constraint_pool); constraint_t ret = constraint_pool.allocate ();
ret->lhs = lhs; ret->lhs = lhs;
ret->rhs = rhs; ret->rhs = rhs;
return ret; return ret;
...@@ -6681,10 +6682,6 @@ init_alias_vars (void) ...@@ -6681,10 +6682,6 @@ init_alias_vars (void)
bitmap_obstack_initialize (&oldpta_obstack); bitmap_obstack_initialize (&oldpta_obstack);
bitmap_obstack_initialize (&predbitmap_obstack); bitmap_obstack_initialize (&predbitmap_obstack);
constraint_pool = create_alloc_pool ("Constraint pool",
sizeof (struct constraint), 30);
variable_info_pool = create_alloc_pool ("Variable info pool",
sizeof (struct variable_info), 30);
constraints.create (8); constraints.create (8);
varmap.create (8); varmap.create (8);
vi_for_tree = new hash_map<tree, varinfo_t>; vi_for_tree = new hash_map<tree, varinfo_t>;
...@@ -6964,8 +6961,8 @@ delete_points_to_sets (void) ...@@ -6964,8 +6961,8 @@ delete_points_to_sets (void)
free (graph); free (graph);
varmap.release (); varmap.release ();
free_alloc_pool (variable_info_pool); variable_info_pool.release ();
free_alloc_pool (constraint_pool); constraint_pool.release ();
obstack_free (&fake_var_decl_obstack, NULL); obstack_free (&fake_var_decl_obstack, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment