Commit 86aed40b by Richard Stallman

(simple_cst_equal): New default case handles most tree codes based on TREE_CODE_CLASS.

(simple_cst_equal): New default case handles most
tree codes based on TREE_CODE_CLASS.  Delete newly redundant cases
for specific tree codes.

From-SVN: r3559
parent ac4b1974
...@@ -2587,42 +2587,36 @@ simple_cst_equal (t1, t2) ...@@ -2587,42 +2587,36 @@ simple_cst_equal (t1, t2)
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)); return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
return 0; return 0;
case BIT_FIELD_REF:
return (simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0))
&& simple_cst_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1))
&& simple_cst_equal (TREE_OPERAND (t1, 2), TREE_OPERAND (t2, 2)));
case VAR_DECL: case VAR_DECL:
case PARM_DECL: case PARM_DECL:
case CONST_DECL: case CONST_DECL:
case FUNCTION_DECL: case FUNCTION_DECL:
return 0; return 0;
}
case PLUS_EXPR: /* This general rule works for most tree codes.
case MINUS_EXPR: All exceptions should be handled above. */
case MULT_EXPR:
case TRUNC_DIV_EXPR: switch (TREE_CODE_CLASS (code1))
case TRUNC_MOD_EXPR: {
case LSHIFT_EXPR: int i;
case RSHIFT_EXPR: case '1':
cmp = simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)); case '2':
case '<':
case 'e':
case 'r':
case 's':
cmp = 1;
for (i=0; i<tree_code_length[(int) code1]; ++i)
{
cmp = simple_cst_equal (TREE_OPERAND (t1, i), TREE_OPERAND (t2, i));
if (cmp <= 0) if (cmp <= 0)
return cmp; return cmp;
return simple_cst_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1)); }
return cmp;
case NEGATE_EXPR: }
case ADDR_EXPR:
case REFERENCE_EXPR:
case INDIRECT_REF:
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
default:
#if 0
return lang_simple_cst_equal (t1, t2);
#else
return -1; return -1;
#endif
}
} }
/* Constructors for pointer, array and function types. /* Constructors for pointer, array and function types.
...@@ -2896,10 +2890,9 @@ build_method_type (basetype, type) ...@@ -2896,10 +2890,9 @@ build_method_type (basetype, type)
return t; return t;
} }
/* Construct, lay out and return the type of methods belonging to class /* Construct, lay out and return the type of offsets to a value
BASETYPE and whose arguments and values are described by TYPE. of type TYPE, within an object of type BASETYPE.
If that type exists already, reuse it. If a suitable offset type exists already, reuse it. */
TYPE must be a FUNCTION_TYPE node. */
tree tree
build_offset_type (basetype, type) build_offset_type (basetype, type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment