aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-05-17 16:37:33 +0000
committerJan Hubicka <jh@suse.cz>2012-05-17 16:37:33 +0000
commit8b5aa709baaac3fbc8182229773eba8cb8c7fc25 (patch)
treec091b61bf18ed877244605adef29bd8f35c140b1 /gcc/cgraph.h
parent3dca45fe8fc1d6c8fae7da8942716e53ea37d2bf (diff)
* lto-symtab.c (lto_symtab_resolve_symbols): Preffer decl with constructor
over decl without. * cgraph.c (cgraph_remove_node): Clear also body of unanalyzed nodes. * cgraph.h (varpool_can_remove_if_no_refs): Handle external correctly. * cgraphunit.c (process_function_and_variable_attributes): Finalize extrnal decls. (mark_functions_to_output): Also accept bodies for functions with clones. (output_in_order): Skip external vars. * lto-cgraph.c (lto_output_node): External functions are never in other partition. (lto_output_varpool_node): Likewise. * lto-streamer-out.c (lto_write_tree): Always use error_mark_nodes for forgotten initializers. * ipa.c (process_references): Handle external vars. (symtab_remove_unreachable_nodes): Update to handle external vars. (varpool_externally_visible_p): External vars are externally visible. * gimple-fold.c (can_refer_decl_in_current_unit_p): Update. * varpool.c (varpool_remove_node): Remove constructor. (decide_is_variable_needed): Handle externals. (varpool_remove_unreferenced_decls): Likewise. * lto-partition.c (add_references_to_partition): Handle external vars. (partition_varpool_node_p): Likewise. (lto_promote_cross_file_statics): Do not promote externals. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187631 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index a4c23b35ec5..de854f74b01 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1123,11 +1123,12 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
static inline bool
varpool_can_remove_if_no_refs (struct varpool_node *node)
{
+ if (DECL_EXTERNAL (node->symbol.decl))
+ return true;
return (!node->symbol.force_output && !node->symbol.used_from_other_partition
&& (DECL_COMDAT (node->symbol.decl)
- || !node->symbol.externally_visible
- || DECL_HAS_VALUE_EXPR_P (node->symbol.decl)
- || DECL_EXTERNAL (node->symbol.decl)));
+ || !node->symbol.externally_visible
+ || DECL_HAS_VALUE_EXPR_P (node->symbol.decl)));
}
/* Return true when all references to VNODE must be visible in ipa_ref_list.