aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-04-30 17:55:29 +0000
committerJan Hubicka <jh@suse.cz>2012-04-30 17:55:29 +0000
commit9c7cd4049c33cb3098fac32273df3b07cbb7ac06 (patch)
treea3bcb26607a9acedb2c93c538095fba522a39176 /gcc/ipa.c
parent85bc5b7bb175cafc89c3dc8dc4c7bd78b4c7ef31 (diff)
* cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c
(cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Move to cgraphunit.c. (cgraph_make_decl_local): Move to symtab.c (cgraph_make_node_local_1): Update. (cgraph_can_remove_if_no_direct_calls_and): Update. (used_from_object_file_p): Update. (resolution_used_from_other_file_p): Move to symtab.c (cgraph_used_from_object_file_p): move to symtab.c (verify_cgraph_node): Verify same comdat groups. * cgraph.h (cgraph_asm_node): Rename to ... (asm_node): ... this one. (cgraph_asm_nodes): Rename to ... (asm_nodes): ... this one. (symtab_add_to_same_comdat_group): New function. (symtab_dissolve_same_comdat_group_list): New function. (symtab_used_from_object_file_p): Declare. (symtab_make_decl_local): Declare. (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Remove. (cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Remove. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one. (cgraph_optimize): Rename to .... (compile): ... this one. (add_asm_node): Declare. (fixup_same_cpp_alias_visibility): Declare. (cgraph_make_decl_local): Remove. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one. (varpool_remove_unreferenced_decls): Remove. * ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups. (preserve_function_body_p): Make static. * toplev.c (compile_file): Update comments; update. * cgraphunit.c: Update comments. (cgraph_expand_all_functions): Rename to ... (expand_all_functions): ... this one; update. (cgraph_mark_functions_to_output): Rename to ... (mark_functions_to_output): ... this one; cleanup. (cgraph_output_pending_asms): Remove prototype. (asm_nodes, asm_last_node): New static vars. (cgraph_process_new_functions): Update. (cgraph_reset_node): Cleanup; add comment. (cgraph_add_new_function): Update. (cgraph_output_pending_asms): Rename to ... (output_asm_statements): ... this one. (add_asm_node): New function. (fixup_same_cpp_alias_visibility): New function based on code in cgraph_analyze_function. (cgraph_analyze_function): Use it. (cgraph_order_sort): Update. (cgraph_output_in_order): Update. (cgraph_function_versioning): Update. (cgraph_optimize): Rename to ... (compile): ... this one; initialize streamer hooks here. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one; do not initialize streamer hook here. * lto-streamer-out.c (lto_output_toplevel_asms): Update. * dwarf2out.c: Update ocmment. * optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group. * method.c (use_thunk): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. * decl2.c (maybe_emit_vtables): Likewise. (cp_write_global_declarations): Use finalize_compilation_unit. * parser.c (cp_parser_asm_definition): Use add_asm_node. * lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node * c-decl.c (c_write_global_declarations): Use finalize_compilation_unit. * langhooks.c (write_global_declarations): Update. * ipa.c (cgraph_externally_visible_p): Update. (dissolve_same_comdat_group_list): Remove. (function_and_variable_visibility): Update. * symtab.c: Inlcude lto-streamer.h and rtl.h (ld_plugin_symbol_resolution_names): New. (symtab_add_to_same_comdat_group): New. (symtab_dissolve_same_comdat_group_list): New. (resolution_used_from_other_file_p): Move here from cgraph.c (symtab_used_from_object_file_p): New. (symtab_make_decl_local): New. * passes.c (register_pass): Update comments. * c-parser.c (c_parser_asm_definition): Update. * varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility. (varpool_remove_unreferenced_decls): Make static. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one; call varpool_remove_unreferenced_decls. (varpool_used_from_object_file_p): Remove. * gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit. * gcc-interface/utils.c (rest_of_subprog_body_compilation): Update comment. (gnat_write_global_declarations): Use finalize_compilation_unit. * f95-lang.c (gfc_finish): Update comments. * lto.c (lto_main): Use compile (). * lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p. (partition_varpool_node_p): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@186998 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 5a97008784d..a722386934b 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -598,7 +598,7 @@ cgraph_externally_visible_p (struct cgraph_node *node,
return true;
/* If linker counts on us, we must preserve the function. */
- if (cgraph_used_from_object_file_p (node))
+ if (symtab_used_from_object_file_p ((symtab_node) node))
return true;
if (DECL_PRESERVE_P (node->symbol.decl))
return true;
@@ -657,7 +657,7 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
return true;
/* If linker counts on us, we must preserve the function. */
- if (varpool_used_from_object_file_p (vnode))
+ if (symtab_used_from_object_file_p ((symtab_node) vnode))
return true;
if (DECL_HARD_REGISTER (vnode->symbol.decl))
@@ -678,7 +678,7 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
Even if the linker clams the symbol is unused, never bring internal
symbols that are declared by user as used or externally visible.
This is needed for i.e. references from asm statements. */
- if (varpool_used_from_object_file_p (vnode))
+ if (symtab_used_from_object_file_p ((symtab_node) vnode))
return true;
if (vnode->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY)
return false;
@@ -716,21 +716,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
return false;
}
-/* Dissolve the same_comdat_group list in which NODE resides. */
-
-static void
-dissolve_same_comdat_group_list (symtab_node node)
-{
- symtab_node n = node, next;
- do
- {
- next = n->symbol.same_comdat_group;
- n->symbol.same_comdat_group = NULL;
- n = next;
- }
- while (n != node);
-}
-
/* Mark visibility of all functions.
A local function is one whose calls can occur only in the current
@@ -825,7 +810,7 @@ function_and_variable_visibility (bool whole_program)
all of them have to be, otherwise it is a front-end bug. */
gcc_assert (DECL_EXTERNAL (n->symbol.decl));
#endif
- dissolve_same_comdat_group_list ((symtab_node) node);
+ symtab_dissolve_same_comdat_group_list ((symtab_node) node);
}
gcc_assert ((!DECL_WEAK (node->symbol.decl)
&& !DECL_COMDAT (node->symbol.decl))
@@ -845,14 +830,14 @@ function_and_variable_visibility (bool whole_program)
{
gcc_assert (whole_program || in_lto_p
|| !TREE_PUBLIC (node->symbol.decl));
- cgraph_make_decl_local (node->symbol.decl);
+ symtab_make_decl_local (node->symbol.decl);
node->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
if (node->symbol.same_comdat_group)
/* cgraph_externally_visible_p has already checked all other nodes
in the group and they will all be made local. We need to
dissolve the group at once so that the predicate does not
segfault though. */
- dissolve_same_comdat_group_list ((symtab_node) node);
+ symtab_dissolve_same_comdat_group_list ((symtab_node) node);
}
if (node->thunk.thunk_p
@@ -921,9 +906,9 @@ function_and_variable_visibility (bool whole_program)
if (!vnode->symbol.externally_visible)
{
gcc_assert (in_lto_p || whole_program || !TREE_PUBLIC (vnode->symbol.decl));
- cgraph_make_decl_local (vnode->symbol.decl);
+ symtab_make_decl_local (vnode->symbol.decl);
if (vnode->symbol.same_comdat_group)
- dissolve_same_comdat_group_list ((symtab_node) vnode);
+ symtab_dissolve_same_comdat_group_list ((symtab_node) vnode);
vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
}
gcc_assert (TREE_STATIC (vnode->symbol.decl));