FreeBSD/contrib/gcc/cp/decl.c
/* If DECL is of a type which needs a cleanup, build that cleanup
   here.  */
If DECL is of a type which needs a cleanup, build that cleanup
here.
If DECL is of a type which needs a cleanup build that cleanup here .
tree
cxx_maybe_build_cleanup (tree decl)
{
  tree type = TREE_TYPE (decl);
  tree dtor = NULL_TREE;
  bool build_cleanup = false;
  if (TREE_CODE (type) == RECORD_TYPE)
    dtor = CLASSTYPE_DESTRUCTORS (type);
  if (type != error_mark_node)
    {
      if (TREE_CODE (type) == RECORD_TYPE)
	build_cleanup = (dtor && TREE_PRIVATE (dtor))
	  || CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (type)
	  || CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (type);
      else
	build_cleanup = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type);
    }
  if (build_cleanup)
    {
      int flags = LOOKUP_NORMAL|LOOKUP_DESTRUCTOR;
      tree rval;
      bool has_vbases = (TREE_CODE (type) == RECORD_TYPE
			 && CLASSTYPE_VBASECLASSES (type));
      if (TREE_CODE (type) == ARRAY_TYPE)
	rval = decl;
      else
	{
	  cxx_mark_addressable (decl);
	  rval = build_unary_op (ADDR_EXPR, decl, 0);
	}
      if (!has_vbases || flag_expensive_optimizations)
	flags |= LOOKUP_NONVIRTUAL;
      rval = build_delete (TREE_TYPE (rval), rval,
			   sfk_complete_destructor, flags, 0);
      return rval;
    }
  return NULL_TREE;
}
tree cxx_maybe_build_cleanup ( tree decl ) { tree type = TREE_TYPE ( decl ) ; tree dtor = NULL_TREE ; bool build_cleanup = false ; if ( TREE_CODE ( type ) == RECORD_TYPE ) dtor = CLASSTYPE_DESTRUCTORS ( type ) ; if ( type != error_mark_node ) { if ( TREE_CODE ( type ) == RECORD_TYPE ) build_cleanup = ( dtor && TREE_PRIVATE ( dtor ) ) || CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY ( type ) || CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE ( type ) ; else build_cleanup = TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( type ) ; } if ( build_cleanup ) { int flags = LOOKUP_NORMAL | LOOKUP_DESTRUCTOR ; tree rval ; bool has_vbases = ( TREE_CODE ( type ) == RECORD_TYPE && CLASSTYPE_VBASECLASSES ( type ) ) ; if ( TREE_CODE ( type ) == ARRAY_TYPE ) rval = decl ; else { cxx_mark_addressable ( decl ) ; rval = build_unary_op ( ADDR_EXPR , decl , 0 ) ; } if ( ! has_vbases || flag_expensive_optimizations ) flags |= LOOKUP_NONVIRTUAL ; rval = build_delete ( TREE_TYPE ( rval ) , rval , sfk_complete_destructor , flags , 0 ) ; return rval ; } return NULL_TREE ; }
If DECL is of a type which needs a cleanup, build that cleanup
here.
If DECL is of a type which needs a cleanup build that cleanup here .
/* APPLE LOCAL begin omit calls to empty destructors 5559195 */ /* For RECORD_TYPEs, we can refer to more precise flags than
	   TYPE_HAS_NONTRIVIAL_DESTRUCTOR. */ /* APPLE LOCAL end omit calls to empty destructors 5559195 */ /* Optimize for space over speed here.  */