diff options
author | Jan Hubicka <jh@suse.cz> | 2009-11-29 11:32:08 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2009-11-29 10:32:08 +0000 |
commit | 6744a6abc335d55f98ba226f4ff169a55cf3fb94 (patch) | |
tree | 2260e6f71c9022e13476588b282bc487939fa1e4 /gcc/lto-cgraph.c | |
parent | e55690913ecef32cb80d5f169a9aa50fd5ae4a98 (diff) | |
download | gcc-6744a6abc335d55f98ba226f4ff169a55cf3fb94.tar.gz |
cgraph.c (same_body_alias_1): Break out of
* cgraph.c (same_body_alias_1): Break out of
(same_body_alias): ... here; remove comdat check; it is handled
in cp already.
(cgraph_add_thunk): New.
(dump_cgraph_node): Dump aliases and thunks.
* cgraph.h (cgraph_thunk_info): New structure.
(struct cgraph_node): Add thunk info.
(cgraph_add_thunk): New.
* cgraphunit.c (cgraph_emit_thunks): Remove.
(cgraph_finalize_compilation_unit): Do not call cgraph_emit_thunks.
(assemble_thunk): New function.
(cgraph_expand_function): Handle thunks.
(thunk_adjust): New.
(init_lowered_empty_function): New.
* optimize.c (maybe_clone_body): Emit thunks associated to alias.
* Make-lang.in (method.o): Add dependency on gimple.h.
* method.c: Include gimple.h
(make_alias_for_thunk): Use same body alias instead of assemble_alias.
(use_thunk): Drop codegen; use cgraph_add_thunk; gimplify
generic thunks.
* semantics.c (expand_or_defer_fn): Emit associated thunks.
* cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove.
* lto-cgraph.c (lto_output_node): Stream thunk info.
(input_node): Likewise.
* langhooks.h (lang_hooks_for_callgraph): Remove emit_associated_thunks.
* langhooks-def.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove.
(LANG_HOOKS_CALLGRAPH_INITIALIZER): Update.
* i386.c (x86_output_mi_thunk): Make output prettier.
From-SVN: r154736
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 0f77df1a145..309a1e6e964 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -317,6 +317,21 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, { lto_output_fn_decl_index (ob->decl_state, ob->main_stream, alias->decl); + if (alias->thunk.thunk_p) + { + lto_output_uleb128_stream + (ob->main_stream, + 1 + (alias->thunk.this_adjusting != 0) * 2 + + (alias->thunk.virtual_offset_p != 0) * 4); + lto_output_uleb128_stream (ob->main_stream, + alias->thunk.fixed_offset); + lto_output_uleb128_stream (ob->main_stream, + alias->thunk.virtual_value); + lto_output_fn_decl_index (ob->decl_state, ob->main_stream, + alias->thunk.alias); + } + else + lto_output_uleb128_stream (ob->main_stream, 0); alias = alias->previous; } while (alias); @@ -575,9 +590,24 @@ input_node (struct lto_file_decl_data *file_data, while (same_body_count-- > 0) { tree alias_decl; + int type; decl_index = lto_input_uleb128 (ib); alias_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index); - cgraph_same_body_alias (alias_decl, fn_decl); + type = lto_input_uleb128 (ib); + if (!type) + cgraph_same_body_alias (alias_decl, fn_decl); + else + { + HOST_WIDE_INT fixed_offset = lto_input_uleb128 (ib); + HOST_WIDE_INT virtual_value = lto_input_uleb128 (ib); + tree real_alias; + decl_index = lto_input_uleb128 (ib); + real_alias = lto_file_decl_data_get_fn_decl (file_data, decl_index); + cgraph_add_thunk (alias_decl, fn_decl, type & 2, fixed_offset, + virtual_value, + (type & 4) ? size_int (virtual_value) : NULL_TREE, + real_alias); + } } return node; } |