aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-ref.c')
-rw-r--r--gcc/ipa-ref.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ipa-ref.c b/gcc/ipa-ref.c
index 044e237..d6ac25f 100644
--- a/gcc/ipa-ref.c
+++ b/gcc/ipa-ref.c
@@ -198,3 +198,20 @@ ipa_ref_has_aliases_p (struct ipa_ref_list *ref_list)
return true;
return false;
}
+
+/* Find the structure describing a reference in REFERRING_NODE to REFERRED_NODE
+ and associated with statement STMT. */
+
+struct ipa_ref *
+ipa_find_reference (symtab_node referring_node, symtab_node referred_node,
+ gimple stmt)
+{
+ struct ipa_ref *r = NULL;
+ int i;
+
+ FOR_EACH_VEC_SAFE_ELT (referring_node->symbol.ref_list.references, i, r)
+ if (r->referred == referred_node
+ && (in_lto_p || r->stmt == stmt))
+ return r;
+ return NULL;
+}