+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):
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;
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;
+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
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
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))
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
}
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++)
{
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;
/* 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++)
{
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))
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;
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
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);
&& 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);
&& 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);
}
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;
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
break;
}
- switch (first_rtl_op (code))
+ switch (TREE_CODE_LENGTH (code))
{
case 1:
return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0));
case tcc_comparison:
case tcc_expression:
case tcc_reference:
- switch (first_rtl_op (code))
+ switch (TREE_CODE_LENGTH (code))
{
case 0:
return exp;
case tcc_expression:
case tcc_reference:
case tcc_statement:
- switch (first_rtl_op (code))
+ switch (TREE_CODE_LENGTH (code))
{
case 0:
return exp;
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);
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. */
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);
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);
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;
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);