FreeBSD/contrib/gcc/cp/class.c
/* Produce declarations for all appropriate clones of FN.  If
   UPDATE_METHOD_VEC_P is nonzero, the clones are added to the
   CLASTYPE_METHOD_VEC as well.  */
Produce declarations for all appropriate clones of FN.  If
UPDATE_METHOD_VEC_P is nonzero, the clones are added to the
CLASTYPE_METHOD_VEC as well.
Produce declarations for all appropriate clones of FN . If UPDATE_METHOD_VEC_P is nonzero the clones are added to the CLASTYPE_METHOD_VEC as well .
void
clone_function_decl (tree fn, int update_method_vec_p)
{
  tree clone;
  if (TREE_CHAIN (fn)
      && DECL_CLONED_FUNCTION (TREE_CHAIN (fn)))
    return;
  if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn))
    {
      clone = build_clone (fn, complete_ctor_identifier);
      if (update_method_vec_p)
	add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
      clone = build_clone (fn, base_ctor_identifier);
      if (update_method_vec_p)
	add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
    }
  else
    {
      gcc_assert (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn));
      if (DECL_VIRTUAL_P (fn))
	{
	  clone = build_clone (fn, deleting_dtor_identifier);
	  if (update_method_vec_p)
	    add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
	}
      clone = build_clone (fn, complete_dtor_identifier);
      if (update_method_vec_p)
	add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
      clone = build_clone (fn, base_dtor_identifier);
      if (update_method_vec_p)
	add_method (DECL_CONTEXT (clone), clone, NULL_TREE);
    }
  DECL_ABSTRACT (fn) = 1;
}
void clone_function_decl ( tree fn , int update_method_vec_p ) { tree clone ; if ( TREE_CHAIN ( fn ) && DECL_CLONED_FUNCTION ( TREE_CHAIN ( fn ) ) ) return ; if ( DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P ( fn ) ) { clone = build_clone ( fn , complete_ctor_identifier ) ; if ( update_method_vec_p ) add_method ( DECL_CONTEXT ( clone ) , clone , NULL_TREE ) ; clone = build_clone ( fn , base_ctor_identifier ) ; if ( update_method_vec_p ) add_method ( DECL_CONTEXT ( clone ) , clone , NULL_TREE ) ; } else { gcc_assert ( DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P ( fn ) ) ; if ( DECL_VIRTUAL_P ( fn ) ) { clone = build_clone ( fn , deleting_dtor_identifier ) ; if ( update_method_vec_p ) add_method ( DECL_CONTEXT ( clone ) , clone , NULL_TREE ) ; } clone = build_clone ( fn , complete_dtor_identifier ) ; if ( update_method_vec_p ) add_method ( DECL_CONTEXT ( clone ) , clone , NULL_TREE ) ; clone = build_clone ( fn , base_dtor_identifier ) ; if ( update_method_vec_p ) add_method ( DECL_CONTEXT ( clone ) , clone , NULL_TREE ) ; } DECL_ABSTRACT ( fn ) = 1 ; }
Produce declarations for all appropriate clones of FN.
Produce declarations for all appropriate clones of FN .
/* Avoid inappropriate cloning.  */ /* For each constructor, we need two variants: an in-charge version
	 and a not-in-charge version.  */ /* For each destructor, we need three variants: an in-charge
	 version, a not-in-charge version, and an in-charge deleting
	 version.  We clone the deleting version first because that
	 means it will go second on the TYPE_METHODS list -- and that
	 corresponds to the correct layout order in the virtual
	 function table.

	 For a non-virtual destructor, we do not build a deleting
	 destructor.  */ /* Note that this is an abstract function that is never emitted.  */