summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-15 02:24:41 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-15 02:24:41 +0000
commit14ae0310f6eb334b3aaebf166802383cee797990 (patch)
treeebacdfeed0851e1d26ae03ca28fdcefe93df6304 /gcc/c-common.c
parent2ef0f9fa590ffb267b6ac9dcc55fdbc76edea9f3 (diff)
downloadgcc-14ae0310f6eb334b3aaebf166802383cee797990.tar.gz
* c-common.c (shorten_compare, pointer_int_sum,
c_common_truthvalue_conversion, boolean_increment): Replace calls to build with calls to buildN. * c-decl.c (complete_array_type, grokdeclarator): Likewise. * c-gimplify.c (c_build_bind_expr, gimplify_c_loop, gimplify_switch_stmt): Likewise. * c-typeck.c (default_function_array_conversion, build_component_ref, build_array_ref, build_function_call, pointer_diff, build_unary_op, build_conditional_expr, build_compound_expr, build_modify_expr, c_finish_goto_label, c_finish_goto_ptr, c_finish_return, c_finish_loop, c_finish_bc_stmt, c_finish_stmt_expr, c_end_compound_stmt, build_binary_op): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86018 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 1416871cdac..b4c914b4650 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2114,7 +2114,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
{
/* 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;
}
@@ -2198,8 +2198,8 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
{
/* 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;
}
}
@@ -2294,7 +2294,7 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
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));
}
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
@@ -2360,8 +2360,8 @@ c_common_truthvalue_conversion (tree 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;
}
@@ -2384,14 +2384,16 @@ c_common_truthvalue_conversion (tree expr)
/* 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))));
@@ -3855,22 +3857,24 @@ boolean_increment (enum tree_code code, tree arg)
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 ();