aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-08-16 13:04:59 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-08-16 11:04:59 +0000
commite767b5be438a67c59f8f23b6214fcbb7183a8092 (patch)
treedf38d256a957a8ffd8b53d92a0e7ccf9f23354bc /gcc/cgraph.c
parent5ab7486eee0b529d1561533e0b1216c33b652621 (diff)
downloadgcc-e767b5be438a67c59f8f23b6214fcbb7183a8092.zip
gcc-e767b5be438a67c59f8f23b6214fcbb7183a8092.tar.gz
gcc-e767b5be438a67c59f8f23b6214fcbb7183a8092.tar.bz2
i386.c (ix86_fntype_regparm): Rename from ...
* i386.c (ix86_fntype_regparm): Rename from ... (ix86_function_regparm): ... this one; add fastcall and local functions. (ix86_function_ok_for_sibcall): Update. (ix86_return_pops_args): Likewise. (init_cumulative_args): Likewise. (x86_can_output_mi_thunk): Likewise. (function_arg): Fix formating. (x86_this_parameter): Fix fastcall. (x86_output_mi_thunk): Likewise. * cgraph.c (cgraph_mark_needed_node): Do not mark functions without body as reachable; mark nested functions as needed too. (dump_cgraph): Do not output global.calls. * cgraph.h (cgraph_global_info): Kill. * cgraphunit.c (cgraph_finalize_function): Enqueue needed functions. (record_call_1): Speedup. (cgraph_analyze_function): Break out from ...; compute inlining parameters. (cgraph_finalize_compilation_unit): ... here. (cgraph_mark_inline): Kill computation of calls. (cgraph_decide_inlining): Do not compute most of initial values. From-SVN: r70504
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index fedecbc..9aa12a6 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -240,17 +240,24 @@ void
cgraph_mark_needed_node (struct cgraph_node *node, int needed)
{
if (needed)
- {
- node->needed = 1;
- }
- if (!node->reachable)
+ node->needed = 1;
+
+ if (!node->reachable && DECL_SAVED_TREE (node->decl))
{
node->reachable = 1;
- if (DECL_SAVED_TREE (node->decl))
+
+ node->next_needed = cgraph_nodes_queue;
+ cgraph_nodes_queue = node;
+
+ /* At the moment frontend automatically emits all nested functions. */
+ if (node->nested)
{
- node->next_needed = cgraph_nodes_queue;
- cgraph_nodes_queue = node;
- }
+ struct cgraph_node *node2;
+
+ for (node2 = node->nested; node2; node2 = node2->next_nested)
+ if (!node2->reachable)
+ cgraph_mark_needed_node (node2, 0);
+ }
}
}
@@ -361,8 +368,6 @@ dump_cgraph (FILE *f)
fprintf (f, " %i insns after inlining", node->global.insns);
if (node->global.cloned_times > 1)
fprintf (f, " cloned %ix", node->global.cloned_times);
- if (node->global.calls)
- fprintf (f, " %i calls", node->global.calls);
fprintf (f, "\n called by :");
for (edge = node->callers; edge; edge = edge->next_caller)