FreeBSD/contrib/gcc/cp/call.c
/* Actually perform the appropriate conversion.  */
Actually perform the appropriate conversion.
Actually perform the appropriate conversion .
tree
convert_for_arg_passing (tree type, tree val)
{
  tree bitfield_type;
  bitfield_type = is_bitfield_expr_with_lowered_type (val);
  if (bitfield_type 
      && TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type))
    val = convert_to_integer (TYPE_MAIN_VARIANT (bitfield_type), val);
  if (val == error_mark_node)
    ;
  else if (TREE_ADDRESSABLE (type))
    val = build1 (ADDR_EXPR, build_reference_type (type), val);
  else if (targetm.calls.promote_prototypes (type)
	   && INTEGRAL_TYPE_P (type)
	   && COMPLETE_TYPE_P (type)
	   && INT_CST_LT_UNSIGNED (TYPE_SIZE (type),
				   TYPE_SIZE (integer_type_node)))
    val = perform_integral_promotions (val);
  if (warn_missing_format_attribute)
    {
      tree rhstype = TREE_TYPE (val);
      const enum tree_code coder = TREE_CODE (rhstype);
      const enum tree_code codel = TREE_CODE (type);
      if ((codel == POINTER_TYPE || codel == REFERENCE_TYPE)
	  && coder == codel
	  && check_missing_format_attribute (type, rhstype))
	warning (OPT_Wmissing_format_attribute,
		 "argument of function call might be a candidate for a format attribute");
    }
  return val;
}
tree convert_for_arg_passing ( tree type , tree val ) { tree bitfield_type ; bitfield_type = is_bitfield_expr_with_lowered_type ( val ) ; if ( bitfield_type && TYPE_PRECISION ( TREE_TYPE ( val ) ) < TYPE_PRECISION ( type ) ) val = convert_to_integer ( TYPE_MAIN_VARIANT ( bitfield_type ) , val ) ; if ( val == error_mark_node ) ; else if ( TREE_ADDRESSABLE ( type ) ) val = build1 ( ADDR_EXPR , build_reference_type ( type ) , val ) ; else if ( targetm . calls . promote_prototypes ( type ) && INTEGRAL_TYPE_P ( type ) && COMPLETE_TYPE_P ( type ) && INT_CST_LT_UNSIGNED ( TYPE_SIZE ( type ) , TYPE_SIZE ( integer_type_node ) ) ) val = perform_integral_promotions ( val ) ; if ( warn_missing_format_attribute ) { tree rhstype = TREE_TYPE ( val ) ; const enum tree_code coder = TREE_CODE ( rhstype ) ; const enum tree_code codel = TREE_CODE ( type ) ; if ( ( codel == POINTER_TYPE || codel == REFERENCE_TYPE ) && coder == codel && check_missing_format_attribute ( type , rhstype ) ) warning ( OPT_Wmissing_format_attribute , " " ) ; } return val ; }
Actually perform the appropriate conversion.
Actually perform the appropriate conversion .
/* If VAL is a bitfield, then -- since it has already been converted
     to TYPE -- it cannot have a precision greater than TYPE.  

     If it has a smaller precision, we must widen it here.  For
     example, passing "int f:3;" to a function expecting an "int" will
     not result in any conversion before this point.

     If the precision is the same we must not risk widening.  For
     example, the COMPONENT_REF for a 32-bit "long long" bitfield will
     often have type "int", even though the C++ type for the field is
     "long long".  If the value is being passed to a function
     expecting an "int", then no conversions will be required.  But,
     if we call convert_bitfield_to_declared_type, the bitfield will
     be converted to "long long".  */ /* Pass classes with copy ctors by invisible reference.  */