From ce4469fac1ceab921d48ec409e3f4d0d9f81247e Mon Sep 17 00:00:00 2001 From: ghazi Date: Sat, 1 Sep 2007 17:18:03 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128014 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-iterator.c | 86 ++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 47 deletions(-) (limited to 'gcc/tree-iterator.c') diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c index 1e7a682d391..a49744cf6c0 100644 --- a/gcc/tree-iterator.c +++ b/gcc/tree-iterator.c @@ -299,29 +299,22 @@ tsi_split_statement_list_before (tree_stmt_iterator *i) /* Return the first expression in a sequence of COMPOUND_EXPRs, or in a STATEMENT_LIST. */ -#define EXPR_FIRST_BODY do { \ - if (expr == NULL_TREE) \ - return expr; \ - if (TREE_CODE (expr) == STATEMENT_LIST) \ - { \ - struct tree_statement_list_node *n = STATEMENT_LIST_HEAD (expr); \ - return n ? n->stmt : NULL_TREE; \ - } \ - while (TREE_CODE (expr) == COMPOUND_EXPR) \ - expr = TREE_OPERAND (expr, 0); \ - return expr; \ -} while (0) - tree expr_first (tree expr) { - EXPR_FIRST_BODY; -} + if (expr == NULL_TREE) + return expr; -const_tree -const_expr_first (const_tree expr) -{ - EXPR_FIRST_BODY; + if (TREE_CODE (expr) == STATEMENT_LIST) + { + struct tree_statement_list_node *n = STATEMENT_LIST_HEAD (expr); + return n ? n->stmt : NULL_TREE; + } + + while (TREE_CODE (expr) == COMPOUND_EXPR) + expr = TREE_OPERAND (expr, 0); + + return expr; } /* Return the last expression in a sequence of COMPOUND_EXPRs, @@ -343,45 +336,44 @@ const_expr_first (const_tree expr) tree expr_last (tree expr) { - EXPR_LAST_BODY; -} + if (expr == NULL_TREE) + return expr; -const_tree -const_expr_last (const_tree expr) -{ - EXPR_LAST_BODY; + if (TREE_CODE (expr) == STATEMENT_LIST) + { + struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr); + return n ? n->stmt : NULL_TREE; + } + + while (TREE_CODE (expr) == COMPOUND_EXPR) + expr = TREE_OPERAND (expr, 1); + + return expr; } /* If EXPR is a single statement return it. If EXPR is a STATEMENT_LIST containing exactly one statement S, return S. Otherwise, return NULL. */ -#define EXPR_ONLY_BODY do { \ - if (expr == NULL_TREE) \ - return NULL_TREE; \ - if (TREE_CODE (expr) == STATEMENT_LIST) \ - { \ - struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr); \ - if (n && STATEMENT_LIST_HEAD (expr) == n) \ - return n->stmt; \ - else \ - return NULL_TREE; \ - } \ - if (TREE_CODE (expr) == COMPOUND_EXPR) \ - return NULL_TREE; \ - return expr; \ -} while (0) - tree expr_only (tree expr) { - EXPR_ONLY_BODY; -} + if (expr == NULL_TREE) + return NULL_TREE; -const_tree -const_expr_only (const_tree expr) -{ - EXPR_ONLY_BODY; + if (TREE_CODE (expr) == STATEMENT_LIST) + { + struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr); + if (n && STATEMENT_LIST_HEAD (expr) == n) + return n->stmt; + else + return NULL_TREE; + } + + if (TREE_CODE (expr) == COMPOUND_EXPR) + return NULL_TREE; + + return expr; } #include "gt-tree-iterator.h" -- cgit v1.2.1