diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-18 08:31:03 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-18 08:31:03 +0000 |
commit | e0eaac8049ca6b188697d265c857df02a34722ee (patch) | |
tree | d841d5d2b4ed36e1175fc28ca05d5529968c1c38 /gcc/lto-symtab.c | |
parent | 6e5d2d21c82843720cb1d3f02146da2fc71dc4cf (diff) | |
download | gcc-e0eaac8049ca6b188697d265c857df02a34722ee.tar.gz |
* lto-symtab.c (lto_varpool_replace_node): Remove code handling
extra name aliases.
(lto_symtab_resolve_can_prevail_p): Likewise.
(lto_symtab_merge_cgraph_nodes): Update alias_of pointers.
* cgraphbuild.c (record_reference): Remove extra body alias code.
(mark_load): Likewise.
(mark_store): Likewise.
* cgraph.h (varpool_node): Remove extra_name filed;
add alias_of and extraname_alias.
(varpool_create_variable_alias, varpool_for_node_and_aliases): Declare.
(varpool_alias_aliased_node): New inline function.
(varpool_variable_node): New function.
* cgraphunit.c (handle_alias_pairs): Handle also variable aliases.
* ipa-ref.c (ipa_record_reference): Allow aliases on variables.
* lto-cgraph.c (lto_output_varpool_node): Update streaming.
(input_varpool_node): Likewise.
* lto-streamer-out.c (produce_symtab): Remove extra name aliases.
(varpool_externally_visible_p): Remove extra body alias code.
(function_and_variable_visibility): Likewise.
* tree-ssa-structalias.c (associate_varinfo_to_alias_1): New function.
(ipa_pta_execute): Use it.
* varpool.c (varpool_remove_node): Remove extra name alias code.
(varpool_mark_needed_node): Likewise.
(varpool_analyze_pending_decls): Analyze aliases.
(assemble_aliases): New functoin.
(varpool_assemble_decl): Use it.
(varpool_create_variable_alias): New function.
(varpool_extra_name_alias): Rewrite.
(varpool_for_node_and_aliases): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r-- | gcc/lto-symtab.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index d58da8df2db..2bbf064ee7d 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -268,32 +268,9 @@ lto_varpool_replace_node (struct varpool_node *vnode, gcc_assert (!vnode->analyzed || prevailing_node->analyzed); varpool_mark_needed_node (prevailing_node); } - /* Relink aliases. */ - if (vnode->extra_name && !vnode->alias) - { - struct varpool_node *alias, *last; - for (alias = vnode->extra_name; - alias; alias = alias->next) - { - last = alias; - alias->extra_name = prevailing_node; - } - - if (prevailing_node->extra_name) - { - last->next = prevailing_node->extra_name; - prevailing_node->extra_name->prev = last; - } - prevailing_node->extra_name = vnode->extra_name; - vnode->extra_name = NULL; - } gcc_assert (!vnode->finalized || prevailing_node->finalized); gcc_assert (!vnode->analyzed || prevailing_node->analyzed); - /* When replacing by an alias, the references goes to the original - variable. */ - if (prevailing_node->alias && prevailing_node->extra_name) - prevailing_node = prevailing_node->extra_name; ipa_clone_refering (NULL, prevailing_node, &vnode->ref_list); /* Be sure we can garbage collect the initializer. */ @@ -438,14 +415,11 @@ lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e) if (TREE_CODE (e->decl) == FUNCTION_DECL) return (e->node && e->node->analyzed); - /* A variable should have a size. */ else if (TREE_CODE (e->decl) == VAR_DECL) { if (!e->vnode) return false; - if (e->vnode->finalized) - return true; - return e->vnode->alias && e->vnode->extra_name->finalized; + return e->vnode->finalized; } gcc_unreachable (); @@ -779,6 +753,7 @@ void lto_symtab_merge_cgraph_nodes (void) { struct cgraph_node *node; + struct varpool_node *vnode; lto_symtab_maybe_init_hash_table (); htab_traverse (lto_symtab_identifiers, lto_symtab_merge_cgraph_nodes_1, NULL); @@ -786,6 +761,9 @@ lto_symtab_merge_cgraph_nodes (void) if ((node->thunk.thunk_p || node->alias) && node->thunk.alias) node->thunk.alias = lto_symtab_prevailing_decl (node->thunk.alias); + for (vnode = varpool_nodes; vnode; vnode = vnode->next) + if (vnode->alias_of) + vnode->alias_of = lto_symtab_prevailing_decl (vnode->alias_of); } /* Given the decl DECL, return the prevailing decl with the same name. */ |