diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-09 01:20:24 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-09 01:20:24 +0000 |
commit | f79b65070c2310a787f5eaf3f96438679085216d (patch) | |
tree | 1d6807c9ee6d30e8fa21f56d4c445809b3cdea27 /gcc/cgraph.c | |
parent | 20f5f6d0a53d958f5029276862a136d271ceaadf (diff) | |
download | gcc-f79b65070c2310a787f5eaf3f96438679085216d.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69120 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 36d9814e365..7bc065b79d3 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"); } } |