case COND_EXPR:
/* Distribute the conversion into the arms of a COND_EXPR. */
- return fold
- (build3 (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0),
- java_truthvalue_conversion (TREE_OPERAND (expr, 1)),
- java_truthvalue_conversion (TREE_OPERAND (expr, 2))));
+ return fold_build3 (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0),
+ java_truthvalue_conversion (TREE_OPERAND (expr, 1)),
+ java_truthvalue_conversion (TREE_OPERAND (expr, 2)));
case NOP_EXPR:
/* If this is widening the argument, we can ignore it. */
/* fall through to default */
default:
- return fold (build2 (NE_EXPR, boolean_type_node,
- expr, boolean_false_node));
+ return fold_build2 (NE_EXPR, boolean_type_node,
+ expr, boolean_false_node);
}
}
{
tree where = lookup_label (target_pc);
tree ret = lookup_label (return_pc);
- tree ret_label = fold (build1 (ADDR_EXPR, return_address_type_node, ret));
+ tree ret_label = fold_build1 (ADDR_EXPR, return_address_type_node, ret);
push_value (ret_label);
flush_quick_stack ();
java_add_stmt (build1 (GOTO_EXPR, void_type_node, where));
tree test;
tree len = convert (unsigned_int_type_node,
build_java_array_length_access (array));
- test = fold (build2 (GE_EXPR, boolean_type_node,
- convert (unsigned_int_type_node, index),
- len));
+ test = fold_build2 (GE_EXPR, boolean_type_node,
+ convert (unsigned_int_type_node, index),
+ len);
if (! integer_zerop (test))
{
throw = build2 (TRUTH_ANDIF_EXPR, int_type_node, test,
lhs_type_node,
index_node);
if (INTEGRAL_TYPE_P (lhs_type_node) && TYPE_PRECISION (lhs_type_node) <= 32)
- load_node = fold (build1 (NOP_EXPR, int_type_node, load_node));
+ load_node = fold_build1 (NOP_EXPR, int_type_node, load_node);
push_value (load_node);
}
flush_quick_stack ();
local_var = find_local_variable (local_var_index, int_type_node, pc);
constant_value = build_int_cst (NULL_TREE, ival);
- res = fold (build2 (PLUS_EXPR, int_type_node, local_var, constant_value));
+ res = fold_build2 (PLUS_EXPR, int_type_node, local_var, constant_value);
java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (local_var), local_var, res));
update_aliases (local_var, local_var_index, pc);
}
case RSHIFT_EXPR:
mask = build_int_cst (NULL_TREE,
TYPE_PRECISION (TREE_TYPE (arg1)) - 1);
- arg2 = fold (build2 (BIT_AND_EXPR, int_type_node, arg2, mask));
+ arg2 = fold_build2 (BIT_AND_EXPR, int_type_node, arg2, mask);
break;
case COMPARE_L_EXPR: /* arg1 > arg2 ? 1 : arg1 == arg2 ? 0 : -1 */
case COMPARE_G_EXPR: /* arg1 < arg2 ? -1 : arg1 == arg2 ? 0 : 1 */
arg1 = save_expr (arg1); arg2 = save_expr (arg2);
{
- tree ifexp1 = fold (build2 (op == COMPARE_L_EXPR ? GT_EXPR : LT_EXPR,
- boolean_type_node, arg1, arg2));
- tree ifexp2 = fold (build2 (EQ_EXPR, boolean_type_node, arg1, arg2));
- tree second_compare = fold (build3 (COND_EXPR, int_type_node,
- ifexp2, integer_zero_node,
- op == COMPARE_L_EXPR
- ? integer_minus_one_node
- : integer_one_node));
- return fold (build3 (COND_EXPR, int_type_node, ifexp1,
- op == COMPARE_L_EXPR ? integer_one_node
- : integer_minus_one_node,
- second_compare));
+ tree ifexp1 = fold_build2 (op == COMPARE_L_EXPR ? GT_EXPR : LT_EXPR,
+ boolean_type_node, arg1, arg2);
+ tree ifexp2 = fold_build2 (EQ_EXPR, boolean_type_node, arg1, arg2);
+ tree second_compare = fold_build3 (COND_EXPR, int_type_node,
+ ifexp2, integer_zero_node,
+ op == COMPARE_L_EXPR
+ ? integer_minus_one_node
+ : integer_one_node);
+ return fold_build3 (COND_EXPR, int_type_node, ifexp1,
+ op == COMPARE_L_EXPR ? integer_one_node
+ : integer_minus_one_node,
+ second_compare);
}
case COMPARE_EXPR:
arg1 = save_expr (arg1); arg2 = save_expr (arg2);
{
- tree ifexp1 = fold (build2 (LT_EXPR, boolean_type_node, arg1, arg2));
- tree ifexp2 = fold (build2 (GT_EXPR, boolean_type_node, arg1, arg2));
- tree second_compare = fold (build3 (COND_EXPR, int_type_node,
- ifexp2, integer_one_node,
- integer_zero_node));
- return fold (build3 (COND_EXPR, int_type_node,
- ifexp1, integer_minus_one_node, second_compare));
+ tree ifexp1 = fold_build2 (LT_EXPR, boolean_type_node, arg1, arg2);
+ tree ifexp2 = fold_build2 (GT_EXPR, boolean_type_node, arg1, arg2);
+ tree second_compare = fold_build3 (COND_EXPR, int_type_node,
+ ifexp2, integer_one_node,
+ integer_zero_node);
+ return fold_build3 (COND_EXPR, int_type_node,
+ ifexp1, integer_minus_one_node, second_compare);
}
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
break;
default: ;
}
- return fold (build2 (op, type, arg1, arg2));
+ return fold_build2 (op, type, arg1, arg2);
}
static void
tree base_type = promote_type (base_class);
if (base_type != TREE_TYPE (self_value))
- self_value = fold (build1 (NOP_EXPR, base_type, self_value));
+ self_value = fold_build1 (NOP_EXPR, base_type, self_value);
if (! flag_syntax_only && flag_indirect_dispatch)
{
tree otable_index
field_offset = fold (convert (sizetype, field_offset));
address
- = fold (build2 (PLUS_EXPR,
- build_pointer_type (TREE_TYPE (field_decl)),
- self_value, field_offset));
- return fold (build1 (INDIRECT_REF, TREE_TYPE (field_decl), address));
+ = fold_build2 (PLUS_EXPR,
+ build_pointer_type (TREE_TYPE (field_decl)),
+ self_value, field_offset);
+ return fold_build1 (INDIRECT_REF, TREE_TYPE (field_decl), address);
}
self_value = build_java_indirect_ref (TREE_TYPE (TREE_TYPE (self_value)),
self_value, check);
- return fold (build3 (COMPONENT_REF, TREE_TYPE (field_decl),
- self_value, field_decl, NULL_TREE));
+ return fold_build3 (COMPONENT_REF, TREE_TYPE (field_decl),
+ self_value, field_decl, NULL_TREE);
}
}
int target_pc)
{
tree target = lookup_label (target_pc);
- tree cond = fold (build2 (condition, boolean_type_node, value1, value2));
+ tree cond = fold_build2 (condition, boolean_type_node, value1, value2);
java_add_stmt
(build3 (COND_EXPR, void_type_node, java_truthvalue_conversion (cond),
build1 (GOTO_EXPR, void_type_node, target),
method_index++;
}
method_index *= int_size_in_bytes (method_type_node);
- ref = fold (build2 (PLUS_EXPR, method_ptr_type_node,
- ref, build_int_cst (NULL_TREE, method_index)));
+ ref = fold_build2 (PLUS_EXPR, method_ptr_type_node,
+ ref, build_int_cst (NULL_TREE, method_index));
ref = build1 (INDIRECT_REF, method_type_node, ref);
func = build3 (COMPONENT_REF, nativecode_ptr_type_node,
ref, lookup_field (&method_type_node, ncode_ident),
size_int (TARGET_VTABLE_USES_DESCRIPTORS));
}
- func = fold (build2 (PLUS_EXPR, nativecode_ptr_ptr_type_node, dtable,
- convert (nativecode_ptr_ptr_type_node, method_index)));
+ func = fold_build2 (PLUS_EXPR, nativecode_ptr_ptr_type_node, dtable,
+ convert (nativecode_ptr_ptr_type_node, method_index));
if (TARGET_VTABLE_USES_DESCRIPTORS)
func = build1 (NOP_EXPR, nativecode_ptr_type_node, func);
}
#define UNOP(OPERAND_TYPE, OPERAND_VALUE) \
- push_value (fold (build1 (NEGATE_EXPR, OPERAND_TYPE##_type_node, \
- pop_value (OPERAND_TYPE##_type_node))));
+ push_value (fold_build1 (NEGATE_EXPR, OPERAND_TYPE##_type_node, \
+ pop_value (OPERAND_TYPE##_type_node)));
#define CONVERT2(FROM_TYPE, TO_TYPE) \
{ \
tree result;
expr = save_expr (expr);
- result = fold (build3 (COND_EXPR, type,
- fold (build2 (NE_EXPR, boolean_type_node, expr, expr)),
+ result = fold_build3 (COND_EXPR, type,
+ fold_build2 (NE_EXPR, boolean_type_node, expr, expr),
convert (type, integer_zero_node),
- convert_to_integer (type, expr)));
+ convert_to_integer (type, expr));
- result = fold (build3 (COND_EXPR, type,
- fold (build2 (LE_EXPR, boolean_type_node, expr,
- convert (TREE_TYPE (expr),
- TYPE_MIN_VALUE (type)))),
- TYPE_MIN_VALUE (type),
- result));
+ result = fold_build3 (COND_EXPR, type,
+ fold_build2 (LE_EXPR, boolean_type_node, expr,
+ convert (TREE_TYPE (expr),
+ TYPE_MIN_VALUE (type))),
+ TYPE_MIN_VALUE (type),
+ result);
- result = fold (build3 (COND_EXPR, type,
- fold (build2 (GE_EXPR, boolean_type_node, expr,
- convert (TREE_TYPE (expr),
- TYPE_MAX_VALUE (type)))),
- TYPE_MAX_VALUE (type),
- result));
+ result = fold_build3 (COND_EXPR, type,
+ fold_build2 (GE_EXPR, boolean_type_node, expr,
+ convert (TREE_TYPE (expr),
+ TYPE_MAX_VALUE (type))),
+ TYPE_MAX_VALUE (type),
+ result);
return result;
}
&& ! flag_emit_class_files))
&& TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
&& TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
- return fold (convert_ieee_real_to_integer (type, expr));
+ return convert_ieee_real_to_integer (type, expr);
else
{
/* fold very helpfully sets the overflow status if a type