FreeBSD/contrib/gcc/cp/class.c
/* EXPR is an expression with unqualified class type.  BASE is a base
   binfo of that class type.  Returns EXPR, converted to the BASE
   type.  This function assumes that EXPR is the most derived class;
   therefore virtual bases can be found at their static offsets.  */
EXPR is an expression with unqualified class type.  BASE is a base
binfo of that class type.  Returns EXPR, converted to the BASE
type.  This function assumes that EXPR is the most derived class;
therefore virtual bases can be found at their static offsets.
EXPR is an expression with unqualified class type . BASE is a base binfo of that class type . Returns EXPR converted to the BASE type . This function assumes that EXPR is the most derived class ; therefore virtual bases can be found at their static offsets .
tree
convert_to_base_statically (tree expr, tree base)
{
  tree expr_type;
  expr_type = TREE_TYPE (expr);
  if (!SAME_BINFO_TYPE_P (BINFO_TYPE (base), expr_type))
    {
      tree pointer_type;
      pointer_type = build_pointer_type (expr_type);
      expr = build_unary_op (ADDR_EXPR, expr, 1);
      if (!integer_zerop (BINFO_OFFSET (base)))
	  expr = build2 (PLUS_EXPR, pointer_type, expr,
			 build_nop (pointer_type, BINFO_OFFSET (base)));
      expr = build_nop (build_pointer_type (BINFO_TYPE (base)), expr);
      expr = build1 (INDIRECT_REF, BINFO_TYPE (base), expr);
    }
  return expr;
}
tree convert_to_base_statically ( tree expr , tree base ) { tree expr_type ; expr_type = TREE_TYPE ( expr ) ; if ( ! SAME_BINFO_TYPE_P ( BINFO_TYPE ( base ) , expr_type ) ) { tree pointer_type ; pointer_type = build_pointer_type ( expr_type ) ; expr = build_unary_op ( ADDR_EXPR , expr , 1 ) ; if ( ! integer_zerop ( BINFO_OFFSET ( base ) ) ) expr = build2 ( PLUS_EXPR , pointer_type , expr , build_nop ( pointer_type , BINFO_OFFSET ( base ) ) ) ; expr = build_nop ( build_pointer_type ( BINFO_TYPE ( base ) ) , expr ) ; expr = build1 ( INDIRECT_REF , BINFO_TYPE ( base ) , expr ) ; } return expr ; }
EXPR is an expression with unqualified class type.
EXPR is an expression with unqualified class type .
/*noconvert=*/