FreeBSD/contrib/gcc/cp/class.c
/* Add the vtbl initializers for BINFO (and its bases other than
   non-virtual primaries) to the list of INITS.  BINFO is in the
   hierarchy dominated by T.  RTTI_BINFO is the binfo within T of
   the constructor the vtbl inits should be accumulated for. (If this
   is the complete object vtbl then RTTI_BINFO will be TYPE_BINFO (T).)
   ORIG_BINFO is the binfo for this object within BINFO_TYPE (RTTI_BINFO).
   BINFO is the active base equivalent of ORIG_BINFO in the inheritance
   graph of T. Both BINFO and ORIG_BINFO will have the same BINFO_TYPE,
   but are not necessarily the same in terms of layout.  */
Add the vtbl initializers for BINFO (and its bases other than
non-virtual primaries) to the list of INITS.  BINFO is in the
hierarchy dominated by T.  RTTI_BINFO is the binfo within T of
the constructor the vtbl inits should be accumulated for. (If this
is the complete object vtbl then RTTI_BINFO will be TYPE_BINFO (T).)
ORIG_BINFO is the binfo for this object within BINFO_TYPE (RTTI_BINFO).
BINFO is the active base equivalent of ORIG_BINFO in the inheritance
graph of T. Both BINFO and ORIG_BINFO will have the same BINFO_TYPE,
but are not necessarily the same in terms of layout.
Add the vtbl initializers for BINFO ( and its bases other than non - virtual primaries ) to the list of INITS . BINFO is in the hierarchy dominated by T . RTTI_BINFO is the binfo within T of the constructor the vtbl inits should be accumulated for . ( If this is the complete object vtbl then RTTI_BINFO will be TYPE_BINFO ( T ) . ) ORIG_BINFO is the binfo for this object within BINFO_TYPE ( RTTI_BINFO ) . BINFO is the active base equivalent of ORIG_BINFO in the inheritance graph of T . Both BINFO and ORIG_BINFO will have the same BINFO_TYPE but are not necessarily the same in terms of layout .
static void
accumulate_vtbl_inits (tree binfo,
		       tree orig_binfo,
		       tree rtti_binfo,
		       tree t,
		       tree inits)
{
  int i;
  tree base_binfo;
  int ctor_vtbl_p = !SAME_BINFO_TYPE_P (BINFO_TYPE (rtti_binfo), t);
  gcc_assert (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), BINFO_TYPE (orig_binfo)));
  if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
    return;
  if (ctor_vtbl_p
      && !CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo))
      && !binfo_via_virtual (orig_binfo, BINFO_TYPE (rtti_binfo)))
    return;
  TREE_VALUE (inits)
    = chainon (TREE_VALUE (inits),
	       dfs_accumulate_vtbl_inits (binfo, orig_binfo,
					  rtti_binfo, t, inits));
  for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
    {
      if (BINFO_VIRTUAL_P (base_binfo))
	continue;
      accumulate_vtbl_inits (base_binfo,
			     BINFO_BASE_BINFO (orig_binfo, i),
			     rtti_binfo, t,
			     inits);
    }
}
static void accumulate_vtbl_inits ( tree binfo , tree orig_binfo , tree rtti_binfo , tree t , tree inits ) { int i ; tree base_binfo ; int ctor_vtbl_p = ! SAME_BINFO_TYPE_P ( BINFO_TYPE ( rtti_binfo ) , t ) ; gcc_assert ( SAME_BINFO_TYPE_P ( BINFO_TYPE ( binfo ) , BINFO_TYPE ( orig_binfo ) ) ) ; if ( ! TYPE_CONTAINS_VPTR_P ( BINFO_TYPE ( binfo ) ) ) return ; if ( ctor_vtbl_p && ! CLASSTYPE_VBASECLASSES ( BINFO_TYPE ( binfo ) ) && ! binfo_via_virtual ( orig_binfo , BINFO_TYPE ( rtti_binfo ) ) ) return ; TREE_VALUE ( inits ) = chainon ( TREE_VALUE ( inits ) , dfs_accumulate_vtbl_inits ( binfo , orig_binfo , rtti_binfo , t , inits ) ) ; for ( i = 0 ; BINFO_BASE_ITERATE ( binfo , i , base_binfo ) ; ++ i ) { if ( BINFO_VIRTUAL_P ( base_binfo ) ) continue ; accumulate_vtbl_inits ( base_binfo , BINFO_BASE_BINFO ( orig_binfo , i ) , rtti_binfo , t , inits ) ; } }
Add the vtbl initializers for BINFO (and its bases other than
non-virtual primaries) to the list of INITS.
Add the vtbl initializers for BINFO ( and its bases other than non - virtual primaries ) to the list of INITS .
/* If it doesn't have a vptr, we don't do anything.  */ /* If we're building a construction vtable, we're not interested in
     subobjects that don't require construction vtables.  */ /* Build the initializers for the BINFO-in-T vtable.  */ /* Walk the BINFO and its bases.  We walk in preorder so that as we
     initialize each vtable we can figure out at what offset the
     secondary vtable lies from the primary vtable.  We can't use
     dfs_walk here because we need to iterate through bases of BINFO
     and RTTI_BINFO simultaneously.  */ /* Skip virtual bases.  */