+2015-11-11 Martin Liska <mliska@suse.cz>
+
+ * gimple-ssa-strength-reduction.c (create_phi_basis):
+ Use auto_vec.
+ * passes.c (release_dump_file_name): New function.
+ (pass_init_dump_file): Used from this function.
+ (pass_fini_dump_file): Likewise.
+ * tree-sra.c (convert_callers_for_node): Use xstrdup_for_dump.
+ * var-tracking.c (vt_initialize): Use pool_allocator.
+
2015-11-11 Richard Biener <rguenth@gcc.gnu.org>
Jiong Wang <jiong.wang@arm.com>
int i;
tree name, phi_arg;
gphi *phi;
- vec<tree> phi_args;
slsr_cand_t basis = lookup_cand (c->basis);
int nargs = gimple_phi_num_args (from_phi);
basic_block phi_bb = gimple_bb (from_phi);
slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (from_phi));
- phi_args.create (nargs);
+ auto_vec<tree> phi_args (nargs);
/* Process each argument of the existing phi that represents
conditionally-executed add candidates. */
gcc_assert ((fn->curr_properties & props) == props);
}
+/* Release dump file name if set. */
+
+static void
+release_dump_file_name (void)
+{
+ if (dump_file_name)
+ {
+ free (CONST_CAST (char *, dump_file_name));
+ dump_file_name = NULL;
+ }
+}
+
/* Initialize pass dump file. */
/* This is non-static so that the plugins can use it. */
gcc::dump_manager *dumps = g->get_dumps ();
bool initializing_dump =
!dumps->dump_initialized_p (pass->static_pass_number);
+ release_dump_file_name ();
dump_file_name = dumps->get_dump_file_name (pass->static_pass_number);
dumps->dump_start (pass->static_pass_number, &dump_flags);
if (dump_file && current_function_decl)
timevar_push (TV_DUMP);
/* Flush and close dump file. */
- if (dump_file_name)
- {
- free (CONST_CAST (char *, dump_file_name));
- dump_file_name = NULL;
- }
+ release_dump_file_name ();
g->get_dumps ()->dump_finish (pass->static_pass_number);
timevar_pop (TV_DUMP);
if (dump_file)
fprintf (dump_file, "Adjusting call %s/%i -> %s/%i\n",
- xstrdup (cs->caller->name ()),
+ xstrdup_for_dump (cs->caller->name ()),
cs->caller->order,
- xstrdup (cs->callee->name ()),
+ xstrdup_for_dump (cs->callee->name ()),
cs->callee->order);
ipa_modify_call_arguments (cs, cs->call_stmt, *adjustments);
alloc_aux_for_blocks (sizeof (variable_tracking_info));
- empty_shared_hash = new shared_hash;
+ empty_shared_hash = shared_hash_pool.allocate ();
empty_shared_hash->refcount = 1;
empty_shared_hash->htab = new variable_table_type (1);
changed_variables = new variable_table_type (10);