aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-05-23 16:39:11 +0200
committerMartin Liska <marxin@gcc.gnu.org>2017-05-23 14:39:11 +0000
commit464d01188e46ccdb19b4783c5d28ef6bc72d32f9 (patch)
tree5307a5518829adcac991e9a7bab2b1ded50a7a3c /gcc/cgraph.c
parent6c52831d98b00d02a3c11b46fbf80991ef0dc0fa (diff)
downloadgcc-464d01188e46ccdb19b4783c5d28ef6bc72d32f9.zip
gcc-464d01188e46ccdb19b4783c5d28ef6bc72d32f9.tar.gz
gcc-464d01188e46ccdb19b4783c5d28ef6bc72d32f9.tar.bz2
Introduce symtab_node::dump_{asm_,}name functions.
2017-05-23 Martin Liska <mliska@suse.cz> * cgraph.c (cgraph_node::get_create): Use symtab_node::dump_{asm_,}name functions. (cgraph_edge::make_speculative): Likewise. (cgraph_edge::resolve_speculation): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. (cgraph_node::dump): Likewise. * cgraph.h: Likewise. * cgraphunit.c (analyze_functions): Likewise. (symbol_table::compile): Likewise. * ipa-cp.c (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (ipcp_verify_propagated_values): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. (ipcp_store_bits_results): Likewise. * ipa-devirt.c (dump_targets): Likewise. (ipa_devirt): Likewise. * ipa-icf.c (sem_item::dump): Likewise. (sem_function::equals): Likewise. (sem_variable::equals): Likewise. (sem_item_optimizer::read_section): Likewise. (sem_item_optimizer::execute): Likewise. (congruence_class::dump): Likewise. * ipa-inline-analysis.c (dump_ipa_call_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline-transform.c (inline_call): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_print_node_jump_functions): Likewise. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (ipa_impossible_devirt_target): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Likewise. (ipcp_transform_function): Likewise. * ipa-pure-const.c (pure_const_read_summary): Likewise. (propagate_pure_const): Likewise. * ipa-reference.c (generate_summary): Likewise. (read_write_all_from_decl): Likewise. (propagate): Likewise. (ipa_reference_read_optimization_summary): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. (symbol_table::remove_unreachable_nodes): Likewise. (ipa_single_use): Likewise. * passes.c (execute_todo): Likewise. * predict.c (drop_profile): Likewise. * symtab.c (symtab_node::get_dump_name): New function. (symtab_node::dump_name): Likewise. (symtab_node::dump_asm_name): Likewise. (symtab_node::dump_references): Likewise. (symtab_node::dump_referring): Likewise. (symtab_node::dump_base): Likewise. (symtab_node::debug_symtab): Likewise. * tree-sra.c (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. * value-prof.c (init_node_map): Likewise. 2017-05-23 Martin Liska <mliska@suse.cz> * lto-symtab.c (lto_cgraph_replace_node): Use symtab_node::dump_{asm_,}name functions. * lto.c (read_cgraph_and_symbols): Likewise. (do_whole_program_analysis): Likewise. From-SVN: r248369
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c75
1 files changed, 27 insertions, 48 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 4d04f63..3932006 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -539,12 +539,12 @@ cgraph_node::get_create (tree decl)
node->decl->decl_with_vis.symtab_node = node;
if (dump_file)
fprintf (dump_file, "Introduced new external node "
- "(%s/%i) and turned into root of the clone tree.\n",
- node->name (), node->order);
+ "(%s) and turned into root of the clone tree.\n",
+ node->dump_name ());
}
else if (dump_file)
fprintf (dump_file, "Introduced new external node "
- "(%s/%i).\n", node->name (), node->order);
+ "(%s).\n", node->dump_name ());
return node;
}
@@ -1055,12 +1055,8 @@ cgraph_edge::make_speculative (cgraph_node *n2, gcov_type direct_count,
cgraph_edge *e2;
if (dump_file)
- {
- fprintf (dump_file, "Indirect call -> speculative call"
- " %s/%i => %s/%i\n",
- xstrdup_for_dump (n->name ()), n->order,
- xstrdup_for_dump (n2->name ()), n2->order);
- }
+ fprintf (dump_file, "Indirect call -> speculative call %s => %s\n",
+ n->dump_name (), n2->dump_name ());
speculative = true;
e2 = n->create_edge (n2, call_stmt, direct_count, direct_frequency);
initialize_inline_failed (e2);
@@ -1163,22 +1159,18 @@ cgraph_edge::resolve_speculation (tree callee_decl)
{
if (callee_decl)
{
- fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has "
+ fprintf (dump_file, "Speculative indirect call %s => %s has "
"turned out to have contradicting known target ",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (e2->callee->name ()),
- e2->callee->order);
+ edge->caller->dump_name (),
+ e2->callee->dump_name ());
print_generic_expr (dump_file, callee_decl);
fprintf (dump_file, "\n");
}
else
{
- fprintf (dump_file, "Removing speculative call %s/%i => %s/%i\n",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (e2->callee->name ()),
- e2->callee->order);
+ fprintf (dump_file, "Removing speculative call %s => %s\n",
+ edge->caller->dump_name (),
+ e2->callee->dump_name ());
}
}
}
@@ -1295,12 +1287,10 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
true))
{
if (dump_file)
- fprintf (dump_file, "Not expanding speculative call of %s/%i -> %s/%i\n"
+ fprintf (dump_file, "Not expanding speculative call of %s -> %s\n"
"Type mismatch.\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (e->callee->name ()),
- e->callee->order);
+ e->caller->dump_name (),
+ e->callee->dump_name ());
e = e->resolve_speculation ();
/* We are producing the final function body and will throw away the
callgraph edges really soon. Reset the counts/frequencies to
@@ -1314,12 +1304,10 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
{
if (dump_file)
fprintf (dump_file,
- "Expanding speculative call of %s/%i -> %s/%i count: "
+ "Expanding speculative call of %s -> %s count: "
"%" PRId64"\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (e->callee->name ()),
- e->callee->order,
+ e->caller->dump_name (),
+ e->callee->dump_name (),
(int64_t)e->count);
gcc_assert (e2->speculative);
push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
@@ -1399,9 +1387,8 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
if (symtab->dump_file)
{
- fprintf (symtab->dump_file, "updating call of %s/%i -> %s/%i: ",
- xstrdup_for_dump (e->caller->name ()), e->caller->order,
- xstrdup_for_dump (e->callee->name ()), e->callee->order);
+ fprintf (symtab->dump_file, "updating call of %s -> %s: ",
+ e->caller->dump_name (), e->callee->dump_name ());
print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags);
if (e->callee->clone.combined_args_to_skip)
{
@@ -2064,15 +2051,11 @@ cgraph_node::dump (FILE *f)
dump_base (f);
if (global.inlined_to)
- fprintf (f, " Function %s/%i is inline copy in %s/%i\n",
- xstrdup_for_dump (name ()),
- order,
- xstrdup_for_dump (global.inlined_to->name ()),
- global.inlined_to->order);
+ fprintf (f, " Function %s is inline copy in %s\n",
+ dump_name (),
+ global.inlined_to->dump_name ());
if (clone_of)
- fprintf (f, " Clone of %s/%i\n",
- clone_of->asm_name (),
- clone_of->order);
+ fprintf (f, " Clone of %s\n", clone_of->dump_asm_name ());
if (symtab->function_flags_ready)
fprintf (f, " Availability: %s\n",
cgraph_availability_names [get_availability ()]);
@@ -2088,14 +2071,12 @@ cgraph_node::dump (FILE *f)
if (vi->prev != NULL)
{
fprintf (f, "prev: ");
- fprintf (f, "%s/%i ", vi->prev->this_node->asm_name (),
- vi->prev->this_node->order);
+ fprintf (f, "%s ", vi->prev->this_node->dump_asm_name ());
}
if (vi->next != NULL)
{
fprintf (f, "next: ");
- fprintf (f, "%s/%i ", vi->next->this_node->asm_name (),
- vi->next->this_node->order);
+ fprintf (f, "%s ", vi->next->this_node->dump_asm_name ());
}
if (vi->dispatcher_resolver != NULL_TREE)
fprintf (f, "dispatcher: %s",
@@ -2184,16 +2165,14 @@ cgraph_node::dump (FILE *f)
for (edge = callers; edge; edge = edge->next_caller)
{
- fprintf (f, "%s/%i ", edge->caller->asm_name (),
- edge->caller->order);
+ fprintf (f, "%s ", edge->caller->dump_name ());
edge->dump_edge_flags (f);
}
fprintf (f, "\n Calls: ");
for (edge = callees; edge; edge = edge->next_callee)
{
- fprintf (f, "%s/%i ", edge->callee->asm_name (),
- edge->callee->order);
+ fprintf (f, "%s ", edge->callee->dump_name ());
edge->dump_edge_flags (f);
}
fprintf (f, "\n");