aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-06-02 10:59:00 +0000
committerJan Hubicka <jh@suse.cz>2005-06-02 10:59:00 +0000
commit00941f4cea832ac897918515cd8b362a9910c843 (patch)
tree4f4dc9e478b4edd68765ff38a1348129dc516dae /gcc/cgraph.c
parent5cc1e5b141064be349ed98bcc9728c29b7218129 (diff)
* 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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@100491 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c17
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 ();
}