FreeBSD/contrib/gcc/cp/class.c
/* Build the construction vtable group for BINFO which is in the
   hierarchy dominated by T.  */
Build the construction vtable group for BINFO which is in the
hierarchy dominated by T.
Build the construction vtable group for BINFO which is in the hierarchy dominated by T .
static void
build_ctor_vtbl_group (tree binfo, tree t)
{
  tree list;
  tree type;
  tree vtbl;
  tree inits;
  tree id;
  tree vbase;
  id = mangle_ctor_vtbl_for_type (t, binfo);
  if (IDENTIFIER_GLOBAL_VALUE (id))
    return;
  gcc_assert (!SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t));
  vtbl = build_vtable (t, id, ptr_type_node);
  DECL_CONSTRUCTION_VTABLE_P (vtbl) = 1;
  list = build_tree_list (vtbl, NULL_TREE);
  accumulate_vtbl_inits (binfo, TYPE_BINFO (TREE_TYPE (binfo)),
			 binfo, t, list);
  for (vbase = TYPE_BINFO (BINFO_TYPE (binfo));
       vbase;
       vbase = TREE_CHAIN (vbase))
    {
      tree b;
      if (!BINFO_VIRTUAL_P (vbase))
	continue;
      b = copied_binfo (vbase, binfo);
      accumulate_vtbl_inits (b, vbase, binfo, t, list);
    }
  inits = TREE_VALUE (list);
  type = build_index_type (size_int (list_length (inits) - 1));
  type = build_cplus_array_type (vtable_entry_type, type);
  TREE_TYPE (vtbl) = type;
  CLASSTYPE_VTABLES (t) = chainon (CLASSTYPE_VTABLES (t), vtbl);
  initialize_artificial_var (vtbl, inits);
  dump_vtable (t, binfo, vtbl);
}
static void build_ctor_vtbl_group ( tree binfo , tree t ) { tree list ; tree type ; tree vtbl ; tree inits ; tree id ; tree vbase ; id = mangle_ctor_vtbl_for_type ( t , binfo ) ; if ( IDENTIFIER_GLOBAL_VALUE ( id ) ) return ; gcc_assert ( ! SAME_BINFO_TYPE_P ( BINFO_TYPE ( binfo ) , t ) ) ; vtbl = build_vtable ( t , id , ptr_type_node ) ; DECL_CONSTRUCTION_VTABLE_P ( vtbl ) = 1 ; list = build_tree_list ( vtbl , NULL_TREE ) ; accumulate_vtbl_inits ( binfo , TYPE_BINFO ( TREE_TYPE ( binfo ) ) , binfo , t , list ) ; for ( vbase = TYPE_BINFO ( BINFO_TYPE ( binfo ) ) ; vbase ; vbase = TREE_CHAIN ( vbase ) ) { tree b ; if ( ! BINFO_VIRTUAL_P ( vbase ) ) continue ; b = copied_binfo ( vbase , binfo ) ; accumulate_vtbl_inits ( b , vbase , binfo , t , list ) ; } inits = TREE_VALUE ( list ) ; type = build_index_type ( size_int ( list_length ( inits ) - 1 ) ) ; type = build_cplus_array_type ( vtable_entry_type , type ) ; TREE_TYPE ( vtbl ) = type ; CLASSTYPE_VTABLES ( t ) = chainon ( CLASSTYPE_VTABLES ( t ) , vtbl ) ; initialize_artificial_var ( vtbl , inits ) ; dump_vtable ( t , binfo , vtbl ) ; }
Build the construction vtable group for BINFO which is in the
hierarchy dominated by T.
Build the construction vtable group for BINFO which is in the hierarchy dominated by T .
/* See if we've already created this construction vtable group.  */ /* Build a version of VTBL (with the wrong type) for use in
     constructing the addresses of secondary vtables in the
     construction vtable group.  */ /* Add the vtables for each of our virtual bases using the vbase in T
     binfo.  */ /* Figure out the type of the construction vtable.  */ /* Initialize the construction vtable.  */