aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto/lto.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto/lto.c')
-rw-r--r--gcc/lto/lto.c66
1 files changed, 9 insertions, 57 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 79af51f3478..54fde65c69a 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1635,53 +1635,6 @@ lto_fixup_state_aux (void **slot, void *aux)
return 1;
}
-/* Fixup pointers in jump functions.
- TODO: We need some generic solution that will allow tree pointers in
- function summaries. */
-static void
-lto_fixup_jump_functions (lto_fixup_data_t * data)
-{
- struct cgraph_node *node;
- struct cgraph_edge *cs;
-
- for (node = cgraph_nodes; node; node = node->next)
- {
- if (!node->analyzed)
- continue;
- for (cs = node->callees; cs; cs = cs->next_callee)
- {
- int i;
- struct ipa_edge_args *args = IPA_EDGE_REF (cs);
- for (i = 0; i < ipa_get_cs_argument_count (args); i++)
- {
- struct ipa_jump_func *jf = ipa_get_ith_jump_func (args, i);
- switch (jf->type)
- {
- case IPA_JF_UNKNOWN:
- break;
- case IPA_JF_CONST:
- walk_tree (&jf->value.constant, lto_fixup_tree, data, NULL);
- break;
- case IPA_JF_PASS_THROUGH:
- walk_tree (&jf->value.pass_through.operand, lto_fixup_tree,
- data, NULL);
- break;
- case IPA_JF_ANCESTOR:
- walk_tree (&jf->value.ancestor.type, lto_fixup_tree, data,
- NULL);
- break;
- case IPA_JF_CONST_MEMBER_PTR:
- walk_tree (&jf->value.member_cst.pfn, lto_fixup_tree, data,
- NULL);
- walk_tree (&jf->value.member_cst.delta, lto_fixup_tree,
- data, NULL);
- break;
- }
- }
- }
- }
-}
-
/* Fix the decls from all FILES. Replaces each decl with the corresponding
prevailing one. */
@@ -1710,8 +1663,6 @@ lto_fixup_decls (struct lto_file_decl_data **files)
if (decl != saved_decl)
VEC_replace (tree, lto_global_var_decls, i, decl);
}
- if (ipa_edge_args_vector)
- lto_fixup_jump_functions (&data);
pointer_set_destroy (seen);
}
@@ -1851,11 +1802,18 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* Read the callgraph. */
input_cgraph ();
+ /* Merge global decls. */
+ lto_symtab_merge_decls ();
+
+ /* Fixup all decls and types and free the type hash tables. */
+ lto_fixup_decls (all_file_decl_data);
+ free_gimple_type_tables ();
+
/* Read the IPA summary data. */
ipa_read_summaries ();
- /* Merge global decls. */
- lto_symtab_merge_decls ();
+ /* Finally merge the cgraph according to the decl merging decisions. */
+ lto_symtab_merge_cgraph_nodes ();
/* Mark cgraph nodes needed in the merged cgraph
This normally happens in whole-program pass, but for
@@ -1872,12 +1830,6 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
timevar_push (TV_IPA_LTO_DECL_IO);
- /* Fixup all decls and types. */
- lto_fixup_decls (all_file_decl_data);
-
- /* Free the type hash tables. */
- free_gimple_type_tables ();
-
/* FIXME lto. This loop needs to be changed to use the pass manager to
call the ipa passes directly. */
if (!errorcount)