Commit c787dd82 by Jason Merrill Committed by Jason Merrill

init.c (init_init_processing): Remove BI* handling.

	* init.c (init_init_processing): Remove BI* handling.
	(build_builtin_call): Remove.
	(build_builtin_delete_call): New fn.
	(build_delete): Use it.

From-SVN: r21514
parent acb26b31
1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
* init.c (init_init_processing): Remove BI* handling.
(build_builtin_call): Remove.
(build_builtin_delete_call): New fn.
(build_delete): Use it.
1998-07-31 Mark Mitchell <mark@markmitchell.com> 1998-07-31 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro. * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
......
...@@ -55,7 +55,7 @@ static tree build_vec_delete_1 PROTO((tree, tree, tree, tree, tree, ...@@ -55,7 +55,7 @@ static tree build_vec_delete_1 PROTO((tree, tree, tree, tree, tree,
int)); int));
static void perform_member_init PROTO((tree, tree, tree, int)); static void perform_member_init PROTO((tree, tree, tree, int));
static void sort_base_init PROTO((tree, tree *, tree *)); static void sort_base_init PROTO((tree, tree *, tree *));
static tree build_builtin_call PROTO((tree, tree, tree)); static tree build_builtin_delete_call PROTO((tree));
static tree build_array_eh_cleanup PROTO((tree, tree, tree)); static tree build_array_eh_cleanup PROTO((tree, tree, tree));
static int member_init_ok_or_else PROTO((tree, tree, char *)); static int member_init_ok_or_else PROTO((tree, tree, char *));
static void expand_virtual_init PROTO((tree, tree)); static void expand_virtual_init PROTO((tree, tree));
...@@ -63,9 +63,6 @@ static tree sort_member_init PROTO((tree)); ...@@ -63,9 +63,6 @@ static tree sort_member_init PROTO((tree));
static tree build_partial_cleanup_for PROTO((tree)); static tree build_partial_cleanup_for PROTO((tree));
static tree initializing_context PROTO((tree)); static tree initializing_context PROTO((tree));
/* Cache _builtin_new and _builtin_delete exprs. */
static tree BIN, BID, BIVN, BIVD;
/* Cache the identifier nodes for the magic field of a new cookie. */ /* Cache the identifier nodes for the magic field of a new cookie. */
static tree nc_nelts_field_id; static tree nc_nelts_field_id;
...@@ -80,15 +77,6 @@ void init_init_processing () ...@@ -80,15 +77,6 @@ void init_init_processing ()
{ {
tree fields[1]; tree fields[1];
/* Define implicit `operator new' and `operator delete' functions. */
BIN = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) NEW_EXPR])));
TREE_USED (TREE_OPERAND (BIN, 0)) = 0;
BID = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) DELETE_EXPR])));
TREE_USED (TREE_OPERAND (BID, 0)) = 0;
BIVN = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) VEC_NEW_EXPR])));
TREE_USED (TREE_OPERAND (BIVN, 0)) = 0;
BIVD = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) VEC_DELETE_EXPR])));
TREE_USED (TREE_OPERAND (BIVD, 0)) = 0;
minus_one = build_int_2 (-1, -1); minus_one = build_int_2 (-1, -1);
/* Define the structure that holds header information for /* Define the structure that holds header information for
...@@ -1929,20 +1917,16 @@ decl_constant_value (decl) ...@@ -1929,20 +1917,16 @@ decl_constant_value (decl)
/* Common subroutines of build_new and build_vec_delete. */ /* Common subroutines of build_new and build_vec_delete. */
/* Common interface for calling "builtin" functions that are not /* Call the global __builtin_delete to delete ADDR. */
really builtin. */
static tree static tree
build_builtin_call (type, node, arglist) build_builtin_delete_call (addr)
tree type; tree addr;
tree node;
tree arglist;
{ {
tree rval = build (CALL_EXPR, type, node, arglist, NULL_TREE); tree BID = get_first_fn
TREE_SIDE_EFFECTS (rval) = 1; (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) DELETE_EXPR]));
assemble_external (TREE_OPERAND (node, 0));
TREE_USED (TREE_OPERAND (node, 0)) = 1; return build_call (BID, void_type_node, build_expr_list (NULL_TREE, addr));
return rval;
} }
/* Generate a C++ "new" expression. DECL is either a TREE_LIST /* Generate a C++ "new" expression. DECL is either a TREE_LIST
...@@ -2983,8 +2967,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete) ...@@ -2983,8 +2967,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
if (! IS_AGGR_TYPE (type)) if (! IS_AGGR_TYPE (type))
{ {
/* Call the builtin operator delete. */ /* Call the builtin operator delete. */
return build_builtin_call (void_type_node, BID, return build_builtin_delete_call (addr);
build_expr_list (NULL_TREE, addr));
} }
if (TREE_SIDE_EFFECTS (addr)) if (TREE_SIDE_EFFECTS (addr))
addr = save_expr (addr); addr = save_expr (addr);
...@@ -3050,8 +3033,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete) ...@@ -3050,8 +3033,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
{ {
tree cond = fold (build (BIT_AND_EXPR, integer_type_node, tree cond = fold (build (BIT_AND_EXPR, integer_type_node,
auto_delete, integer_one_node)); auto_delete, integer_one_node));
tree call = build_builtin_call tree call = build_builtin_delete_call (addr);
(void_type_node, BID, build_expr_list (NULL_TREE, addr));
cond = fold (build (COND_EXPR, void_type_node, cond, cond = fold (build (COND_EXPR, void_type_node, cond,
call, void_zero_node)); call, void_zero_node));
...@@ -3103,8 +3085,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete) ...@@ -3103,8 +3085,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
{ {
cond = build (COND_EXPR, void_type_node, cond = build (COND_EXPR, void_type_node,
build (BIT_AND_EXPR, integer_type_node, auto_delete, integer_one_node), build (BIT_AND_EXPR, integer_type_node, auto_delete, integer_one_node),
build_builtin_call (void_type_node, BID, build_builtin_delete_call (addr),
build_expr_list (NULL_TREE, addr)),
void_zero_node); void_zero_node);
} }
else else
......
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