diff options
author | Martin Liska <mliska@suse.cz> | 2015-06-01 14:34:31 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2015-06-01 12:34:31 +0000 |
commit | cb8abb1cf9f96365d7fa1f4583ab3cb845876f17 (patch) | |
tree | 6ab57ff78b223b14ea0991bdf21f1047264c68a4 /gcc/lra-lives.c | |
parent | 64afff5b0205e524fa696a6a74d5759f0803f8c9 (diff) | |
download | gcc-cb8abb1cf9f96365d7fa1f4583ab3cb845876f17.zip gcc-cb8abb1cf9f96365d7fa1f4583ab3cb845876f17.tar.gz gcc-cb8abb1cf9f96365d7fa1f4583ab3cb845876f17.tar.bz2 |
Change use to type-based pool allocator in lra-lives.c.
* lra-lives.c (free_live_range): Use new type-based pool allocator.
(free_live_range_list) Likewise.
(create_live_range) Likewise.
(copy_live_range) Likewise.
(lra_merge_live_ranges) Likewise.
(remove_some_program_points_and_update_live_ranges) Likewise.
(lra_live_ranges_init) Likewise.
(lra_live_ranges_finish) Likewise.
From-SVN: r223944
Diffstat (limited to 'gcc/lra-lives.c')
-rw-r--r-- | gcc/lra-lives.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c index 085411e..4dfe30f 100644 --- a/gcc/lra-lives.c +++ b/gcc/lra-lives.c @@ -121,14 +121,7 @@ static sparseset unused_set, dead_set; static bitmap_head temp_bitmap; /* Pool for pseudo live ranges. */ -static alloc_pool live_range_pool; - -/* Free live range LR. */ -static void -free_live_range (lra_live_range_t lr) -{ - pool_free (live_range_pool, lr); -} +pool_allocator <lra_live_range> lra_live_range::pool ("live ranges", 100); /* Free live range list LR. */ static void @@ -139,7 +132,7 @@ free_live_range_list (lra_live_range_t lr) while (lr != NULL) { next = lr->next; - free_live_range (lr); + delete lr; lr = next; } } @@ -148,9 +141,7 @@ free_live_range_list (lra_live_range_t lr) static lra_live_range_t create_live_range (int regno, int start, int finish, lra_live_range_t next) { - lra_live_range_t p; - - p = (lra_live_range_t) pool_alloc (live_range_pool); + lra_live_range_t p = new lra_live_range; p->regno = regno; p->start = start; p->finish = finish; @@ -162,11 +153,7 @@ create_live_range (int regno, int start, int finish, lra_live_range_t next) static lra_live_range_t copy_live_range (lra_live_range_t r) { - lra_live_range_t p; - - p = (lra_live_range_t) pool_alloc (live_range_pool); - *p = *r; - return p; + return new lra_live_range (*r); } /* Copy live range list given by its head R and return the result. */ @@ -209,7 +196,7 @@ lra_merge_live_ranges (lra_live_range_t r1, lra_live_range_t r2) r1->start = r2->start; lra_live_range_t temp = r2; r2 = r2->next; - pool_free (live_range_pool, temp); + delete temp; } else { @@ -480,7 +467,7 @@ live_con_fun_n (edge e) basic_block dest = e->dest; bitmap bb_liveout = df_get_live_out (bb); bitmap dest_livein = df_get_live_in (dest); - + return bitmap_ior_and_compl_into (bb_liveout, dest_livein, &all_hard_regs_bitmap); } @@ -1024,7 +1011,7 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) if (sparseset_bit_p (pseudos_live_through_calls, j)) check_pseudos_live_through_calls (j); } - + if (need_curr_point_incr) next_program_point (curr_point, freq); @@ -1109,7 +1096,7 @@ remove_some_program_points_and_update_live_ranges (void) } prev_r->start = r->start; prev_r->next = next_r; - free_live_range (r); + delete r; } } } @@ -1252,7 +1239,7 @@ lra_create_live_ranges_1 (bool all_p, bool dead_insn_p) } } lra_free_copies (); - + /* Under some circumstances, we can have functions without pseudo registers. For such functions, lra_live_max_point will be 0, see e.g. PR55604, and there's nothing more to do for us here. */ @@ -1380,8 +1367,6 @@ lra_clear_live_ranges (void) void lra_live_ranges_init (void) { - live_range_pool = create_alloc_pool ("live ranges", - sizeof (struct lra_live_range), 100); bitmap_initialize (&temp_bitmap, ®_obstack); initiate_live_solver (); } @@ -1392,5 +1377,5 @@ lra_live_ranges_finish (void) { finish_live_solver (); bitmap_clear (&temp_bitmap); - free_alloc_pool (live_range_pool); + lra_live_range::pool.release (); } |