FreeBSD/contrib/gcc/cp/cvt.c
/* We are passing something to a function which requires a reference.
   The type we are interested in is in TYPE. The initial
   value we have to begin with is in ARG.

   FLAGS controls how we manage access checking.
   DIRECT_BIND in FLAGS controls how any temporaries are generated.
     If DIRECT_BIND is set, DECL is the reference we're binding to.  */
We are passing something to a function which requires a reference.
The type we are interested in is in TYPE. The initial
value we have to begin with is in ARG.

FLAGS controls how we manage access checking.
DIRECT_BIND in FLAGS controls how any temporaries are generated.
If DIRECT_BIND is set, DECL is the reference we're binding to.
We are passing something to a function which requires a reference . The type we are interested in is in TYPE . The initial value we have to begin with is in ARG . FLAGS controls how we manage access checking . DIRECT_BIND in FLAGS controls how any temporaries are generated . If DIRECT_BIND is set DECL is the reference we ' re binding to .
static tree
build_up_reference (tree type, tree arg, int flags, tree decl)
{
  tree rval;
  tree argtype = TREE_TYPE (arg);
  tree target_type = TREE_TYPE (type);
  gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
  if ((flags & DIRECT_BIND) && ! real_lvalue_p (arg))
    {
      tree targ = arg;
      arg = make_temporary_var_for_ref_to_temp (decl, TREE_TYPE (arg));
      DECL_INITIAL (arg) = targ;
      cp_finish_decl (arg, targ, false, NULL_TREE,
		      LOOKUP_ONLYCONVERTING|DIRECT_BIND);
    }
  else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg))
    return get_target_expr (arg);
  rval = build_unary_op (ADDR_EXPR, arg, 1);
  if (rval == error_mark_node)
    return error_mark_node;
  if ((flags & LOOKUP_PROTECT)
      && TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type)
      && IS_AGGR_TYPE (argtype)
      && IS_AGGR_TYPE (target_type))
    {
      tree binfo = lookup_base (argtype, target_type, ba_check, NULL);
      if (binfo == error_mark_node)
	return error_mark_node;
      if (binfo == NULL_TREE)
	return error_not_base_type (target_type, argtype);
      rval = build_base_path (PLUS_EXPR, rval, binfo, 1);
    }
  else
    rval
      = convert_to_pointer_force (build_pointer_type (target_type), rval);
  return build_nop (type, rval);
}
static tree build_up_reference ( tree type , tree arg , int flags , tree decl ) { tree rval ; tree argtype = TREE_TYPE ( arg ) ; tree target_type = TREE_TYPE ( type ) ; gcc_assert ( TREE_CODE ( type ) == REFERENCE_TYPE ) ; if ( ( flags & DIRECT_BIND ) && ! real_lvalue_p ( arg ) ) { tree targ = arg ; arg = make_temporary_var_for_ref_to_temp ( decl , TREE_TYPE ( arg ) ) ; DECL_INITIAL ( arg ) = targ ; cp_finish_decl ( arg , targ , false , NULL_TREE , LOOKUP_ONLYCONVERTING | DIRECT_BIND ) ; } else if ( ! ( flags & DIRECT_BIND ) && ! lvalue_p ( arg ) ) return get_target_expr ( arg ) ; rval = build_unary_op ( ADDR_EXPR , arg , 1 ) ; if ( rval == error_mark_node ) return error_mark_node ; if ( ( flags & LOOKUP_PROTECT ) && TYPE_MAIN_VARIANT ( argtype ) != TYPE_MAIN_VARIANT ( target_type ) && IS_AGGR_TYPE ( argtype ) && IS_AGGR_TYPE ( target_type ) ) { tree binfo = lookup_base ( argtype , target_type , ba_check , NULL ) ; if ( binfo == error_mark_node ) return error_mark_node ; if ( binfo == NULL_TREE ) return error_not_base_type ( target_type , argtype ) ; rval = build_base_path ( PLUS_EXPR , rval , binfo , 1 ) ; } else rval = convert_to_pointer_force ( build_pointer_type ( target_type ) , rval ) ; return build_nop ( type , rval ) ; }
We are passing something to a function which requires a reference.
We are passing something to a function which requires a reference .
/* Create a new temporary variable.  We can't just use a TARGET_EXPR
	 here because it needs to live as long as DECL.  */ /* Process the initializer for the declaration.  */ /*init_const_expr_p=*/ /* If we had a way to wrap this up, and say, if we ever needed its
     address, transform all occurrences of the register, into a memory
     reference we could win better.  */ /* We go through lookup_base for the access control.  */