{
/* Don't forget to evaluate PRIMOP0 if it has side effects. */
if (TREE_SIDE_EFFECTS (primop0))
- return build (COMPOUND_EXPR, TREE_TYPE (val), primop0, val);
+ return build2 (COMPOUND_EXPR, TREE_TYPE (val), primop0, val);
return val;
}
{
/* Don't forget to evaluate PRIMOP0 if it has side effects. */
if (TREE_SIDE_EFFECTS (primop0))
- return build (COMPOUND_EXPR, TREE_TYPE (value),
- primop0, value);
+ return build2 (COMPOUND_EXPR, TREE_TYPE (value),
+ primop0, value);
return value;
}
}
convert (TREE_TYPE (intop), size_exp), 1));
/* Create the sum or difference. */
- return fold (build (resultcode, result_type, ptrop, intop));
+ return fold (build2 (resultcode, result_type, ptrop, intop));
}
\f
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
break;
if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
- return build (COMPOUND_EXPR, truthvalue_type_node,
- TREE_OPERAND (expr, 0), truthvalue_true_node);
+ return build2 (COMPOUND_EXPR, truthvalue_type_node,
+ TREE_OPERAND (expr, 0), truthvalue_true_node);
else
return truthvalue_true_node;
}
/* These don't change whether an object is zero or nonzero, but
we can't ignore them if their second arg has side-effects. */
if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
- return build (COMPOUND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 1),
- lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)));
+ return build2 (COMPOUND_EXPR, truthvalue_type_node,
+ TREE_OPERAND (expr, 1),
+ lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)));
else
return lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0));
case COND_EXPR:
/* Distribute the conversion into the arms of a COND_EXPR. */
- return fold (build (COND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 0),
+ return fold (build3 (COND_EXPR, truthvalue_type_node,
+ TREE_OPERAND (expr, 0),
lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 1)),
lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 2))));
switch (code)
{
case PREINCREMENT_EXPR:
- val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
+ val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
break;
case POSTINCREMENT_EXPR:
- val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
+ val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
arg = save_expr (arg);
- val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
- val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
break;
case PREDECREMENT_EXPR:
- val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, invert_truthvalue (arg));
+ val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg,
+ invert_truthvalue (arg));
break;
case POSTDECREMENT_EXPR:
- val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, invert_truthvalue (arg));
+ val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg,
+ invert_truthvalue (arg));
arg = save_expr (arg);
- val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
- val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
break;
default:
abort ();
if (TREE_CODE (exp) == COMPOUND_EXPR)
{
tree op1 = default_conversion (TREE_OPERAND (exp, 1));
- return build (COMPOUND_EXPR, TREE_TYPE (op1),
- TREE_OPERAND (exp, 0), op1);
+ return build2 (COMPOUND_EXPR, TREE_TYPE (op1),
+ TREE_OPERAND (exp, 0), op1);
}
lvalue_array_p = !not_lvalue && lvalue_p (exp);
case COMPOUND_EXPR:
{
tree value = build_component_ref (TREE_OPERAND (datum, 1), component);
- return build (COMPOUND_EXPR, TREE_TYPE (value),
- TREE_OPERAND (datum, 0), non_lvalue (value));
+ return build2 (COMPOUND_EXPR, TREE_TYPE (value),
+ TREE_OPERAND (datum, 0), non_lvalue (value));
}
default:
break;
if (TREE_TYPE (subdatum) == error_mark_node)
return error_mark_node;
- ref = build (COMPONENT_REF, TREE_TYPE (subdatum), datum, subdatum,
- NULL_TREE);
+ ref = build3 (COMPONENT_REF, TREE_TYPE (subdatum), datum, subdatum,
+ NULL_TREE);
if (TREE_READONLY (datum) || TREE_READONLY (subdatum))
TREE_READONLY (ref) = 1;
if (TREE_THIS_VOLATILE (datum) || TREE_THIS_VOLATILE (subdatum))
}
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
- rval = build (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE);
+ rval = build4 (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE);
/* Array ref is const/volatile if the array elements are
or if the array is. */
TREE_READONLY (rval)
else
rhs = fold (build1 (NOP_EXPR, return_type, integer_zero_node));
- return build (COMPOUND_EXPR, return_type, trap, rhs);
+ return build2 (COMPOUND_EXPR, return_type, trap, rhs);
}
}
check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params);
- result = build (CALL_EXPR, TREE_TYPE (fntype),
- function, coerced_params, NULL_TREE);
+ result = build3 (CALL_EXPR, TREE_TYPE (fntype),
+ function, coerced_params, NULL_TREE);
TREE_SIDE_EFFECTS (result) = 1;
if (require_constant_value)
op1 = c_size_in_bytes (target_type);
/* Divide by the size, in easiest possible way. */
- return fold (build (EXACT_DIV_EXPR, restype, op0, convert (restype, op1)));
+ return fold (build2 (EXACT_DIV_EXPR, restype, op0, convert (restype, op1)));
}
\f
/* Construct and perhaps optimize a tree representation
arg = stabilize_reference (arg);
real = build_unary_op (REALPART_EXPR, arg, 1);
imag = build_unary_op (IMAGPART_EXPR, arg, 1);
- return build (COMPLEX_EXPR, TREE_TYPE (arg),
- build_unary_op (code, real, 1), imag);
+ return build2 (COMPLEX_EXPR, TREE_TYPE (arg),
+ build_unary_op (code, real, 1), imag);
}
/* Report invalid types. */
if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE)
val = boolean_increment (code, arg);
else
- val = build (code, TREE_TYPE (arg), arg, inc);
+ val = build2 (code, TREE_TYPE (arg), arg, inc);
TREE_SIDE_EFFECTS (val) = 1;
val = convert (result_type, val);
if (TREE_CODE (val) != code)
return error_mark_node;
}
- addr = fold (build (PLUS_EXPR, argtype,
- convert (argtype, addr),
- convert (argtype, byte_position (field))));
+ addr = fold (build2 (PLUS_EXPR, argtype,
+ convert (argtype, addr),
+ convert (argtype, byte_position (field))));
}
else
addr = build1 (code, argtype, arg);
if (TREE_CODE (ifexp) == INTEGER_CST)
return non_lvalue (integer_zerop (ifexp) ? op2 : op1);
- return fold (build (COND_EXPR, result_type, ifexp, op1, op2));
+ return fold (build3 (COND_EXPR, result_type, ifexp, op1, op2));
}
\f
/* Return a compound expression that performs two expressions and
else if (warn_unused_value)
warn_if_unused_value (expr1, input_location);
- return build (COMPOUND_EXPR, TREE_TYPE (expr2), expr1, expr2);
+ return build2 (COMPOUND_EXPR, TREE_TYPE (expr2), expr1, expr2);
}
/* Build an expression representing a cast to type TYPE of expression EXPR. */
/* Scan operands */
- result = build (MODIFY_EXPR, lhstype, lhs, newrhs);
+ result = build2 (MODIFY_EXPR, lhstype, lhs, newrhs);
TREE_SIDE_EFFECTS (result) = 1;
/* If we got the LHS in a different type for storing in,
return NULL_TREE;
TREE_USED (decl) = 1;
- return add_stmt (build (GOTO_EXPR, void_type_node, decl));
+ return add_stmt (build1 (GOTO_EXPR, void_type_node, decl));
}
/* Generate a computed goto statement to EXPR. */
if (pedantic)
pedwarn ("ISO C forbids `goto *expr;'");
expr = convert (ptr_type_node, expr);
- return add_stmt (build (GOTO_EXPR, void_type_node, expr));
+ return add_stmt (build1 (GOTO_EXPR, void_type_node, expr));
}
/* Generate a C `return' statement. RETVAL is the expression for what
break;
}
- retval = build (MODIFY_EXPR, TREE_TYPE (res), res, t);
+ retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t);
}
return add_stmt (build_stmt (RETURN_EXPR, retval));
}
t = build_and_jump (&blab);
- exit = build (COND_EXPR, void_type_node, cond, exit, t);
+ exit = build3 (COND_EXPR, void_type_node, cond, exit, t);
exit = fold (exit);
if (cond_is_first)
SET_EXPR_LOCATION (exit, start_locus);
return NULL_TREE;
}
- return add_stmt (build (GOTO_EXPR, void_type_node, label));
+ return add_stmt (build1 (GOTO_EXPR, void_type_node, label));
}
/* A helper routine for c_process_expr_stmt and c_finish_stmt_expr. */
&& TREE_TYPE (val) == TREE_TYPE (TREE_OPERAND (val, 0)))
val = TREE_OPERAND (val, 0);
- *last_p = build (MODIFY_EXPR, void_type_node, tmp, val);
+ *last_p = build2 (MODIFY_EXPR, void_type_node, tmp, val);
SET_EXPR_LOCUS (*last_p, EXPR_LOCUS (last));
- return build (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE);
+ return build4 (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE);
}
\f
/* Begin and end compound statements. This is as simple as pushing
&& STATEMENT_LIST_STMT_EXPR (cur_stmt_list)
&& TREE_CODE (stmt) != BIND_EXPR)
{
- stmt = build (BIND_EXPR, void_type_node, NULL, stmt, NULL);
+ stmt = build3 (BIND_EXPR, void_type_node, NULL, stmt, NULL);
TREE_SIDE_EFFECTS (stmt) = 1;
}
build_type = result_type;
{
- tree result = build (resultcode, build_type, op0, op1);
+ tree result = build2 (resultcode, build_type, op0, op1);
/* Treat expressions in initializers specially as they can't trap. */
result = require_constant_value ? fold_initializer (result)