diff options
author | Jan Hubicka <jh@suse.cz> | 2012-04-20 14:09:11 +0000 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2012-04-20 14:09:11 +0000 |
commit | 6d60115797a28e7b6c384e168d930342fbe2e9a2 (patch) | |
tree | 2702c3a55f5c856b2b5eb0aafbdc79ca115c0691 /gcc/cgraph.h | |
parent | 607e32decbf91c56535a472c4d80955e0a1daf1d (diff) |
* lto-symtab.c (lto_cgraph_replace_node): Merge needed instead of force flags.
* cgraph.c (cgraph_add_thunk): Use mark_reachable_node.
(cgraph_remove_node): Update.
(cgraph_mark_needed_node): Remove.
(cgraph_mark_force_output_node): New.
(dump_cgraph_node): Do not dump needed flag.
(cgraph_node_cannot_be_local_p_1): Update.
(cgraph_can_remove_if_no_direct_calls_and_refs): Update.
* cgraph.h (symtab_node_base): Add force_output flag.
(cgraph_node): Remove needed flag.
(varpool_node): Remove force_output flag.
(cgraph_mark_needed_node): Remove.
(cgraph_mark_force_output_node): New.
(cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_all_refs_explicit_p): Update.
* ipa-cp.c (ipcp_generate_summary): Remove out of date assert.
* cgraphunit.c (cgraph_decide_is_function_needed): rewrite.
(cgraph_add_new_function); Update.
(cgraph_mark_if_needed); Update.
(verify_cgraph_node): Update.
(cgraph_analyze_function): Alias target is reachable.
(process_function_and_variable_attributes): Update: externally_visible
flag makes function reachable.
(cgraph_analyze_functions): Update dumping.
* lto-cgraph.c (lto_output_node, lto_output_varpool_node,
input_overwrite_node, input_varpool_node): Update streaming.
* lto-streamer-out.c (produce_symtab): Use force_output.
* ipa.c (process_references): Weakrefs must be processed.
(cgraph_remove_unreachable_nodes): Likewise; update for new
force_output flag.
(varpool_externally_visible_p); Weakrefs are externally visible
even if they are not.
(function_and_variable_visibility): Update; when processing alias
pair force the targets to be output.
(whole_program_function_and_variable_visility): Use mark_reachable_node.
* trans-mem.c (ipa_tm_mark_needed_node): Remove
(ipa_tm_mark_force_output_node): New function.
(ipa_tm_create_version_alias, ipa_tm_create_version): Update.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Be lax about aliases.
* varasm.c (mark_decl_referenced): Update.
(find_decl_and_mark_needed): Remove.
(find_decl): New function.
(weak_finish, finish_aliases_1, assemble_alias): Update; do not mark
alias targets as needed.
(dump_tm_clone_pairs): Update.
* tree-inline.c (copy_bb): Update check.
* symtab.c (dump_symtab_base): Dump force_output.
* tree-ssa-structalias.c (ipa_pta_execute): Use force_output.
* passes.c (execute_todo): Fix dumping.
* varpool.c (decide_is_variable_needed, varpool_finalize_decl): Update.
(varpool_analyze_pending_decls): Alias target is reachable.
(varpool_create_variable_alias): Finalize weakrefs.
* class.c (make_local_function_alias): Do not mark symbol referenced.
* objc-acct.c (mark_referenced_methods); Use
cgraph_mark_force_output_node.
* gcc-interface/utils.c (gnat_write_global_declarations): Update for new
force_output placement.
* lto/lto-partition.c (partition_cgraph_node_p): Use force_output.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@186624 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 1fd42f16581..5915a14c6c7 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -77,6 +77,9 @@ struct GTY(()) symtab_node_base unsigned in_other_partition : 1; /* Set when function is visible by other units. */ unsigned externally_visible : 1; + /* Needed variables might become dead by optimization. This flag + forces the variable to be output even if it appears dead otherwise. */ + unsigned force_output : 1; }; enum availability @@ -246,12 +249,6 @@ struct GTY(()) cgraph_node { /* Unique id of the node. */ int uid; - /* Set when function must be output for some reason. The primary - use of this flag is to mark functions needed to be output for - non-standard reason. Functions that are externally visible - or reachable from functions needed to be output are marked - by specialized flags. */ - unsigned needed : 1; /* Set when decl is an abstract function pointed to by the ABSTRACT_DECL_ORIGIN of a reachable function. */ unsigned abstract_and_needed : 1; @@ -433,9 +430,6 @@ struct GTY(()) varpool_node { /* Set when function must be output - it is externally visible or its address is taken. */ unsigned needed : 1; - /* Needed variables might become dead by optimization. This flag - forces the variable to be output even if it appears dead otherwise. */ - unsigned force_output : 1; /* Set once the variable has been instantiated and its callee lists created. */ unsigned analyzed : 1; @@ -610,7 +604,7 @@ void cgraph_mark_if_needed (tree); void cgraph_analyze_function (struct cgraph_node *); void cgraph_finalize_compilation_unit (void); void cgraph_optimize (void); -void cgraph_mark_needed_node (struct cgraph_node *); +void cgraph_mark_force_output_node (struct cgraph_node *); void cgraph_mark_address_taken_node (struct cgraph_node *); void cgraph_mark_reachable_node (struct cgraph_node *); bool cgraph_inline_p (struct cgraph_edge *, cgraph_inline_failed_t *reason); @@ -1118,7 +1112,7 @@ static inline bool cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node) { gcc_assert (!node->global.inlined_to); - return (!node->needed && !node->symbol.address_taken + return (!node->symbol.force_output && !node->symbol.address_taken && !node->symbol.used_from_other_partition && !DECL_STATIC_CONSTRUCTOR (node->symbol.decl) && !DECL_STATIC_DESTRUCTOR (node->symbol.decl) @@ -1131,9 +1125,10 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node) static inline bool varpool_can_remove_if_no_refs (struct varpool_node *node) { - return (!node->force_output && !node->symbol.used_from_other_partition + return (!node->symbol.force_output && !node->symbol.used_from_other_partition && (DECL_COMDAT (node->symbol.decl) - || !node->symbol.externally_visible)); + || !node->symbol.externally_visible + || DECL_EXTERNAL (node->symbol.decl))); } /* Return true when all references to VNODE must be visible in ipa_ref_list. @@ -1147,7 +1142,7 @@ varpool_all_refs_explicit_p (struct varpool_node *vnode) return (vnode->analyzed && !vnode->symbol.externally_visible && !vnode->symbol.used_from_other_partition - && !vnode->force_output); + && !vnode->symbol.force_output); } /* Constant pool accessor function. */ |