diff options
author | Jan Hubicka <jh@suse.cz> | 2005-06-02 12:59:00 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-06-02 10:59:00 +0000 |
commit | e7d6beb0f868d4feeefea469278b4e07ec3fee8f (patch) | |
tree | 4f4dc9e478b4edd68765ff38a1348129dc516dae /gcc/cgraph.c | |
parent | 75c702541afe8c4bb21341be284d02c401782622 (diff) | |
download | gcc-e7d6beb0f868d4feeefea469278b4e07ec3fee8f.tar.gz |
cgraph.c (dump_cgraph_node): Print new flags.
* cgraph.c (dump_cgraph_node): Print new flags.
(dump_cgraph_varpool_node): Likewise.
(decide_variable_is_needed): Initialize externally_visible flag.
* cgraph.h (cgraph_local_info): Add externally_visible flag.
(cgraph_varpool_node): Likewise.
(cgraph_function_flags_ready): Declare.
* cgraph.c (cgraph_mark_local_functions): Rename to ...
(cgraph_function_and_variable_visibility) ... this one; handle
externally_visible flags.
(decide_is_function_needed): Set externally_visible flag.
(cgraph_finalize_function): Deal properly with early cleanups.
(cgraph_optimize): Update call of
cgraph_function_and_variable_visibility.
From-SVN: r100491
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index e1f4c661ce7..04711910fe0 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -582,10 +582,16 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) fprintf (f, " output"); if (node->local.local) fprintf (f, " local"); + if (node->local.externally_visible) + fprintf (f, " externally_visible"); + if (node->local.finalized) + fprintf (f, " finalized"); if (node->local.disregard_inline_limits) fprintf (f, " always_inline"); else if (node->local.inlinable) fprintf (f, " inlinable"); + if (node->local.redefined_extern_inline) + fprintf (f, " redefined_extern_inline"); if (TREE_ASM_WRITTEN (node->decl)) fprintf (f, " asm_written"); @@ -639,6 +645,8 @@ dump_cgraph_varpool_node (FILE *f, struct cgraph_varpool_node *node) fprintf (f, " finalized"); if (node->output) fprintf (f, " output"); + if (node->externally_visible) + fprintf (f, " externally_visible"); fprintf (f, "\n"); } @@ -786,8 +794,8 @@ decide_is_variable_needed (struct cgraph_varpool_node *node, tree decl) if (node->needed) return true; - /* Externally visible functions must be output. The exception is - COMDAT functions that must be output only when they are needed. */ + /* Externally visible variables must be output. The exception is + COMDAT variables that must be output only when they are needed. */ if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) return true; @@ -824,6 +832,11 @@ cgraph_varpool_finalize_decl (tree decl) if (decide_is_variable_needed (node, decl)) cgraph_varpool_mark_needed_node (node); + /* Since we reclaim unrechable nodes at the end of every language + level unit, we need to be conservative about possible entry points + there. */ + if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) + cgraph_varpool_mark_needed_node (node); if (cgraph_global_info_ready || !flag_unit_at_a_time) cgraph_varpool_assemble_pending_decls (); } |