diff options
Diffstat (limited to 'gcc/tree-call-cdce.c')
-rw-r--r-- | gcc/tree-call-cdce.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 12357eb1503..42f47523e25 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -318,7 +318,7 @@ gen_one_condition (tree arg, int lbub, enum tree_code tcode, const char *temp_name1, const char *temp_name2, - VEC (gimple, heap) *conds, + vec<gimple> conds, unsigned *nconds) { tree lbub_real_cst, lbub_cst, float_type; @@ -343,9 +343,9 @@ gen_one_condition (tree arg, int lbub, gimple_assign_set_lhs (stmt2, tempcn); stmt3 = gimple_build_cond_from_tree (tempcn, NULL_TREE, NULL_TREE); - VEC_quick_push (gimple, conds, stmt1); - VEC_quick_push (gimple, conds, stmt2); - VEC_quick_push (gimple, conds, stmt3); + conds.quick_push (stmt1); + conds.quick_push (stmt2); + conds.quick_push (stmt3); (*nconds)++; } @@ -360,7 +360,7 @@ gen_one_condition (tree arg, int lbub, static void gen_conditions_for_domain (tree arg, inp_domain domain, - VEC (gimple, heap) *conds, + vec<gimple> conds, unsigned *nconds) { if (domain.has_lb) @@ -374,7 +374,7 @@ gen_conditions_for_domain (tree arg, inp_domain domain, { /* Now push a separator. */ if (domain.has_lb) - VEC_quick_push (gimple, conds, NULL); + conds.quick_push (NULL); gen_one_condition (arg, domain.ub, (domain.is_ub_inclusive @@ -403,7 +403,7 @@ gen_conditions_for_domain (tree arg, inp_domain domain, static void gen_conditions_for_pow_cst_base (tree base, tree expn, - VEC (gimple, heap) *conds, + vec<gimple> conds, unsigned *nconds) { inp_domain exp_domain; @@ -439,7 +439,7 @@ gen_conditions_for_pow_cst_base (tree base, tree expn, static void gen_conditions_for_pow_int_base (tree base, tree expn, - VEC (gimple, heap) *conds, + vec<gimple> conds, unsigned *nconds) { gimple base_def; @@ -496,7 +496,7 @@ gen_conditions_for_pow_int_base (tree base, tree expn, type is integer. */ /* Push a separator. */ - VEC_quick_push (gimple, conds, NULL); + conds.quick_push (NULL); temp = create_tmp_var (int_type, "DCE_COND1"); cst0 = build_int_cst (int_type, 0); @@ -505,15 +505,15 @@ gen_conditions_for_pow_int_base (tree base, tree expn, gimple_assign_set_lhs (stmt1, tempn); stmt2 = gimple_build_cond (LE_EXPR, tempn, cst0, NULL_TREE, NULL_TREE); - VEC_quick_push (gimple, conds, stmt1); - VEC_quick_push (gimple, conds, stmt2); + conds.quick_push (stmt1); + conds.quick_push (stmt2); (*nconds)++; } /* Method to generate conditional statements for guarding conditionally dead calls to pow. One or more statements can be generated for each logical condition. Statement groups of different conditions - are separated by a NULL tree and they are stored in the VEC + are separated by a NULL tree and they are stored in the vec conds. The number of logical conditions are stored in *nconds. See C99 standard, 7.12.7.4:2, for description of pow (x, y). @@ -528,7 +528,7 @@ gen_conditions_for_pow_int_base (tree base, tree expn, and *NCONDS is the number of logical conditions. */ static void -gen_conditions_for_pow (gimple pow_call, VEC (gimple, heap) *conds, +gen_conditions_for_pow (gimple pow_call, vec<gimple> conds, unsigned *nconds) { tree base, expn; @@ -664,15 +664,15 @@ get_no_error_domain (enum built_in_function fnc) condition are separated by NULL tree in the vector. */ static void -gen_shrink_wrap_conditions (gimple bi_call, VEC (gimple, heap) *conds, +gen_shrink_wrap_conditions (gimple bi_call, vec<gimple> conds, unsigned int *nconds) { gimple call; tree fn; enum built_in_function fnc; - gcc_assert (nconds && conds); - gcc_assert (VEC_length (gimple, conds) == 0); + gcc_assert (nconds && conds.exists ()); + gcc_assert (conds.length () == 0); gcc_assert (is_gimple_call (bi_call)); call = bi_call; @@ -711,7 +711,7 @@ shrink_wrap_one_built_in_call (gimple bi_call) basic_block bi_call_bb, join_tgt_bb, guard_bb, guard_bb0; edge join_tgt_in_edge_from_call, join_tgt_in_edge_fall_thru; edge bi_call_in_edge0, guard_bb_in_edge; - VEC (gimple, heap) *conds; + vec<gimple> conds; unsigned tn_cond_stmts, nconds; unsigned ci; gimple cond_expr = NULL; @@ -719,7 +719,7 @@ shrink_wrap_one_built_in_call (gimple bi_call) tree bi_call_label_decl; gimple bi_call_label; - conds = VEC_alloc (gimple, heap, 12); + conds.create (12); gen_shrink_wrap_conditions (bi_call, conds, &nconds); /* This can happen if the condition generator decides @@ -743,12 +743,12 @@ shrink_wrap_one_built_in_call (gimple bi_call) /* Now it is time to insert the first conditional expression into bi_call_bb and split this bb so that bi_call is shrink-wrapped. */ - tn_cond_stmts = VEC_length (gimple, conds); + tn_cond_stmts = conds.length (); cond_expr = NULL; - cond_expr_start = VEC_index (gimple, conds, 0); + cond_expr_start = conds[0]; for (ci = 0; ci < tn_cond_stmts; ci++) { - gimple c = VEC_index (gimple, conds, ci); + gimple c = conds[ci]; gcc_assert (c || ci != 0); if (!c) break; @@ -789,10 +789,10 @@ shrink_wrap_one_built_in_call (gimple bi_call) edge bi_call_in_edge; gimple_stmt_iterator guard_bsi = gsi_for_stmt (cond_expr_start); ci0 = ci; - cond_expr_start = VEC_index (gimple, conds, ci0); + cond_expr_start = conds[ci0]; for (; ci < tn_cond_stmts; ci++) { - gimple c = VEC_index (gimple, conds, ci); + gimple c = conds[ci]; gcc_assert (c || ci != ci0); if (!c) break; @@ -817,7 +817,7 @@ shrink_wrap_one_built_in_call (gimple bi_call) guard_bb_in_edge->count = guard_bb->count - bi_call_in_edge->count; } - VEC_free (gimple, heap, conds); + conds.release (); if (dump_file && (dump_flags & TDF_DETAILS)) { location_t loc; @@ -835,18 +835,18 @@ shrink_wrap_one_built_in_call (gimple bi_call) wrapping transformation. */ static bool -shrink_wrap_conditional_dead_built_in_calls (VEC (gimple, heap) *calls) +shrink_wrap_conditional_dead_built_in_calls (vec<gimple> calls) { bool changed = false; unsigned i = 0; - unsigned n = VEC_length (gimple, calls); + unsigned n = calls.length (); if (n == 0) return false; for (; i < n ; i++) { - gimple bi_call = VEC_index (gimple, calls, i); + gimple bi_call = calls[i]; changed |= shrink_wrap_one_built_in_call (bi_call); } @@ -861,7 +861,7 @@ tree_call_cdce (void) basic_block bb; gimple_stmt_iterator i; bool something_changed = false; - VEC (gimple, heap) *cond_dead_built_in_calls = NULL; + vec<gimple> cond_dead_built_in_calls = vec<gimple>(); FOR_EACH_BB (bb) { /* Collect dead call candidates. */ @@ -877,20 +877,20 @@ tree_call_cdce (void) print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); fprintf (dump_file, "\n"); } - if (cond_dead_built_in_calls == NULL) - cond_dead_built_in_calls = VEC_alloc (gimple, heap, 64); - VEC_safe_push (gimple, heap, cond_dead_built_in_calls, stmt); + if (!cond_dead_built_in_calls.exists ()) + cond_dead_built_in_calls.create (64); + cond_dead_built_in_calls.safe_push (stmt); } } } - if (cond_dead_built_in_calls == NULL) + if (!cond_dead_built_in_calls.exists ()) return 0; something_changed = shrink_wrap_conditional_dead_built_in_calls (cond_dead_built_in_calls); - VEC_free (gimple, heap, cond_dead_built_in_calls); + cond_dead_built_in_calls.release (); if (something_changed) { |