FreeBSD/contrib/gcc/cp/class.c
/* Increase the size indicated in RLI to account for empty classes
   that are "off the end" of the class.  */
Increase the size indicated in RLI to account for empty classes
that are "off the end" of the class.
Increase the size indicated in RLI to account for empty classes that are " off the end " of the class .
static void
include_empty_classes (record_layout_info rli)
{
  tree eoc;
  tree rli_size;
  eoc = end_of_class (rli->t,
		      CLASSTYPE_AS_BASE (rli->t) != NULL_TREE);
  rli_size = rli_size_unit_so_far (rli);
  if (TREE_CODE (rli_size) == INTEGER_CST
      && INT_CST_LT_UNSIGNED (rli_size, eoc))
    {
      if (!abi_version_at_least (2))
	rli->bitpos = round_down (rli->bitpos, BITS_PER_UNIT);
      else
	gcc_assert (tree_int_cst_equal
		    (rli->bitpos, round_down (rli->bitpos, BITS_PER_UNIT)));
      rli->bitpos
	= size_binop (PLUS_EXPR,
		      rli->bitpos,
		      size_binop (MULT_EXPR,
				  convert (bitsizetype,
					   size_binop (MINUS_EXPR,
						       eoc, rli_size)),
				  bitsize_int (BITS_PER_UNIT)));
      normalize_rli (rli);
    }
}
static void include_empty_classes ( record_layout_info rli ) { tree eoc ; tree rli_size ; eoc = end_of_class ( rli -> t , CLASSTYPE_AS_BASE ( rli -> t ) != NULL_TREE ) ; rli_size = rli_size_unit_so_far ( rli ) ; if ( TREE_CODE ( rli_size ) == INTEGER_CST && INT_CST_LT_UNSIGNED ( rli_size , eoc ) ) { if ( ! abi_version_at_least ( 2 ) ) rli -> bitpos = round_down ( rli -> bitpos , BITS_PER_UNIT ) ; else gcc_assert ( tree_int_cst_equal ( rli -> bitpos , round_down ( rli -> bitpos , BITS_PER_UNIT ) ) ) ; rli -> bitpos = size_binop ( PLUS_EXPR , rli -> bitpos , size_binop ( MULT_EXPR , convert ( bitsizetype , size_binop ( MINUS_EXPR , eoc , rli_size ) ) , bitsize_int ( BITS_PER_UNIT ) ) ) ; normalize_rli ( rli ) ; } }
Increase the size indicated in RLI to account for empty classes
that are "off the end" of the class.
Increase the size indicated in RLI to account for empty classes that are " off the end " of the class .
/* It might be the case that we grew the class to allocate a
     zero-sized base class.  That won't be reflected in RLI, yet,
     because we are willing to overlay multiple bases at the same
     offset.  However, now we need to make sure that RLI is big enough
     to reflect the entire class.  */ /* In version 1 of the ABI, the size of a class that ends with
	   a bitfield was not rounded up to a whole multiple of a
	   byte.  Because rli_size_unit_so_far returns only the number
	   of fully allocated bytes, any extra bits were not included
	   in the size.  */ /* The size should have been rounded to a whole byte.  */