diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-18 09:53:52 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-18 09:53:52 +0000 |
commit | ed772161067b3dbee0dbc2ccf93e20e574db2067 (patch) | |
tree | e08b1ed30e6c41061167a50b2e85f7af35d6e70c /gcc/cgraph.h | |
parent | e694b73b6383ee08ed2d4c4058049a62ab6677b7 (diff) | |
download | gcc-ed772161067b3dbee0dbc2ccf93e20e574db2067.tar.gz |
PR c++/3187
* cgraph.h (struct cgraph_node): Add same_body and same_body_alias
fields.
(cgraph_same_body_alias, cgraph_remove_same_body_alias): New
prototypes.
* cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks,
cgraph_materialize_all_clones): Handle same_body aliases.
* cgraph.c (cgraph_allocate_node): New function.
(cgraph_create_node): Use it.
(cgraph_node_for_decl, cgraph_node, cgraph_get_node,
cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases.
(cgraph_same_body_alias, cgraph_remove_same_body_alias): New
functions.
* lto-cgraph.c (lto_output_node): Stream out same_body aliases.
(input_node): Stream in same_body aliases.
* lto-symtab.c (lto_cgraph_replace_node): Clear node pointers
for same_body aliases.
(lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases.
* cp-tree.h (expand_or_defer_fn_1): New prototype.
* decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL
also all same_body aliases.
* semantics.c (expand_or_defer_fn): Move most of the function
except registering with cgraph to ...
(expand_or_defer_fn_1): ... here. New function.
* optimize.c: Include cgraph.h.
(maybe_clone_body): If in charge parm is not used and both base
and complete clones are created and are not comdat, tell cgraph
they have the same body.
* Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H).
* g++.dg/abi/mangle26.C: Also match *C2* definition.
* g++.dg/abi/mangle27.C: Likewise.
* g++.dg/abi/mangle28.C: Likewise.
* g++.dg/abi/mangle29.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154284 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 33eb821dd5d..02c087d772e 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -184,6 +184,9 @@ 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. */ + 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. */ htab_t GTY((param_is (struct cgraph_edge))) call_site_hash; @@ -241,6 +244,9 @@ 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. */ + unsigned same_body_alias : 1; }; typedef struct cgraph_node *cgraph_node_ptr; @@ -416,6 +422,8 @@ 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_remove_same_body_alias (struct cgraph_node *); struct cgraph_node *cgraph_node_for_asm (tree); struct cgraph_node *cgraph_node_for_decl (tree); struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple); |