c-common.c, [...]: Replace uses of first_rtl_op with TREE_CODE_LENGTH.

gcc/
	* c-common.c, expr.c, fold-const.c, print-tree.c,
	tree-gimple.c, tree-inline.c, tree-pretty-print.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c: Replace uses of
	first_rtl_op with TREE_CODE_LENGTH.
	* tree.c (first_rtl_op): Remove.
	Replace uses of first_rtl_op with TREE_CODE_LENGTH.
	* tree.h: Remove the prototype for first_rtl_op.

gcc/cp/
	* pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.

From-SVN: r91818
This commit is contained in:
Kazu Hirata 2004-12-07 21:23:10 +00:00 committed by Kazu Hirata
parent b180d5fb7b
commit 54e4aedb7e
14 changed files with 37 additions and 41 deletions

View File

@ -1,3 +1,13 @@
2004-12-07 Kazu Hirata <kazu@cs.umass.edu>
* c-common.c, expr.c, fold-const.c, print-tree.c,
tree-gimple.c, tree-inline.c, tree-pretty-print.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c: Replace uses of
first_rtl_op with TREE_CODE_LENGTH.
* tree.c (first_rtl_op): Remove.
Replace uses of first_rtl_op with TREE_CODE_LENGTH.
* tree.h: Remove the prototype for first_rtl_op.
2004-12-07 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/t-aix43, config/rs6000/t-aix52 (SHLIB_LINK):

View File

@ -1365,7 +1365,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
Other non-expressions need not be processed. */
if (cl == tcc_unary)
{
if (first_rtl_op (code) == 0)
if (TREE_CODE_LENGTH (code) == 0)
return;
x = TREE_OPERAND (x, 0);
writer = 0;
@ -1374,7 +1374,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
else if (IS_EXPR_CODE_CLASS (cl))
{
int lp;
int max = first_rtl_op (TREE_CODE (x));
int max = TREE_CODE_LENGTH (TREE_CODE (x));
for (lp = 0; lp < max; lp++)
{
tmp_before = tmp_nosp = 0;

View File

@ -1,3 +1,7 @@
2004-12-07 Kazu Hirata <kazu@cs.umass.edu>
* pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.
2004-12-07 Roger Sayle <roger@eyesopen.com>
* name-lookup.c (leave_scope): We only need to update

View File

@ -12010,7 +12010,7 @@ value_dependent_expression_p (tree expression)
case tcc_expression:
{
int i;
for (i = 0; i < first_rtl_op (TREE_CODE (expression)); ++i)
for (i = 0; i < TREE_CODE_LENGTH (TREE_CODE (expression)); ++i)
/* In some cases, some of the operands may be missing.
(For example, in the case of PREDECREMENT_EXPR, the
amount to increment by may be missing.) That doesn't

View File

@ -5944,7 +5944,7 @@ safe_from_p (rtx x, tree exp, int top_p)
if (exp_rtl)
break;
nops = first_rtl_op (TREE_CODE (exp));
nops = TREE_CODE_LENGTH (TREE_CODE (exp));
for (i = 0; i < nops; i++)
if (TREE_OPERAND (exp, i) != 0
&& ! safe_from_p (x, TREE_OPERAND (exp, i), 0))

View File

@ -3550,7 +3550,7 @@ make_range (tree exp, int *pin_p, tree *plow, tree *phigh)
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
{
if (first_rtl_op (code) > 0)
if (TREE_CODE_LENGTH (code) > 0)
arg0 = TREE_OPERAND (exp, 0);
if (TREE_CODE_CLASS (code) == tcc_comparison
|| TREE_CODE_CLASS (code) == tcc_unary
@ -6277,7 +6277,7 @@ fold (tree expr)
}
else if (IS_EXPR_CODE_CLASS (kind))
{
int len = first_rtl_op (code);
int len = TREE_CODE_LENGTH (code);
int i;
for (i = 0; i < len; i++)
{
@ -9418,7 +9418,7 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
case tcc_unary:
case tcc_binary:
case tcc_statement:
len = first_rtl_op (code);
len = TREE_CODE_LENGTH (code);
for (i = 0; i < len; ++i)
fold_checksum_tree (TREE_OPERAND (expr, i), ctx, ht);
break;

View File

@ -593,7 +593,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
/* Some nodes contain rtx's, not trees,
after a certain point. Print the rtx's as rtx's. */
first_rtl = first_rtl_op (TREE_CODE (node));
first_rtl = TREE_CODE_LENGTH (TREE_CODE (node));
for (i = 0; i < len; i++)
{

View File

@ -443,7 +443,7 @@ void
recalculate_side_effects (tree t)
{
enum tree_code code = TREE_CODE (t);
int fro = first_rtl_op (code);
int fro = TREE_CODE_LENGTH (code);
int i;
switch (TREE_CODE_CLASS (code))

View File

@ -1391,7 +1391,7 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
if (TREE_CODE (*tp) == TARGET_EXPR)
{
#if 0
int i, len = first_rtl_op (TARGET_EXPR);
int i, len = TREE_CODE_LENGTH (TARGET_EXPR);
/* We're walking our own subtrees. */
*walk_subtrees = 0;
@ -2088,7 +2088,7 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, struct pointer_set_t *pset)
int i, len;
/* Walk over all the sub-trees of this operand. */
len = first_rtl_op (code);
len = TREE_CODE_LENGTH (code);
/* TARGET_EXPRs are peculiar: operands 1 and 3 can be the same.
But, we only want to walk once. */
if (code == TARGET_EXPR

View File

@ -72,7 +72,7 @@ do_niy (pretty_printer *buffer, tree node)
if (EXPR_P (node))
{
len = first_rtl_op (TREE_CODE (node));
len = TREE_CODE_LENGTH (TREE_CODE (node));
for (i = 0; i < len; ++i)
{
newline_and_indent (buffer, 2);

View File

@ -283,7 +283,7 @@ outermost_invariant_loop_expr (tree expr, struct loop *loop)
&& class != tcc_comparison)
return NULL;
nops = first_rtl_op (TREE_CODE (expr));
nops = TREE_CODE_LENGTH (TREE_CODE (expr));
for (i = 0; i < nops; i++)
{
aloop = outermost_invariant_loop_expr (TREE_OPERAND (expr, i), loop);
@ -743,7 +743,7 @@ force_move_till_expr (tree expr, struct loop *orig_loop, struct loop *loop)
&& class != tcc_comparison)
return;
nops = first_rtl_op (TREE_CODE (expr));
nops = TREE_CODE_LENGTH (TREE_CODE (expr));
for (i = 0; i < nops; i++)
force_move_till_expr (TREE_OPERAND (expr, i), orig_loop, loop);
}

View File

@ -1270,7 +1270,7 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
if (!EXPR_P (expr))
return false;
len = first_rtl_op (TREE_CODE (expr));
len = TREE_CODE_LENGTH (TREE_CODE (expr));
for (i = 0; i < len; i++)
if (!expr_invariant_in_loop_p (loop, TREE_OPERAND (expr, i)))
return false;

View File

@ -1734,19 +1734,6 @@ skip_simple_arithmetic (tree expr)
return inner;
}
/* Returns the index of the first non-tree operand for CODE, or the number
of operands if all are trees. */
int
first_rtl_op (enum tree_code code)
{
switch (code)
{
default:
return TREE_CODE_LENGTH (code);
}
}
/* Return which tree structure is used by T. */
enum tree_node_structure_enum
@ -1845,7 +1832,7 @@ contains_placeholder_p (tree exp)
break;
}
switch (first_rtl_op (code))
switch (TREE_CODE_LENGTH (code))
{
case 1:
return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0));
@ -2012,7 +1999,7 @@ substitute_in_expr (tree exp, tree f, tree r)
case tcc_comparison:
case tcc_expression:
case tcc_reference:
switch (first_rtl_op (code))
switch (TREE_CODE_LENGTH (code))
{
case 0:
return exp;
@ -2132,7 +2119,7 @@ substitute_placeholder_in_expr (tree exp, tree obj)
case tcc_expression:
case tcc_reference:
case tcc_statement:
switch (first_rtl_op (code))
switch (TREE_CODE_LENGTH (code))
{
case 0:
return exp;
@ -2508,7 +2495,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
TREE_COMPLEXITY (t) = 0;
TREE_OPERAND (t, 0) = node;
TREE_BLOCK (t) = NULL_TREE;
if (node && !TYPE_P (node) && first_rtl_op (code) != 0)
if (node && !TYPE_P (node) && TREE_CODE_LENGTH (code) != 0)
{
TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node);
TREE_READONLY (t) = TREE_READONLY (node);
@ -2593,7 +2580,7 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
result based on those same flags for the arguments. But if the
arguments aren't really even `tree' expressions, we shouldn't be trying
to do this. */
fro = first_rtl_op (code);
fro = TREE_CODE_LENGTH (code);
/* Expressions without side effects may be constant if their
arguments are as well. */
@ -2630,7 +2617,7 @@ build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
fro = first_rtl_op (code);
fro = TREE_CODE_LENGTH (code);
side_effects = TREE_SIDE_EFFECTS (t);
@ -2679,7 +2666,7 @@ build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
fro = first_rtl_op (code);
fro = TREE_CODE_LENGTH (code);
side_effects = TREE_SIDE_EFFECTS (t);
@ -4196,7 +4183,7 @@ iterative_hash_expr (tree t, hashval_t val)
val = iterative_hash_hashval_t (two, val);
}
else
for (i = first_rtl_op (code) - 1; i >= 0; --i)
for (i = TREE_CODE_LENGTH (code) - 1; i >= 0; --i)
val = iterative_hash_expr (TREE_OPERAND (t, i), val);
}
return val;

View File

@ -3279,11 +3279,6 @@ extern tree save_expr (tree);
extern tree skip_simple_arithmetic (tree);
/* Returns the index of the first non-tree operand for CODE, or the number
of operands if all are trees. */
extern int first_rtl_op (enum tree_code);
/* Return which tree structure is used by T. */
enum tree_node_structure_enum tree_node_structure (tree);