aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2014-07-01 08:45:26 +0200
committerMartin Liska <marxin@gcc.gnu.org>2014-07-01 06:45:26 +0000
commite55637b71514b1f2106980ff1e8951d5d072f9c4 (patch)
treeaffefec9f6097f6b283af2e7be5845ea0dd4ba45 /gcc/cgraphunit.c
parent705c7d57092b46dc4ea6bba7e60823f828250488 (diff)
downloadgcc-e55637b71514b1f2106980ff1e8951d5d072f9c4.zip
gcc-e55637b71514b1f2106980ff1e8951d5d072f9c4.tar.gz
gcc-e55637b71514b1f2106980ff1e8951d5d072f9c4.tar.bz2
IPA REF alias refactoring
* cgraph.h (iterate_direct_aliases): New function. (FOR_EACH_ALIAS): New macro iterates all direct aliases for a node. * cgraph.c (cgraph_for_node_thunks_and_aliases): Usage of FOR_EACH_ALIAS added. (cgraph_for_node_and_aliases): Likewise. * cgraphunit.c (assemble_thunks_and_aliases): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. *varpool.c (varpool_analyze_node): Likewise. (varpool_for_node_and_aliases): Likewise. * ipa-ref.h (first_alias): New function. (last_alias): Likewise. (has_aliases_p): Likewise. * ipa-ref.c (ipa_ref::remove_reference): Removal function is sensitive to IPA_REF_ALIASes. * symtab.c (symtab_node::add_reference): Node of IPA_REF_ALIAS type are put at the beginning of the list. (symtab_node::iterate_direct_aliases): New function. * lto-partition.c (add_symbol_to_partition_1): Usage of FOR_EACH_ALIAS added. From-SVN: r212191
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index d7e8038..f7980ed 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1711,8 +1711,7 @@ static void
assemble_thunks_and_aliases (struct cgraph_node *node)
{
struct cgraph_edge *e;
- int i;
- struct ipa_ref *ref = NULL;
+ struct ipa_ref *ref;
for (e = node->callers; e;)
if (e->caller->thunk.thunk_p)
@@ -1725,20 +1724,20 @@ assemble_thunks_and_aliases (struct cgraph_node *node)
}
else
e = e->next_caller;
- for (i = 0; node->iterate_referring (i, ref); i++)
- if (ref->use == IPA_REF_ALIAS)
- {
- struct cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring);
- bool saved_written = TREE_ASM_WRITTEN (node->decl);
-
- /* Force assemble_alias to really output the alias this time instead
- of buffering it in same alias pairs. */
- TREE_ASM_WRITTEN (node->decl) = 1;
- do_assemble_alias (alias->decl,
- DECL_ASSEMBLER_NAME (node->decl));
- assemble_thunks_and_aliases (alias);
- TREE_ASM_WRITTEN (node->decl) = saved_written;
- }
+
+ FOR_EACH_ALIAS (node, ref)
+ {
+ struct cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring);
+ bool saved_written = TREE_ASM_WRITTEN (node->decl);
+
+ /* Force assemble_alias to really output the alias this time instead
+ of buffering it in same alias pairs. */
+ TREE_ASM_WRITTEN (node->decl) = 1;
+ do_assemble_alias (alias->decl,
+ DECL_ASSEMBLER_NAME (node->decl));
+ assemble_thunks_and_aliases (alias);
+ TREE_ASM_WRITTEN (node->decl) = saved_written;
+ }
}
/* Expand function specified by NODE. */