aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-08-03 21:54:18 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-08-03 19:54:18 +0000
commit815effe15595b6f680baedaf28868a0d21335302 (patch)
tree03ce7f28fa403515aaa2237e480f2c85c5013a0b /gcc/lto-cgraph.c
parent07838b1363318105e615be10b016099c557927d9 (diff)
downloadgcc-815effe15595b6f680baedaf28868a0d21335302.zip
gcc-815effe15595b6f680baedaf28868a0d21335302.tar.gz
gcc-815effe15595b6f680baedaf28868a0d21335302.tar.bz2
lto-cgraph.c (compute_ltrans_boundary): Add abstract origins into boundaries.
* lto-cgraph.c (compute_ltrans_boundary): Add abstract origins into boundaries. * lto-streamer-out.c (tree_is_indexable): Results decls and parm decls are not indexable. (DFS_write_tree_body): Do not follow args and results. (hash_tree): Likewise. (output_functions): Rearrange so struct function is needed only when real body is output; be able to also ouptut abstract functions; output DECL_ARGUMENTS and DECL_RESULT. (lto_output): When not in WPA, ale store abstract functions. (write_symbol): Do not care about RESULT_DECL. (output_symbol_p): Handle correctly sbtract decls. * lto-streamer-in.c (input_function): Rearrange so struct function can be NULL at entry; allow streaming of functions w/o body; store DECL_ARGUMENTS and DECL_RESULT. * ipa.c (symtab_remove_unreachable_nodes): Silence confused sanity check during LTO. * tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Skip RESULT_DECl and DECL_ARGUMENTS. * tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): Likewise. * lto.c (lto_materialize_function): Do not push struct function. * lto-partition.c (get_symbol_class): Handle abstracts correctly. (may_need_named_section_p): Even abstract origins may need named section. From-SVN: r201468
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 3f9c56d..c3c393f 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -749,6 +749,13 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
add_node_to (encoder, node, true);
lto_set_symtab_encoder_in_partition (encoder, (symtab_node)node);
add_references (encoder, &node->symbol.ref_list);
+ /* For proper debug info, we need to ship the origins, too. */
+ if (DECL_ABSTRACT_ORIGIN (node->symbol.decl))
+ {
+ struct cgraph_node *origin_node
+ = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->symbol.decl));
+ add_node_to (encoder, origin_node, true);
+ }
}
for (lsei = lsei_start_variable_in_partition (in_encoder);
!lsei_end_p (lsei); lsei_next_variable_in_partition (&lsei))
@@ -758,6 +765,13 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
lto_set_symtab_encoder_in_partition (encoder, (symtab_node)vnode);
lto_set_symtab_encoder_encode_initializer (encoder, vnode);
add_references (encoder, &vnode->symbol.ref_list);
+ /* For proper debug info, we need to ship the origins, too. */
+ if (DECL_ABSTRACT_ORIGIN (vnode->symbol.decl))
+ {
+ struct varpool_node *origin_node
+ = varpool_get_node (DECL_ABSTRACT_ORIGIN (node->symbol.decl));
+ lto_set_symtab_encoder_in_partition (encoder, (symtab_node)origin_node);
+ }
}
/* Pickle in also the initializer of all referenced readonly variables
to help folding. Constant pool variables are not shared, so we must