aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-07-09 03:20:24 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-07-09 01:20:24 +0000
commita194aa56e656273fde94d2935e43d0640d90e42f (patch)
tree1d6807c9ee6d30e8fa21f56d4c445809b3cdea27 /gcc/cgraph.c
parent8af61113c7c4ec81ef7d4947a9e59d980333e397 (diff)
downloadgcc-a194aa56e656273fde94d2935e43d0640d90e42f.zip
gcc-a194aa56e656273fde94d2935e43d0640d90e42f.tar.gz
gcc-a194aa56e656273fde94d2935e43d0640d90e42f.tar.bz2
cgraph.c (cgraph_node_name): New function.
* cgraph.c (cgraph_node_name): New function. (dump_cgraph): Use it. * cgraph.h (cgraph_dump_file): Declare. (cgraph_node_name): Declare. * cgraphunit.c: Include timevar.h (cgraph_finalize_compilation_unit): Use timevar; reorganize dumps. (cgraph_optimize_function): Use TV_INTEGRATION. (cgraph_mark_local_functions): reorganize dumps. (cgraph_mark_functions_to_inline_once): Likewise. (cgraph_optimize): Likewise; use timevar. * timevar.def (TV_CGRAPH, TV_CGRAPHOPT): New. * toplev.c (dump_file_index): Add DFI_cgraph. (dump_file_info): Likewise. (cgraph_dump_file): New global variable. (do_compile): Open and close cgraph dump. * invoke.texi (-d): Document new flag; renumber. From-SVN: r69120
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 36d9814..7bc065b 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -316,6 +316,13 @@ cgraph_rtl_info (decl)
return &node->rtl;
}
+/* Return name of the node used in debug output. */
+const char *
+cgraph_node_name (node)
+ struct cgraph_node *node;
+{
+ return (*lang_hooks.decl_printable_name) (node->decl, 2);
+}
/* Dump the callgraph. */
@@ -329,10 +336,9 @@ dump_cgraph (f)
for (node = cgraph_nodes; node; node = node->next)
{
struct cgraph_edge *edge;
- fprintf (f, "%s", IDENTIFIER_POINTER (DECL_NAME (node->decl)));
+ fprintf (f, "%s", cgraph_node_name (node));
if (node->origin)
- fprintf (f, " nested in: %s",
- IDENTIFIER_POINTER (DECL_NAME (node->origin->decl)));
+ fprintf (f, " nested in: %s", cgraph_node_name (node->origin));
if (node->needed)
fprintf (f, " needed");
else if (node->reachable)
@@ -342,13 +348,11 @@ dump_cgraph (f)
fprintf (f, "\n called by :");
for (edge = node->callers; edge; edge = edge->next_caller)
- fprintf (f, "%s ",
- IDENTIFIER_POINTER (DECL_NAME (edge->caller->decl)));
+ fprintf (f, "%s ", cgraph_node_name (edge->caller));
fprintf (f, "\n calls: ");
for (edge = node->callees; edge; edge = edge->next_callee)
- fprintf (f, "%s ",
- IDENTIFIER_POINTER (DECL_NAME (edge->callee->decl)));
+ fprintf (f, "%s ", cgraph_node_name (edge->callee));
fprintf (f, "\n");
}
}