aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-06-24 18:50:29 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-06-24 16:50:29 +0000
commite69529cd536c79f1849f271e230e0b61fede7b84 (patch)
tree6d104fc83b2d07c080d44ba705184072c8821bf6 /gcc/cgraphunit.c
parent6df5158a36cb2b8c5f6642f0208648c1ea2d5786 (diff)
downloadgcc-e69529cd536c79f1849f271e230e0b61fede7b84.zip
gcc-e69529cd536c79f1849f271e230e0b61fede7b84.tar.gz
gcc-e69529cd536c79f1849f271e230e0b61fede7b84.tar.bz2
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
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c7
1 files changed, 6 insertions, 1 deletions
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. */