diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-01 12:43:16 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-01 12:43:16 +0000 |
commit | 41003862f358c9312eede7e813a0e1a279ba76f4 (patch) | |
tree | c6bf566c20e860c8ca8fe05a536cbf1c008ff753 /gcc/stmt.c | |
parent | d8e7268c4394b6d4ddc76abcaa6fe9e23fe351be (diff) | |
download | gcc-41003862f358c9312eede7e813a0e1a279ba76f4.tar.gz |
Change use to type-based pool allocator in stmt.c.
* stmt.c (add_case_node): Use new type-based pool allocator.
(expand_case): Likewise.
(expand_sjlj_dispatch_table): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223958 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 303df725a0b..a04f69bc660 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -748,7 +748,7 @@ do_jump_if_equal (machine_mode mode, rtx op0, rtx op1, rtx_code_label *label, static struct case_node * add_case_node (struct case_node *head, tree low, tree high, - tree label, int prob, alloc_pool case_node_pool) + tree label, int prob, pool_allocator<case_node> &case_node_pool) { struct case_node *r; @@ -756,7 +756,7 @@ add_case_node (struct case_node *head, tree low, tree high, gcc_checking_assert (high && (TREE_TYPE (low) == TREE_TYPE (high))); /* Add this label to the chain. */ - r = (struct case_node *) pool_alloc (case_node_pool); + r = case_node_pool.allocate (); r->low = low; r->high = high; r->code_label = label; @@ -1160,7 +1160,7 @@ expand_case (gswitch *stmt) struct case_node *case_list = 0; /* A pool for case nodes. */ - alloc_pool case_node_pool; + pool_allocator<case_node> case_node_pool ("struct case_node pool", 100); /* An ERROR_MARK occurs for various reasons including invalid data type. ??? Can this still happen, with GIMPLE and all? */ @@ -1171,9 +1171,6 @@ expand_case (gswitch *stmt) expressions being INTEGER_CST. */ gcc_assert (TREE_CODE (index_expr) != INTEGER_CST); - case_node_pool = create_alloc_pool ("struct case_node pool", - sizeof (struct case_node), - 100); do_pending_stack_adjust (); @@ -1273,7 +1270,6 @@ expand_case (gswitch *stmt) reorder_insns (NEXT_INSN (before_case), get_last_insn (), before_case); free_temp_slots (); - free_alloc_pool (case_node_pool); } /* Expand the dispatch to a short decrement chain if there are few cases @@ -1340,9 +1336,8 @@ expand_sjlj_dispatch_table (rtx dispatch_index, { /* Similar to expand_case, but much simpler. */ struct case_node *case_list = 0; - alloc_pool case_node_pool = create_alloc_pool ("struct sjlj_case pool", - sizeof (struct case_node), - ncases); + pool_allocator<case_node> case_node_pool ("struct sjlj_case pool", + ncases); tree index_expr = make_tree (index_type, dispatch_index); tree minval = build_int_cst (index_type, 0); tree maxval = CASE_LOW (dispatch_table.last ()); @@ -1362,7 +1357,6 @@ expand_sjlj_dispatch_table (rtx dispatch_index, minval, maxval, range, BLOCK_FOR_INSN (before_case)); emit_label (default_label); - free_alloc_pool (case_node_pool); } /* Dispatching something not handled? Trap! */ |