aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-09-01 17:18:03 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-09-01 17:18:03 +0000
commit755478019ac28552396592d63b2e1ffeeaa24206 (patch)
tree219b94e14e50ec61d3797a74d100f7b56eb8d994 /gcc/tree.c
parentb65e51a81fd877211cacb75bc07b56dcb45444b4 (diff)
downloadgcc-755478019ac28552396592d63b2e1ffeeaa24206.zip
gcc-755478019ac28552396592d63b2e1ffeeaa24206.tar.gz
gcc-755478019ac28552396592d63b2e1ffeeaa24206.tar.bz2
c-common.c (const_strip_array_types): Delete.
* c-common.c (const_strip_array_types): Delete. * c-common.h (const_strip_array_types): Likewise. * emit-rtl.c (const_next_insn, const_previous_insn, const_next_nonnote_insn, const_prev_nonnote_insn, const_next_real_insn, const_prev_real_insn, const_next_active_insn, const_prev_active_insn, const_next_label, const_prev_label): Delete. * gimple-low.c (block_may_fallthru): Use expr_last. * jump.c (reversed_comparison_code_parts): Use prev_nonnote_insn. * rtl.h (const_previous_insn, const_next_insn, const_prev_nonnote_insn, const_next_nonnote_insn, const_prev_real_insn, const_next_real_insn, const_prev_active_insn, const_next_active_insn, const_prev_label, const_next_label): Delete. * rtlanal.c (keep_with_call_p): Use next_nonnote_insn. * system.h (CONST_CAST): Update comment. * tree-cfg.c (tree_can_merge_blocks_p): Use last_stmt. (const_first_stmt, const_last_stmt): Delete. (tree_block_ends_with_condjump_p): Use last_stmt. * tree-flow.h (const_first_stmt, const_last_stmt): Delete. * tree-iterator.c (const_expr_first, const_expr_last, const_expr_only): Delete. * tree.c (const_lookup_attribute): Likewise. (attribute_list_contained): Use lookup_attribute. * tree.h (const_lookup_attribute, const_expr_first, const_expr_last, const_expr_only): Delete. cp: * tree.c (pod_type_p, zero_init_p): Use strip_array_types. * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): Likewise. From-SVN: r128014
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index c9587aa..d04c1f0 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3809,28 +3809,19 @@ is_attribute_p (const char *attr, const_tree ident)
returns the first occurrence; the TREE_CHAIN of the return value should
be passed back in if further occurrences are wanted. */
-#define LOOKUP_ATTRIBUTE_BODY(TYPE) do { \
- TYPE l; \
- size_t attr_len = strlen (attr_name); \
- for (l = list; l; l = TREE_CHAIN (l)) \
- { \
- gcc_assert (TREE_CODE (TREE_PURPOSE (l)) == IDENTIFIER_NODE); \
- if (is_attribute_with_length_p (attr_name, attr_len, TREE_PURPOSE (l))) \
- return l; \
- } \
- return NULL_TREE; \
-} while (0)
-
tree
lookup_attribute (const char *attr_name, tree list)
{
- LOOKUP_ATTRIBUTE_BODY(tree);
-}
+ tree l;
+ size_t attr_len = strlen (attr_name);
-const_tree
-const_lookup_attribute (const char *attr_name, const_tree list)
-{
- LOOKUP_ATTRIBUTE_BODY(const_tree);
+ for (l = list; l; l = TREE_CHAIN (l))
+ {
+ gcc_assert (TREE_CODE (TREE_PURPOSE (l)) == IDENTIFIER_NODE);
+ if (is_attribute_with_length_p (attr_name, attr_len, TREE_PURPOSE (l)))
+ return l;
+ }
+ return NULL_TREE;
}
/* Remove any instances of attribute ATTR_NAME in LIST and return the
@@ -4800,10 +4791,14 @@ attribute_list_contained (const_tree l1, const_tree l2)
for (; t2 != 0; t2 = TREE_CHAIN (t2))
{
const_tree attr;
- for (attr = const_lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)), l1);
+ /* This CONST_CAST is okay because lookup_attribute does not
+ modify its argument and the return value is assigned to a
+ const_tree. */
+ for (attr = lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)),
+ (tree)CONST_CAST(l1));
attr != NULL_TREE;
- attr = const_lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)),
- TREE_CHAIN (attr)))
+ attr = lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)),
+ TREE_CHAIN (attr)))
{
if (TREE_VALUE (t2) != NULL
&& TREE_CODE (TREE_VALUE (t2)) == TREE_LIST