FreeBSD/contrib/gcc/cp/decl.c
/* At the end of every destructor we generate code to delete the object if
   necessary.  Do that now.  */
At the end of every destructor we generate code to delete the object if
necessary.  Do that now.
At the end of every destructor we generate code to delete the object if necessary . Do that now .
static void
finish_destructor_body (void)
{
  tree exprstmt;
  add_stmt (build_stmt (LABEL_EXPR, cdtor_label));
  if (DECL_VIRTUAL_P (current_function_decl))
    {
      tree if_stmt;
      tree virtual_size = cxx_sizeof (current_class_type);
      exprstmt = build_op_delete_call(DELETE_EXPR, current_class_ptr,
				      virtual_size,
				      false,
				      NULL_TREE,
				      NULL_TREE);
      if_stmt = begin_if_stmt ();
      finish_if_stmt_cond (build2 (BIT_AND_EXPR, integer_type_node,
				   current_in_charge_parm,
				   integer_one_node),
			   if_stmt);
      finish_expr_stmt (exprstmt);
      finish_then_clause (if_stmt);
      finish_if_stmt (if_stmt);
    }
  if (targetm.cxx.cdtor_returns_this ())
    {
      tree val;
      val = DECL_ARGUMENTS (current_function_decl);
      val = build2 (MODIFY_EXPR, TREE_TYPE (val),
		    DECL_RESULT (current_function_decl), val);
      exprstmt = build_stmt (RETURN_EXPR, val);
      add_stmt (exprstmt);
    }
}
static void finish_destructor_body ( void ) { tree exprstmt ; add_stmt ( build_stmt ( LABEL_EXPR , cdtor_label ) ) ; if ( DECL_VIRTUAL_P ( current_function_decl ) ) { tree if_stmt ; tree virtual_size = cxx_sizeof ( current_class_type ) ; exprstmt = build_op_delete_call ( DELETE_EXPR , current_class_ptr , virtual_size , false , NULL_TREE , NULL_TREE ) ; if_stmt = begin_if_stmt ( ) ; finish_if_stmt_cond ( build2 ( BIT_AND_EXPR , integer_type_node , current_in_charge_parm , integer_one_node ) , if_stmt ) ; finish_expr_stmt ( exprstmt ) ; finish_then_clause ( if_stmt ) ; finish_if_stmt ( if_stmt ) ; } if ( targetm . cxx . cdtor_returns_this ( ) ) { tree val ; val = DECL_ARGUMENTS ( current_function_decl ) ; val = build2 ( MODIFY_EXPR , TREE_TYPE ( val ) , DECL_RESULT ( current_function_decl ) , val ) ; exprstmt = build_stmt ( RETURN_EXPR , val ) ; add_stmt ( exprstmt ) ; } }
At the end of every destructor we generate code to delete the object if
necessary.
At the end of every destructor we generate code to delete the object if necessary .
/* Any return from a destructor will end up here; that way all base
     and member cleanups will be run when the function returns.  */ /* In a virtual destructor, we must call delete.  */ /* [class.dtor]

      At the point of definition of a virtual destructor (including
      an implicit definition), non-placement operator delete shall
      be looked up in the scope of the destructor's class and if
      found shall be accessible and unambiguous.  */ /*global_p=*/ /*placement=*/ /*alloc_fn=*/ /* Return the address of the object.  */