FreeBSD/contrib/gcc/cp/class.c
/* Layout the empty base BINFO.  EOC indicates the byte currently just
   past the end of the class, and should be correctly aligned for a
   class of the type indicated by BINFO; OFFSETS gives the offsets of
   the empty bases allocated so far. T is the most derived
   type.  Return nonzero iff we added it at the end.  */
Layout the empty base BINFO.  EOC indicates the byte currently just
past the end of the class, and should be correctly aligned for a
class of the type indicated by BINFO; OFFSETS gives the offsets of
the empty bases allocated so far. T is the most derived
type.  Return nonzero iff we added it at the end.
Layout the empty base BINFO . EOC indicates the byte currently just past the end of the class and should be correctly aligned for a class of the type indicated by BINFO ; OFFSETS gives the offsets of the empty bases allocated so far . T is the most derived type . Return nonzero iff we added it at the end .
static bool
layout_empty_base (tree binfo, tree eoc, splay_tree offsets)
{
  tree alignment;
  tree basetype = BINFO_TYPE (binfo);
  bool atend = false;
  gcc_assert (is_empty_class (basetype));
  alignment = ssize_int (CLASSTYPE_ALIGN_UNIT (basetype));
  if (!integer_zerop (BINFO_OFFSET (binfo)))
    {
      if (abi_version_at_least (2))
	propagate_binfo_offsets
	  (binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo)));
      else
	warning (OPT_Wabi,
		 "offset of empty base %qT may not be ABI-compliant and may"
		 "change in a future version of GCC",
		 BINFO_TYPE (binfo));
    }
  if (layout_conflict_p (binfo,
			 BINFO_OFFSET (binfo),
			 offsets,
			 0))
    {
      atend = true;
      propagate_binfo_offsets (binfo, convert (ssizetype, eoc));
      while (1)
	{
	  if (!layout_conflict_p (binfo,
				  BINFO_OFFSET (binfo),
				  offsets,
				  0))
	    break;
	  propagate_binfo_offsets (binfo, alignment);
	}
    }
  return atend;
}
static bool layout_empty_base ( tree binfo , tree eoc , splay_tree offsets ) { tree alignment ; tree basetype = BINFO_TYPE ( binfo ) ; bool atend = false ; gcc_assert ( is_empty_class ( basetype ) ) ; alignment = ssize_int ( CLASSTYPE_ALIGN_UNIT ( basetype ) ) ; if ( ! integer_zerop ( BINFO_OFFSET ( binfo ) ) ) { if ( abi_version_at_least ( 2 ) ) propagate_binfo_offsets ( binfo , size_diffop ( size_zero_node , BINFO_OFFSET ( binfo ) ) ) ; else warning ( OPT_Wabi , " " " " , BINFO_TYPE ( binfo ) ) ; } if ( layout_conflict_p ( binfo , BINFO_OFFSET ( binfo ) , offsets , 0 ) ) { atend = true ; propagate_binfo_offsets ( binfo , convert ( ssizetype , eoc ) ) ; while ( 1 ) { if ( ! layout_conflict_p ( binfo , BINFO_OFFSET ( binfo ) , offsets , 0 ) ) break ; propagate_binfo_offsets ( binfo , alignment ) ; } } return atend ; }
Layout the empty base BINFO.
Layout the empty base BINFO .
/* This routine should only be used for empty classes.  */ /* This is an empty base class.  We first try to put it at offset
     zero.  */ /*vbases_p=*/ /* That didn't work.  Now, we move forward from the next
	 available spot in the class.  */ /*vbases_p=*/ /* We finally found a spot where there's no overlap.  */ /* There's overlap here, too.  Bump along to the next spot.  */