From e69529cd536c79f1849f271e230e0b61fede7b84 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 24 Jun 2003 18:50:29 +0200 Subject: Makefile.in (cgraph.o): Depend on output.h, not depend on tree-inline.h * Makefile.in (cgraph.o): Depend on output.h, not depend on tree-inline.h * cgraph.c: Do not include tree-inline.h; include output.h (known_fns): Rename to ... (known_decls): ... this one; update all uses. (cgraph_varpool_hash): New static variable. (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global variables. (cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node, cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls): New functions. * cgraph.h (cgraph_varpool_node): New structure. (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare. (cgraph_varpool_node, cgraph_varpool_node_for_identifier, cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node, cgraph_varpool_asemble_pending_decls): Declare. * cgraphunit.c (record_call_1): Notice variable references. (cgraph_finalize_compilation_unit): Assemble pending variables. * toplev.c (wrapup_global_declarations): Use varpool. (compile_file): Assemble pending declarations. (rest_of_decl_compilation): Use varpool in unit-at-a-time mode. * varasm.c (assemble_name): Notice varpool references. From-SVN: r68426 --- gcc/cgraphunit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 9fc5dd0..47390b9 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -93,9 +93,11 @@ record_call_1 (tp, walk_subtrees, data) int *walk_subtrees; void *data; { + if (TREE_CODE (*tp) == VAR_DECL && TREE_STATIC (*tp)) + cgraph_varpool_mark_needed_node (cgraph_varpool_node (*tp)); /* Record dereferences to the functions. This makes the functions reachable unconditionally. */ - if (TREE_CODE (*tp) == ADDR_EXPR) + else if (TREE_CODE (*tp) == ADDR_EXPR) { tree decl = TREE_OPERAND (*tp, 0); if (TREE_CODE (decl) == FUNCTION_DECL) @@ -144,6 +146,8 @@ cgraph_finalize_compilation_unit () struct cgraph_node *node; struct cgraph_edge *edge; + cgraph_varpool_assemble_pending_decls (); + if (!quiet_flag) { fprintf (stderr, "\n\nInitial entry points:"); @@ -188,6 +192,7 @@ cgraph_finalize_compilation_unit () cgraph_mark_needed_node (edge->callee, 0); } node->lowered = true; + cgraph_varpool_assemble_pending_decls (); } /* Collect entry points to the unit. */ -- cgit v1.1