diff options
author | Jan Hubicka <jh@suse.cz> | 2012-04-20 16:09:11 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2012-04-20 14:09:11 +0000 |
commit | ead84f73b0a0f39ea39aa0329b6da83e4a9e6e02 (patch) | |
tree | 2702c3a55f5c856b2b5eb0aafbdc79ca115c0691 /gcc/cgraph.c | |
parent | 757e8ba242c179e76379c617a417283a2e1f40f4 (diff) | |
download | gcc-ead84f73b0a0f39ea39aa0329b6da83e4a9e6e02.zip gcc-ead84f73b0a0f39ea39aa0329b6da83e4a9e6e02.tar.gz gcc-ead84f73b0a0f39ea39aa0329b6da83e4a9e6e02.tar.bz2 |
lto-symtab.c (lto_cgraph_replace_node): Merge needed instead of force flags.
* 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.
From-SVN: r186624
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 8ba9c36..4588249 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -570,7 +570,7 @@ cgraph_add_thunk (struct cgraph_node *decl_node ATTRIBUTE_UNUSED, node->local.finalized = true; if (cgraph_decide_is_function_needed (node, decl)) - cgraph_mark_needed_node (node); + cgraph_mark_reachable_node (node); if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) || (DECL_VIRTUAL_P (decl) @@ -1362,7 +1362,7 @@ cgraph_remove_node (struct cgraph_node *node) /* Incremental inlining access removed nodes stored in the postorder list. */ - node->needed = node->reachable = false; + node->symbol.force_output = node->reachable = false; for (n = node->nested; n; n = n->next_nested) n->origin = NULL; node->nested = NULL; @@ -1518,9 +1518,9 @@ cgraph_mark_reachable_node (struct cgraph_node *node) external means. */ void -cgraph_mark_needed_node (struct cgraph_node *node) +cgraph_mark_force_output_node (struct cgraph_node *node) { - node->needed = 1; + node->symbol.force_output = 1; gcc_assert (!node->global.inlined_to); cgraph_mark_reachable_node (node); } @@ -1642,8 +1642,6 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) (HOST_WIDEST_INT)node->count); if (node->origin) fprintf (f, " nested in: %s", cgraph_node_asm_name (node->origin)); - if (node->needed) - fprintf (f, " needed"); else if (node->reachable) fprintf (f, " reachable"); if (gimple_has_body_p (node->symbol.decl)) @@ -2134,7 +2132,7 @@ static bool cgraph_node_cannot_be_local_p_1 (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) { - return !(!node->needed + return !(!node->symbol.force_output && ((DECL_COMDAT (node->symbol.decl) && !node->symbol.same_comdat_group) || !node->symbol.externally_visible)); @@ -2570,7 +2568,7 @@ cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node) if (DECL_EXTERNAL (node->symbol.decl)) return true; /* When function is needed, we can not remove it. */ - if (node->needed || node->symbol.used_from_other_partition) + if (node->symbol.force_output || node->symbol.used_from_other_partition) return false; if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl) || DECL_STATIC_DESTRUCTOR (node->symbol.decl)) |