diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-29 10:32:08 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-29 10:32:08 +0000 |
commit | 284545178e8dd05756e5b236cf3b47834b87abf2 (patch) | |
tree | 2260e6f71c9022e13476588b282bc487939fa1e4 /gcc/cgraph.h | |
parent | 6357e0d58ab4a8d247cc61b6e87aada89f134037 (diff) | |
download | gcc-284545178e8dd05756e5b236cf3b47834b87abf2.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154736 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index a683c5bc970..1017176ff3f 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -69,6 +69,19 @@ struct GTY(()) inline_summary int time_inlining_benefit; }; +/* Information about thunk, used only for same body aliases. */ + +struct GTY(()) cgraph_thunk_info { + /* Information about the thunk. */ + HOST_WIDE_INT fixed_offset; + HOST_WIDE_INT virtual_value; + tree alias; + bool this_adjusting; + bool virtual_offset_p; + /* Set to true when alias node is thunk. */ + bool thunk_p; +}; + /* Information about the function collected locally. Available after function is analyzed. */ @@ -184,8 +197,8 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node { struct cgraph_node *prev_sibling_clone; struct cgraph_node *clones; struct cgraph_node *clone_of; - /* For normal nodes pointer to the list of alias nodes, in alias - nodes pointer to the normal node. */ + /* For normal nodes pointer to the list of alias and thunk nodes, + in alias/thunk nodes pointer to the normal node. */ struct cgraph_node *same_body; /* For functions with many calls sites it holds map from call expression to the edge to speed up cgraph_edge function. */ @@ -202,6 +215,7 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node { struct cgraph_global_info global; struct cgraph_rtl_info rtl; struct cgraph_clone_info clone; + struct cgraph_thunk_info thunk; /* Expected number of executions: calculated in profile.c. */ gcov_type count; @@ -244,8 +258,8 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node { unsigned alias : 1; /* Set for nodes that was constructed and finalized by frontend. */ unsigned finalized_by_frontend : 1; - /* Set for alias nodes, same_body points to the node they are alias of - and they are linked through the next/previous pointers. */ + /* Set for alias and thunk nodes, same_body points to the node they are alias + of and they are linked through the next/previous pointers. */ unsigned same_body_alias : 1; }; @@ -423,6 +437,7 @@ struct cgraph_edge *cgraph_create_edge (struct cgraph_node *, struct cgraph_node * cgraph_get_node (tree); struct cgraph_node *cgraph_node (tree); bool cgraph_same_body_alias (tree, tree); +void cgraph_add_thunk (tree, tree, bool, HOST_WIDE_INT, HOST_WIDE_INT, tree, tree); void cgraph_remove_same_body_alias (struct cgraph_node *); struct cgraph_node *cgraph_node_for_asm (tree); struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple); |