From: Martin Liska Date: Mon, 1 Jun 2015 12:43:16 +0000 (+0200) Subject: Change use to type-based pool allocator in stmt.c. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f8446975976236285093df11f5c6318b3cea58c;p=gcc.git 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. From-SVN: r223958 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f28f205fa4..ad3c1057a9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-06-01 Martin Liska + + * stmt.c (add_case_node): Use new type-based pool allocator. + (expand_case): Likewise. + (expand_sjlj_dispatch_table): Likewise. + 2015-06-01 Martin Liska * tree-ssa-math-opts.c (occ_new): Use new type-based pool allocator. 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_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_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_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! */