aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2009-03-30 16:43:40 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2009-03-30 16:43:40 +0000
commitf4d9f129fe9884da7b5f92f919a22157f729c577 (patch)
tree7886158a4e7de339c1bddbf1475cbceec18b4327 /gcc/tree.c
parentbe21df036cb6a1d91d0016e6f66889b5ff5e9a5d (diff)
downloadgcc-f4d9f129fe9884da7b5f92f919a22157f729c577.zip
gcc-f4d9f129fe9884da7b5f92f919a22157f729c577.tar.gz
gcc-f4d9f129fe9884da7b5f92f919a22157f729c577.tar.bz2
re PR middle-end/38237 (multiple weak directives)
PR middle-end/38237 * tree.h (tree_find_value): New declaration. * tree.c (tree_find_value): New function. * varasm.c (assemble_external): Avoid duplicate entries on lists. From-SVN: r145303
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 76cba27..bbc52e7 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1802,6 +1802,18 @@ tree_last (tree chain)
return chain;
}
+/* Return the node in a chain of nodes whose value is x, NULL if not found. */
+
+tree
+tree_find_value (tree chain, tree x)
+{
+ tree list;
+ for (list = chain; list; list = TREE_CHAIN (list))
+ if (TREE_VALUE (list) == x)
+ return list;
+ return NULL;
+}
+
/* Reverse the order of elements in the chain T,
and return the new head of the chain (old last element). */