Commit dddf8120 by Eric Botcazou Committed by Eric Botcazou

gigi.h (build_call_0_expr): Delete.

	* gcc-interface/gigi.h (build_call_0_expr): Delete.
	(build_call_1_expr): Likewise.
	(build_call_2_expr): Likewise.
	(build_call_n_expr): New prototype.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Use build_call_n_expr.
	* gcc-interface/trans.c (establish_gnat_vms_condition_handler): Ditto.
	(Handled_Sequence_Of_Statements_to_gnu): Likewise.
	(Exception_Handler_to_gnu_zcx): Likewise.
	(gnat_to_gnu): Likewise.
	(build_binary_op_trapv): Likewise.
	* gcc-interface/utils2.c (build_call_0_expr): Delete.
	(build_call_1_expr): Likewise.
	(build_call_2_expr): Likewise.
	(build_call_n_expr): New function.
	(build_call_raise): Use build_call_n_expr.
	(build_call_raise_range): Likewise.
	(build_call_raise_column): Likewise.
	(build_call_alloc_dealloc_proc): Likewise.
	(maybe_wrap_malloc): Likewise.
	(maybe_wrap_free): Likewise.

From-SVN: r178762
parent d8e38554
2011-09-11 Eric Botcazou <ebotcazou@adacore.com> 2011-09-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (build_call_0_expr): Delete.
(build_call_1_expr): Likewise.
(build_call_2_expr): Likewise.
(build_call_n_expr): New prototype.
* gcc-interface/decl.c (gnat_to_gnu_entity): Use build_call_n_expr.
* gcc-interface/trans.c (establish_gnat_vms_condition_handler): Ditto.
(Handled_Sequence_Of_Statements_to_gnu): Likewise.
(Exception_Handler_to_gnu_zcx): Likewise.
(gnat_to_gnu): Likewise.
(build_binary_op_trapv): Likewise.
* gcc-interface/utils2.c (build_call_0_expr): Delete.
(build_call_1_expr): Likewise.
(build_call_2_expr): Likewise.
(build_call_n_expr): New function.
(build_call_raise): Use build_call_n_expr.
(build_call_raise_range): Likewise.
(build_call_raise_column): Likewise.
(build_call_alloc_dealloc_proc): Likewise.
(maybe_wrap_malloc): Likewise.
(maybe_wrap_free): Likewise.
2011-09-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (build_return_expr): Use void_type_node for * gcc-interface/trans.c (build_return_expr): Use void_type_node for
MODIFY_EXPR. MODIFY_EXPR.
* gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Assert that * gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Assert that
......
...@@ -1492,8 +1492,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1492,8 +1492,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|| (flag_stack_check == GENERIC_STACK_CHECK || (flag_stack_check == GENERIC_STACK_CHECK
&& compare_tree_int (DECL_SIZE_UNIT (gnu_decl), && compare_tree_int (DECL_SIZE_UNIT (gnu_decl),
STACK_CHECK_MAX_VAR_SIZE) > 0))) STACK_CHECK_MAX_VAR_SIZE) > 0)))
add_stmt_with_node (build_call_1_expr add_stmt_with_node (build_call_n_expr
(update_setjmp_buf_decl, (update_setjmp_buf_decl, 1,
build_unary_op (ADDR_EXPR, NULL_TREE, build_unary_op (ADDR_EXPR, NULL_TREE,
get_block_jmpbuf_decl ())), get_block_jmpbuf_decl ())),
gnat_entity); gnat_entity);
......
...@@ -813,16 +813,11 @@ extern tree build_cond_expr (tree result_type, tree condition_operand, ...@@ -813,16 +813,11 @@ extern tree build_cond_expr (tree result_type, tree condition_operand,
extern tree build_compound_expr (tree result_type, tree stmt_operand, extern tree build_compound_expr (tree result_type, tree stmt_operand,
tree expr_operand); tree expr_operand);
/* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return /* Conveniently construct a function call expression. FNDECL names the
the CALL_EXPR. */ function to be called, N is the number of arguments, and the "..."
extern tree build_call_1_expr (tree fundecl, tree arg); parameters are the argument expressions. Unlike build_call_expr
this doesn't fold the call, hence it will always return a CALL_EXPR. */
/* Build a CALL_EXPR to call FUNDECL with two argument, ARG1 & ARG2. Return extern tree build_call_n_expr (tree fndecl, int n, ...);
the CALL_EXPR. */
extern tree build_call_2_expr (tree fundecl, tree arg1, tree arg2);
/* Likewise to call FUNDECL with no arguments. */
extern tree build_call_0_expr (tree fundecl);
/* Call a function that raises an exception and pass the line number and file /* Call a function that raises an exception and pass the line number and file
name, if requested. MSG says which exception function to call. name, if requested. MSG says which exception function to call.
......
...@@ -2444,7 +2444,7 @@ establish_gnat_vms_condition_handler (void) ...@@ -2444,7 +2444,7 @@ establish_gnat_vms_condition_handler (void)
return; return;
establish_stmt establish_stmt
= build_call_1_expr (vms_builtin_establish_handler_decl, = build_call_n_expr (vms_builtin_establish_handler_decl, 1,
build_unary_op build_unary_op
(ADDR_EXPR, NULL_TREE, (ADDR_EXPR, NULL_TREE,
gnat_vms_condition_handler_decl)); gnat_vms_condition_handler_decl));
...@@ -3528,11 +3528,11 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3528,11 +3528,11 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
the setjmp buf known for any decls in this block. */ the setjmp buf known for any decls in this block. */
if (setjmp_longjmp) if (setjmp_longjmp)
{ {
gnu_jmpsave_decl = create_var_decl (get_identifier ("JMPBUF_SAVE"), gnu_jmpsave_decl
NULL_TREE, jmpbuf_ptr_type, = create_var_decl (get_identifier ("JMPBUF_SAVE"), NULL_TREE,
build_call_0_expr (get_jmpbuf_decl), jmpbuf_ptr_type,
false, false, false, false, build_call_n_expr (get_jmpbuf_decl, 0),
NULL, gnat_node); false, false, false, false, NULL, gnat_node);
DECL_ARTIFICIAL (gnu_jmpsave_decl) = 1; DECL_ARTIFICIAL (gnu_jmpsave_decl) = 1;
/* The __builtin_setjmp receivers will immediately reinstall it. Now /* The __builtin_setjmp receivers will immediately reinstall it. Now
...@@ -3540,16 +3540,17 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3540,16 +3540,17 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
might be forward edges going to __builtin_setjmp receivers on which might be forward edges going to __builtin_setjmp receivers on which
it is uninitialized, although they will never be actually taken. */ it is uninitialized, although they will never be actually taken. */
TREE_NO_WARNING (gnu_jmpsave_decl) = 1; TREE_NO_WARNING (gnu_jmpsave_decl) = 1;
gnu_jmpbuf_decl = create_var_decl (get_identifier ("JMP_BUF"), gnu_jmpbuf_decl
NULL_TREE, jmpbuf_type, NULL_TREE, = create_var_decl (get_identifier ("JMP_BUF"), NULL_TREE,
false, false, false, false, jmpbuf_type,
NULL, gnat_node); NULL_TREE,
false, false, false, false, NULL, gnat_node);
DECL_ARTIFICIAL (gnu_jmpbuf_decl) = 1; DECL_ARTIFICIAL (gnu_jmpbuf_decl) = 1;
set_block_jmpbuf_decl (gnu_jmpbuf_decl); set_block_jmpbuf_decl (gnu_jmpbuf_decl);
/* When we exit this block, restore the saved value. */ /* When we exit this block, restore the saved value. */
add_cleanup (build_call_1_expr (set_jmpbuf_decl, gnu_jmpsave_decl), add_cleanup (build_call_n_expr (set_jmpbuf_decl, 1, gnu_jmpsave_decl),
End_Label (gnat_node)); End_Label (gnat_node));
} }
...@@ -3557,7 +3558,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3557,7 +3558,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
to the binding level we made above. Note that add_cleanup is FIFO to the binding level we made above. Note that add_cleanup is FIFO
so we must register this cleanup after the EH cleanup just above. */ so we must register this cleanup after the EH cleanup just above. */
if (at_end) if (at_end)
add_cleanup (build_call_0_expr (gnat_to_gnu (At_End_Proc (gnat_node))), add_cleanup (build_call_n_expr (gnat_to_gnu (At_End_Proc (gnat_node)), 0),
End_Label (gnat_node)); End_Label (gnat_node));
/* Now build the tree for the declarations and statements inside this block. /* Now build the tree for the declarations and statements inside this block.
...@@ -3565,7 +3566,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3565,7 +3566,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
start_stmt_group (); start_stmt_group ();
if (setjmp_longjmp) if (setjmp_longjmp)
add_stmt (build_call_1_expr (set_jmpbuf_decl, add_stmt (build_call_n_expr (set_jmpbuf_decl, 1,
build_unary_op (ADDR_EXPR, NULL_TREE, build_unary_op (ADDR_EXPR, NULL_TREE,
gnu_jmpbuf_decl))); gnu_jmpbuf_decl)));
...@@ -3596,7 +3597,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3596,7 +3597,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
VEC_safe_push (tree, gc, gnu_except_ptr_stack, VEC_safe_push (tree, gc, gnu_except_ptr_stack,
create_var_decl (get_identifier ("EXCEPT_PTR"), NULL_TREE, create_var_decl (get_identifier ("EXCEPT_PTR"), NULL_TREE,
build_pointer_type (except_type_node), build_pointer_type (except_type_node),
build_call_0_expr (get_excptr_decl), build_call_n_expr (get_excptr_decl, 0),
false, false, false, false, false, false, false, false,
NULL, gnat_node)); NULL, gnat_node));
...@@ -3621,7 +3622,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3621,7 +3622,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
/* If none of the exception handlers did anything, re-raise but do not /* If none of the exception handlers did anything, re-raise but do not
defer abortion. */ defer abortion. */
gnu_expr = build_call_1_expr (raise_nodefer_decl, gnu_expr = build_call_n_expr (raise_nodefer_decl, 1,
VEC_last (tree, gnu_except_ptr_stack)); VEC_last (tree, gnu_except_ptr_stack));
set_expr_location_from_node set_expr_location_from_node
(gnu_expr, (gnu_expr,
...@@ -3641,7 +3642,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3641,7 +3642,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
/* If the setjmp returns 1, we restore our incoming longjmp value and /* If the setjmp returns 1, we restore our incoming longjmp value and
then check the handlers. */ then check the handlers. */
start_stmt_group (); start_stmt_group ();
add_stmt_with_node (build_call_1_expr (set_jmpbuf_decl, add_stmt_with_node (build_call_n_expr (set_jmpbuf_decl, 1,
gnu_jmpsave_decl), gnu_jmpsave_decl),
gnat_node); gnat_node);
add_stmt (gnu_handler); add_stmt (gnu_handler);
...@@ -3649,8 +3650,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) ...@@ -3649,8 +3650,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
/* This block is now "if (setjmp) ... <handlers> else <block>". */ /* This block is now "if (setjmp) ... <handlers> else <block>". */
gnu_result = build3 (COND_EXPR, void_type_node, gnu_result = build3 (COND_EXPR, void_type_node,
(build_call_1_expr (build_call_n_expr
(setjmp_decl, (setjmp_decl, 1,
build_unary_op (ADDR_EXPR, NULL_TREE, build_unary_op (ADDR_EXPR, NULL_TREE,
gnu_jmpbuf_decl))), gnu_jmpbuf_decl))),
gnu_handler, gnu_inner_block); gnu_handler, gnu_inner_block);
...@@ -3861,11 +3862,11 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) ...@@ -3861,11 +3862,11 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node)
false, false, false, false, false, false, false, false,
NULL, gnat_node); NULL, gnat_node);
add_stmt_with_node (build_call_1_expr (begin_handler_decl, add_stmt_with_node (build_call_n_expr (begin_handler_decl, 1,
gnu_incoming_exc_ptr), gnu_incoming_exc_ptr),
gnat_node); gnat_node);
/* ??? We don't seem to have an End_Label at hand to set the location. */ /* ??? We don't seem to have an End_Label at hand to set the location. */
add_cleanup (build_call_1_expr (end_handler_decl, gnu_incoming_exc_ptr), add_cleanup (build_call_n_expr (end_handler_decl, 1, gnu_incoming_exc_ptr),
Empty); Empty);
add_stmt_list (Statements (gnat_node)); add_stmt_list (Statements (gnat_node));
gnat_poplevel (); gnat_poplevel ();
...@@ -5496,7 +5497,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5496,7 +5497,7 @@ gnat_to_gnu (Node_Id gnat_node)
add_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_incoming_exc_ptr, add_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_incoming_exc_ptr,
convert (ptr_type_node, integer_zero_node))); convert (ptr_type_node, integer_zero_node)));
add_stmt (build_call_1_expr (reraise_zcx_decl, gnu_expr)); add_stmt (build_call_n_expr (reraise_zcx_decl, 1, gnu_expr));
gnat_poplevel (); gnat_poplevel ();
gnu_result = end_stmt_group (); gnu_result = end_stmt_group ();
break; break;
...@@ -6976,7 +6977,7 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6976,7 +6977,7 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
{ {
tree int_64 = gnat_type_for_size (64, 0); tree int_64 = gnat_type_for_size (64, 0);
return convert (gnu_type, build_call_2_expr (mulv64_decl, return convert (gnu_type, build_call_n_expr (mulv64_decl, 2,
convert (int_64, lhs), convert (int_64, lhs),
convert (int_64, rhs))); convert (int_64, rhs)));
} }
......
...@@ -1409,43 +1409,22 @@ build_compound_expr (tree result_type, tree stmt_operand, tree expr_operand) ...@@ -1409,43 +1409,22 @@ build_compound_expr (tree result_type, tree stmt_operand, tree expr_operand)
return result; return result;
} }
/* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return /* Conveniently construct a function call expression. FNDECL names the
the CALL_EXPR. */ function to be called, N is the number of arguments, and the "..."
parameters are the argument expressions. Unlike build_call_expr
this doesn't fold the call, hence it will always return a CALL_EXPR. */
tree tree
build_call_1_expr (tree fundecl, tree arg) build_call_n_expr (tree fndecl, int n, ...)
{ {
tree call = build_call_nary (TREE_TYPE (TREE_TYPE (fundecl)), va_list ap;
build_unary_op (ADDR_EXPR, NULL_TREE, fundecl), tree fntype = TREE_TYPE (fndecl);
1, arg); tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
TREE_SIDE_EFFECTS (call) = 1;
return call; va_start (ap, n);
} fn = build_call_valist (TREE_TYPE (fntype), fn, n, ap);
va_end (ap);
/* Build a CALL_EXPR to call FUNDECL with two arguments, ARG1 & ARG2. Return return fn;
the CALL_EXPR. */
tree
build_call_2_expr (tree fundecl, tree arg1, tree arg2)
{
tree call = build_call_nary (TREE_TYPE (TREE_TYPE (fundecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fundecl),
2, arg1, arg2);
TREE_SIDE_EFFECTS (call) = 1;
return call;
}
/* Likewise to call FUNDECL with no arguments. */
tree
build_call_0_expr (tree fundecl)
{
/* We rely on build_call_nary to compute TREE_SIDE_EFFECTS. This makes
it possible to propagate DECL_IS_PURE on parameterless functions. */
tree call = build_call_nary (TREE_TYPE (TREE_TYPE (fundecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fundecl),
0);
return call;
} }
/* Call a function that raises an exception and pass the line number and file /* Call a function that raises an exception and pass the line number and file
...@@ -1483,7 +1462,7 @@ build_call_raise (int msg, Node_Id gnat_node, char kind) ...@@ -1483,7 +1462,7 @@ build_call_raise (int msg, Node_Id gnat_node, char kind)
tree gnu_exception_entity tree gnu_exception_entity
= gnat_to_gnu_entity (Get_RT_Exception_Entity (msg), NULL_TREE, 0); = gnat_to_gnu_entity (Get_RT_Exception_Entity (msg), NULL_TREE, 0);
tree gnu_call tree gnu_call
= build_call_1_expr (gnu_local_raise, = build_call_n_expr (gnu_local_raise, 1,
build_unary_op (ADDR_EXPR, NULL_TREE, build_unary_op (ADDR_EXPR, NULL_TREE,
gnu_exception_entity)); gnu_exception_entity));
...@@ -1513,7 +1492,7 @@ build_call_raise (int msg, Node_Id gnat_node, char kind) ...@@ -1513,7 +1492,7 @@ build_call_raise (int msg, Node_Id gnat_node, char kind)
build_index_type (size_int (len))); build_index_type (size_int (len)));
return return
build_call_2_expr (fndecl, build_call_n_expr (fndecl, 2,
build1 (ADDR_EXPR, build1 (ADDR_EXPR,
build_pointer_type (unsigned_char_type_node), build_pointer_type (unsigned_char_type_node),
filename), filename),
...@@ -1528,7 +1507,6 @@ tree ...@@ -1528,7 +1507,6 @@ tree
build_call_raise_range (int msg, Node_Id gnat_node, build_call_raise_range (int msg, Node_Id gnat_node,
tree index, tree first, tree last) tree index, tree first, tree last)
{ {
tree call;
tree fndecl = gnat_raise_decls_ext[msg]; tree fndecl = gnat_raise_decls_ext[msg];
tree filename; tree filename;
int line_number, column_number; int line_number, column_number;
...@@ -1561,19 +1539,16 @@ build_call_raise_range (int msg, Node_Id gnat_node, ...@@ -1561,19 +1539,16 @@ build_call_raise_range (int msg, Node_Id gnat_node,
TREE_TYPE (filename) = build_array_type (unsigned_char_type_node, TREE_TYPE (filename) = build_array_type (unsigned_char_type_node,
build_index_type (size_int (len))); build_index_type (size_int (len)));
call = build_call_nary (TREE_TYPE (TREE_TYPE (fndecl)), return
build_unary_op (ADDR_EXPR, NULL_TREE, fndecl), build_call_n_expr (fndecl, 6,
6, build1 (ADDR_EXPR,
build1 (ADDR_EXPR, build_pointer_type (unsigned_char_type_node),
build_pointer_type (unsigned_char_type_node), filename),
filename), build_int_cst (NULL_TREE, line_number),
build_int_cst (NULL_TREE, line_number), build_int_cst (NULL_TREE, column_number),
build_int_cst (NULL_TREE, column_number), convert (integer_type_node, index),
convert (integer_type_node, index), convert (integer_type_node, first),
convert (integer_type_node, first), convert (integer_type_node, last));
convert (integer_type_node, last));
TREE_SIDE_EFFECTS (call) = 1;
return call;
} }
/* Similar to build_call_raise, with extra information about the column /* Similar to build_call_raise, with extra information about the column
...@@ -1583,7 +1558,6 @@ tree ...@@ -1583,7 +1558,6 @@ tree
build_call_raise_column (int msg, Node_Id gnat_node) build_call_raise_column (int msg, Node_Id gnat_node)
{ {
tree fndecl = gnat_raise_decls_ext[msg]; tree fndecl = gnat_raise_decls_ext[msg];
tree call;
tree filename; tree filename;
int line_number, column_number; int line_number, column_number;
const char *str; const char *str;
...@@ -1615,16 +1589,13 @@ build_call_raise_column (int msg, Node_Id gnat_node) ...@@ -1615,16 +1589,13 @@ build_call_raise_column (int msg, Node_Id gnat_node)
TREE_TYPE (filename) = build_array_type (unsigned_char_type_node, TREE_TYPE (filename) = build_array_type (unsigned_char_type_node,
build_index_type (size_int (len))); build_index_type (size_int (len)));
call = build_call_nary (TREE_TYPE (TREE_TYPE (fndecl)), return
build_unary_op (ADDR_EXPR, NULL_TREE, fndecl), build_call_n_expr (fndecl, 3,
3, build1 (ADDR_EXPR,
build1 (ADDR_EXPR, build_pointer_type (unsigned_char_type_node),
build_pointer_type (unsigned_char_type_node), filename),
filename), build_int_cst (NULL_TREE, line_number),
build_int_cst (NULL_TREE, line_number), build_int_cst (NULL_TREE, column_number));
build_int_cst (NULL_TREE, column_number));
TREE_SIDE_EFFECTS (call) = 1;
return call;
} }
/* qsort comparer for the bit positions of two constructor elements /* qsort comparer for the bit positions of two constructor elements
...@@ -1842,7 +1813,6 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type, ...@@ -1842,7 +1813,6 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type,
Entity_Id gnat_proc, Entity_Id gnat_pool) Entity_Id gnat_proc, Entity_Id gnat_pool)
{ {
tree gnu_proc = gnat_to_gnu (gnat_proc); tree gnu_proc = gnat_to_gnu (gnat_proc);
tree gnu_proc_addr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_proc);
tree gnu_call; tree gnu_call;
/* The storage pools are obviously always tagged types, but the /* The storage pools are obviously always tagged types, but the
...@@ -1866,13 +1836,11 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type, ...@@ -1866,13 +1836,11 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type,
comes the address of the object, for a deallocator, then the comes the address of the object, for a deallocator, then the
size and alignment. */ size and alignment. */
if (gnu_obj) if (gnu_obj)
gnu_call = build_call_nary (TREE_TYPE (TREE_TYPE (gnu_proc)), gnu_call = build_call_n_expr (gnu_proc, 4, gnu_pool_addr, gnu_obj,
gnu_proc_addr, 4, gnu_pool_addr, gnu_size, gnu_align);
gnu_obj, gnu_size, gnu_align);
else else
gnu_call = build_call_nary (TREE_TYPE (TREE_TYPE (gnu_proc)), gnu_call = build_call_n_expr (gnu_proc, 3, gnu_pool_addr,
gnu_proc_addr, 3, gnu_pool_addr, gnu_size, gnu_align);
gnu_size, gnu_align);
} }
/* Secondary stack case. */ /* Secondary stack case. */
...@@ -1888,14 +1856,11 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type, ...@@ -1888,14 +1856,11 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type,
/* The first arg is the address of the object, for a deallocator, /* The first arg is the address of the object, for a deallocator,
then the size. */ then the size. */
if (gnu_obj) if (gnu_obj)
gnu_call = build_call_nary (TREE_TYPE (TREE_TYPE (gnu_proc)), gnu_call = build_call_n_expr (gnu_proc, 2, gnu_obj, gnu_size);
gnu_proc_addr, 2, gnu_obj, gnu_size);
else else
gnu_call = build_call_nary (TREE_TYPE (TREE_TYPE (gnu_proc)), gnu_call = build_call_n_expr (gnu_proc, 1, gnu_size);
gnu_proc_addr, 1, gnu_size);
} }
TREE_SIDE_EFFECTS (gnu_call) = 1;
return gnu_call; return gnu_call;
} }
...@@ -1935,9 +1900,9 @@ maybe_wrap_malloc (tree data_size, tree data_type, Node_Id gnat_node) ...@@ -1935,9 +1900,9 @@ maybe_wrap_malloc (tree data_size, tree data_type, Node_Id gnat_node)
&& Nkind (gnat_node) == N_Allocator && Nkind (gnat_node) == N_Allocator
&& (UI_To_Int (Esize (Etype (gnat_node))) == 32 && (UI_To_Int (Esize (Etype (gnat_node))) == 32
|| Convention (Etype (gnat_node)) == Convention_C)) || Convention (Etype (gnat_node)) == Convention_C))
malloc_ptr = build_call_1_expr (malloc32_decl, size_to_malloc); malloc_ptr = build_call_n_expr (malloc32_decl, 1, size_to_malloc);
else else
malloc_ptr = build_call_1_expr (malloc_decl, size_to_malloc); malloc_ptr = build_call_n_expr (malloc_decl, 1, size_to_malloc);
if (aligning_type) if (aligning_type)
{ {
...@@ -2016,7 +1981,7 @@ maybe_wrap_free (tree data_ptr, tree data_type) ...@@ -2016,7 +1981,7 @@ maybe_wrap_free (tree data_ptr, tree data_type)
else else
free_ptr = data_ptr; free_ptr = data_ptr;
return build_call_1_expr (free_decl, free_ptr); return build_call_n_expr (free_decl, 1, free_ptr);
} }
/* Build a GCC tree to call an allocation or deallocation function. /* Build a GCC tree to call an allocation or deallocation function.
......
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