FreeBSD/contrib/gcc/cp/tree.c
/* INIT is a CALL_EXPR which needs info about its target.
   TYPE is the type that this initialization should appear to have.

   Build an encapsulation of the initialization to perform
   and return it so that it can be processed by language-independent
   and language-specific expression expanders.  */
INIT is a CALL_EXPR which needs info about its target.
TYPE is the type that this initialization should appear to have.

Build an encapsulation of the initialization to perform
and return it so that it can be processed by language-independent
and language-specific expression expanders.
INIT is a CALL_EXPR which needs info about its target . TYPE is the type that this initialization should appear to have . Build an encapsulation of the initialization to perform and return it so that it can be processed by language - independent and language - specific expression expanders .
tree
build_cplus_new (tree type, tree init)
{
  tree fn;
  tree slot;
  tree rval;
  int is_ctor;
  abstract_virtuals_error (NULL_TREE, type);
  if (TREE_CODE (init) != CALL_EXPR && TREE_CODE (init) != AGGR_INIT_EXPR)
    return convert (type, init);
  fn = TREE_OPERAND (init, 0);
  is_ctor = (TREE_CODE (fn) == ADDR_EXPR
	     && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
	     && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
  slot = build_local_temp (type);
  if (is_ctor || TREE_ADDRESSABLE (type))
    {
      rval = build3 (AGGR_INIT_EXPR, void_type_node, fn,
		     TREE_OPERAND (init, 1), slot);
      TREE_SIDE_EFFECTS (rval) = 1;
      AGGR_INIT_VIA_CTOR_P (rval) = is_ctor;
    }
  else
    rval = init;
  rval = build_target_expr (slot, rval);
  TARGET_EXPR_IMPLICIT_P (rval) = 1;
  return rval;
}
tree build_cplus_new ( tree type , tree init ) { tree fn ; tree slot ; tree rval ; int is_ctor ; abstract_virtuals_error ( NULL_TREE , type ) ; if ( TREE_CODE ( init ) != CALL_EXPR && TREE_CODE ( init ) != AGGR_INIT_EXPR ) return convert ( type , init ) ; fn = TREE_OPERAND ( init , 0 ) ; is_ctor = ( TREE_CODE ( fn ) == ADDR_EXPR && TREE_CODE ( TREE_OPERAND ( fn , 0 ) ) == FUNCTION_DECL && DECL_CONSTRUCTOR_P ( TREE_OPERAND ( fn , 0 ) ) ) ; slot = build_local_temp ( type ) ; if ( is_ctor || TREE_ADDRESSABLE ( type ) ) { rval = build3 ( AGGR_INIT_EXPR , void_type_node , fn , TREE_OPERAND ( init , 1 ) , slot ) ; TREE_SIDE_EFFECTS ( rval ) = 1 ; AGGR_INIT_VIA_CTOR_P ( rval ) = is_ctor ; } else rval = init ; rval = build_target_expr ( slot , rval ) ; TARGET_EXPR_IMPLICIT_P ( rval ) = 1 ; return rval ; }
INIT is a CALL_EXPR which needs info about its target.
INIT is a CALL_EXPR which needs info about its target .
/* Make sure that we're not trying to create an instance of an
     abstract class.  */ /* We split the CALL_EXPR into its function and its arguments here.
     Then, in expand_expr, we put them back together.  The reason for
     this is that this expression might be a default argument
     expression.  In that case, we need a new temporary every time the
     expression is used.  That's what break_out_target_exprs does; it
     replaces every AGGR_INIT_EXPR with a copy that uses a fresh
     temporary slot.  Then, expand_expr builds up a call-expression
     using the new slot.  */ /* If we don't need to use a constructor to create an object of this
     type, don't mess with AGGR_INIT_EXPR.  */