tree.c (chain_index): New fn.
* tree.c (chain_index): New fn. * tree.h: Declare it. From-SVN: r151618
This commit is contained in:
parent
43dfd40c1d
commit
ad42ff1e07
3 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-09-10 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* tree.c (chain_index): New fn.
|
||||
* tree.h: Declare it.
|
||||
|
||||
2009-09-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* config/sol2-c.c (cmn_err_length_specs): Initialize
|
||||
|
|
11
gcc/tree.c
11
gcc/tree.c
|
@ -1905,6 +1905,17 @@ purpose_member (const_tree elem, tree list)
|
|||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Returns element number IDX (zero-origin) of chain CHAIN, or
|
||||
NULL_TREE. */
|
||||
|
||||
tree
|
||||
chain_index (int idx, tree chain)
|
||||
{
|
||||
for (; chain && idx > 0; --idx)
|
||||
chain = TREE_CHAIN (chain);
|
||||
return chain;
|
||||
}
|
||||
|
||||
/* Return nonzero if ELEM is part of the chain CHAIN. */
|
||||
|
||||
int
|
||||
|
|
|
@ -3914,6 +3914,7 @@ extern bool range_in_array_bounds_p (tree);
|
|||
|
||||
extern tree value_member (tree, tree);
|
||||
extern tree purpose_member (const_tree, tree);
|
||||
extern tree chain_index (int, tree);
|
||||
|
||||
extern int attribute_list_equal (const_tree, const_tree);
|
||||
extern int attribute_list_contained (const_tree, const_tree);
|
||||
|
|
Loading…
Add table
Reference in a new issue