aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
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/lto
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/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-partition.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 4a5d265..78e32ed 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-01 Martin Liska <mliska@suse.cz>
+
+ IPA REF alias refactoring
+ * lto-partition.c (add_symbol_to_partition_1): Usage of
+ FOR_EACH_ALIAS added.
+
2014-06-28 Jan Hubicka <hubicka@ucw.cz>
Revert:
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index 4d19ef6..944943c 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -113,8 +113,7 @@ static bool
add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
{
enum symbol_partitioning_class c = symtab_get_symbol_partitioning_class (node);
- int i;
- struct ipa_ref *ref = NULL;
+ struct ipa_ref *ref;
symtab_node *node1;
/* If NODE is already there, we have nothing to do. */
@@ -168,8 +167,9 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
add_references_to_partition (part, node);
/* Add all aliases associated with the symbol. */
- for (i = 0; node->iterate_referring (i, ref); i++)
- if (ref->use == IPA_REF_ALIAS && !node->weakref)
+
+ FOR_EACH_ALIAS (node, ref)
+ if (!node->weakref)
add_symbol_to_partition_1 (part, ref->referring);
/* Ensure that SAME_COMDAT_GROUP lists all allways added in a group. */