diff options
author | Jan Hubicka <jh@suse.cz> | 2010-11-16 19:15:17 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-11-16 18:15:17 +0000 |
commit | df7705b18e1ca275f0ded892bd5fb6bd542eb988 (patch) | |
tree | b9cf407f17bdb390a410566498c603ef34073ef6 /gcc/cgraph.h | |
parent | 3e794bfe4393d5398c21658837c7437f1a1cbc5c (diff) | |
download | gcc-df7705b18e1ca275f0ded892bd5fb6bd542eb988.zip gcc-df7705b18e1ca275f0ded892bd5fb6bd542eb988.tar.gz gcc-df7705b18e1ca275f0ded892bd5fb6bd542eb988.tar.bz2 |
cgraph.h (+varpool_can_remove_if_no_refs): Move here from ......
* cgraph.h (+varpool_can_remove_if_no_refs): Move here from ...;
when !flag_toplevel_reorder do not remove unless variable is
COMDAT or ARTIFICIAL.
* ipa.c (varpool_can_remove_if_no_refs): ... here.
(cgraph_remove_unreachable_nodes): Only analyzed nodes needs to stay.
* cgraphunit.c (cgraph_analyze_functions): Dump varpool, too.
* varpool.c (decide_is_variable_needed): Do not handle visibility issues.
(varpool_finalize_decl): Likewise.
(varpool_remove_unreferenced_decls): Use varpool_mark_needed_node; update
outdated comment on DECL_RTL_SET_P check.
From-SVN: r166812
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 2b7ed4b..0334a15 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -928,6 +928,18 @@ cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node) return !node->address_taken && cgraph_can_remove_if_no_direct_calls_and_refs_p (node); } +/* Return true when function NODE can be removed from callgraph + if all direct calls are eliminated. */ + +static inline bool +varpool_can_remove_if_no_refs (struct varpool_node *node) +{ + return (!node->force_output && !node->used_from_other_partition + && (flag_toplevel_reorder || DECL_COMDAT (node->decl) + || DECL_ARTIFICIAL (node->decl)) + && (DECL_COMDAT (node->decl) || !node->externally_visible)); +} + /* Return true when all references to VNODE must be visible in ipa_ref_list. i.e. if the variable is not externally visible or not used in some magic way (asm statement or such). |