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;
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;
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? */
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 ();
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
{
/* 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 ());
minval, maxval, range,
BLOCK_FOR_INSN (before_case));
emit_label (default_label);
- free_alloc_pool (case_node_pool);
}
/* Dispatching something not handled? Trap! */