diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-08 19:31:45 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-08 19:31:45 +0000 |
commit | 5ae49d3e56883cf06704ec00ff4c35262dfa7358 (patch) | |
tree | 717a1d74dbcf55ae4d71c2fc03be956c6157212c /gcc/cgraph.c | |
parent | 5dc03fafeebbe4215719fffc04d5ec3e0a628b1e (diff) | |
download | gcc-5ae49d3e56883cf06704ec00ff4c35262dfa7358.tar.gz |
PR jit/63854: Introduce xstrdup_for_dump
gcc/ChangeLog:
PR jit/63854
* cgraph.h (xstrdup_for_dump): New function.
* cgraph.c (cgraph_node::get_create): Replace use of xstrdup
within fprintf with xstrdup_for_dump.
(cgraph_edge::make_speculative): Likewise.
(cgraph_edge::resolve_speculation): Likewise.
(cgraph_edge::redirect_call_stmt_to_callee): Likewise.
(cgraph_node::dump): Likewise.
* cgraphclones.c (symbol_table::materialize_all_clones): Likewise.
* ipa-cp.c (perhaps_add_new_callers): Likewise.
* ipa-inline.c (report_inline_failed_reason): Likewise.
(want_early_inline_function_p): Likewise.
(edge_badness): Likewise.
(update_edge_key): Likewise.
(flatten_function): Likewise.
(inline_always_inline_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.
(propagate_controlled_uses): Likewise.
* ipa-utils.c (ipa_merge_profiles): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218490 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 6aecb14823c..50c7b34b3dc 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -537,11 +537,11 @@ cgraph_node::get_create (tree decl) if (dump_file) fprintf (dump_file, "Introduced new external node " "(%s/%i) and turned into root of the clone tree.\n", - xstrdup (node->name ()), node->order); + xstrdup_for_dump (node->name ()), node->order); } else if (dump_file) fprintf (dump_file, "Introduced new external node " - "(%s/%i).\n", xstrdup (node->name ()), + "(%s/%i).\n", xstrdup_for_dump (node->name ()), node->order); return node; } @@ -1070,8 +1070,8 @@ cgraph_edge::make_speculative (cgraph_node *n2, gcov_type direct_count, { fprintf (dump_file, "Indirect call -> speculative call" " %s/%i => %s/%i\n", - xstrdup (n->name ()), n->order, - xstrdup (n2->name ()), n2->order); + xstrdup_for_dump (n->name ()), n->order, + xstrdup_for_dump (n2->name ()), n2->order); } speculative = true; e2 = n->create_edge (n2, call_stmt, direct_count, direct_frequency); @@ -1190,16 +1190,20 @@ cgraph_edge::resolve_speculation (tree callee_decl) { fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has " "turned out to have contradicting known target ", - xstrdup (edge->caller->name ()), edge->caller->order, - xstrdup (e2->callee->name ()), e2->callee->order); + xstrdup_for_dump (edge->caller->name ()), + edge->caller->order, + xstrdup_for_dump (e2->callee->name ()), + e2->callee->order); print_generic_expr (dump_file, callee_decl, 0); fprintf (dump_file, "\n"); } else { fprintf (dump_file, "Removing speculative call %s/%i => %s/%i\n", - xstrdup (edge->caller->name ()), edge->caller->order, - xstrdup (e2->callee->name ()), e2->callee->order); + xstrdup_for_dump (edge->caller->name ()), + edge->caller->order, + xstrdup_for_dump (e2->callee->name ()), + e2->callee->order); } } } @@ -1319,9 +1323,9 @@ cgraph_edge::redirect_call_stmt_to_callee (void) if (dump_file) fprintf (dump_file, "Not expanding speculative call of %s/%i -> %s/%i\n" "Type mismatch.\n", - xstrdup (e->caller->name ()), + xstrdup_for_dump (e->caller->name ()), e->caller->order, - xstrdup (e->callee->name ()), + xstrdup_for_dump (e->callee->name ()), e->callee->order); e = e->resolve_speculation (); /* We are producing the final function body and will throw away the @@ -1338,9 +1342,9 @@ cgraph_edge::redirect_call_stmt_to_callee (void) fprintf (dump_file, "Expanding speculative call of %s/%i -> %s/%i count:" "%"PRId64"\n", - xstrdup (e->caller->name ()), + xstrdup_for_dump (e->caller->name ()), e->caller->order, - xstrdup (e->callee->name ()), + xstrdup_for_dump (e->callee->name ()), e->callee->order, (int64_t)e->count); gcc_assert (e2->speculative); @@ -1415,8 +1419,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 (e->caller->name ()), e->caller->order, - xstrdup (e->callee->name ()), e->callee->order); + xstrdup_for_dump (e->caller->name ()), e->caller->order, + xstrdup_for_dump (e->callee->name ()), e->callee->order); print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags); if (e->callee->clone.combined_args_to_skip) { @@ -1965,9 +1969,9 @@ cgraph_node::dump (FILE *f) if (global.inlined_to) fprintf (f, " Function %s/%i is inline copy in %s/%i\n", - xstrdup (name ()), + xstrdup_for_dump (name ()), order, - xstrdup (global.inlined_to->name ()), + xstrdup_for_dump (global.inlined_to->name ()), global.inlined_to->order); if (clone_of) fprintf (f, " Clone of %s/%i\n", |