summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-07 21:23:10 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-07 21:23:10 +0000
commit651396d6490d06108333425fdd0d43cc31238675 (patch)
treef326960d7493b5dc8cb7ddf3232ed6a0d9281070
parent7fcf593786536c9ce6a574ea12e5a44cfeca19f3 (diff)
downloadgcc-651396d6490d06108333425fdd0d43cc31238675.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91818 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/c-common.c4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/expr.c2
-rw-r--r--gcc/fold-const.c6
-rw-r--r--gcc/print-tree.c2
-rw-r--r--gcc/tree-gimple.c2
-rw-r--r--gcc/tree-inline.c4
-rw-r--r--gcc/tree-pretty-print.c2
-rw-r--r--gcc/tree-ssa-loop-im.c4
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc/tree.c29
-rw-r--r--gcc/tree.h5
14 files changed, 37 insertions, 41 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c9276399fcf..338cc630c5c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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):
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 62aaa27b16b..627911d4b68 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index dd41800eb07..16c854cc1a5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2a1a5b33048..9bf396bf465 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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
diff --git a/gcc/expr.c b/gcc/expr.c
index 44b3c4a9fdf..d594671658e 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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))
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 8ddb039c52f..878cbd9a2d8 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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;
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 20822af24b1..f47d21ab623 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -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++)
{
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c
index 0d52611f867..e1cbc334c92 100644
--- a/gcc/tree-gimple.c
+++ b/gcc/tree-gimple.c
@@ -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))
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 218764996f0..0c72fe662e5 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index e1e0c63db50..ce19f5fcf89 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -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);
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index a53fd53a209..16e477c9cc5 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -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);
}
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index a08923b9636..8727db86314 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -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;
diff --git a/gcc/tree.c b/gcc/tree.c
index 843410bf07b..0ff686cd4af 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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;
diff --git a/gcc/tree.h b/gcc/tree.h
index a6963796c31..aec7b4b99e9 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -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);