diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 18:15:17 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 18:15:17 +0000 |
commit | 7410370bd303fd440cb530bb2fe4fc4c2d944b5d (patch) | |
tree | b9cf407f17bdb390a410566498c603ef34073ef6 /gcc/cgraph.h | |
parent | f369130eb68c3206c86c59ec5bba04d8f79f90df (diff) | |
download | gcc-7410370bd303fd440cb530bb2fe4fc4c2d944b5d.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166812 138bc75d-0d04-0410-961f-82ee72b054a4
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 2b7ed4b8985..0334a154824 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). |