aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-02-16 23:40:52 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-02-16 23:40:52 +0000
commit9f3432b8a677aa18c1e12cdd9604f533b0745e2c (patch)
treef2b1452445646bd9dfaa1a7a6c7e058bcdedd189 /gcc/ada/utils.c
parent599b39ce9dcaba10e1c53934e50cca5f671a7f6e (diff)
downloadgcc-9f3432b8a677aa18c1e12cdd9604f533b0745e2c.zip
gcc-9f3432b8a677aa18c1e12cdd9604f533b0745e2c.tar.gz
gcc-9f3432b8a677aa18c1e12cdd9604f533b0745e2c.tar.bz2
trans.c (call_to_gnu): Use build_call_list instead of build3 to build the call expression.
* trans.c (call_to_gnu): Use build_call_list instead of build3 to build the call expression. (gnat_stabilize_reference_1): Handle tcc_vl_exp. * utils.c (max_size) <tcc_exceptional>: Delete. <tcc_vl_exp>: New case. <tcc_expression>: Delete CALL_EXPR subcase. (build_global_cdtor): Use build_call_nary instead of build3. * utils2.c (build_call_1_expr): Likewise. (build_call_2_expr): Likewise. (build_call_0_expr): Likewise. (build_call_alloc_dealloc): Likewise. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r122058
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 52bc663..6dc47de 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2335,12 +2335,18 @@ max_size (tree exp, bool max_p)
case tcc_constant:
return exp;
- case tcc_exceptional:
- if (code == TREE_LIST)
- return tree_cons (TREE_PURPOSE (exp),
- max_size (TREE_VALUE (exp), max_p),
- TREE_CHAIN (exp)
- ? max_size (TREE_CHAIN (exp), max_p) : NULL_TREE);
+ case tcc_vl_exp:
+ if (code == CALL_EXPR)
+ {
+ tree *argarray;
+ int i, n = call_expr_nargs (exp);
+ gcc_assert (n > 0);
+
+ argarray = (tree *) alloca (n * sizeof (tree));
+ for (i = 0; i < n; i++)
+ argarray[i] = max_size (CALL_EXPR_ARG (exp, i), max_p);
+ return build_call_array (type, CALL_EXPR_FN (exp), n, argarray);
+ }
break;
case tcc_reference:
@@ -2428,9 +2434,6 @@ max_size (tree exp, bool max_p)
return fold (build2 (max_p ? MAX_EXPR : MIN_EXPR, type,
max_size (TREE_OPERAND (exp, 1), max_p),
max_size (TREE_OPERAND (exp, 2), max_p)));
- else if (code == CALL_EXPR && TREE_OPERAND (exp, 1))
- return build3 (CALL_EXPR, type, TREE_OPERAND (exp, 0),
- max_size (TREE_OPERAND (exp, 1), max_p), NULL);
}
/* Other tree classes cannot happen. */
@@ -3745,8 +3748,7 @@ build_global_cdtor (int method_type, tree *vec, int len)
{
tree fntype = TREE_TYPE (vec[i]);
tree fnaddr = build1 (ADDR_EXPR, build_pointer_type (fntype), vec[i]);
- tree fncall = build3 (CALL_EXPR, TREE_TYPE (fntype), fnaddr, NULL_TREE,
- NULL_TREE);
+ tree fncall = build_call_nary (TREE_TYPE (fntype), fnaddr, 0);
append_to_statement_list (fncall, &body);
}