struct value *val = allocate_value (valtype);
/* If the function returns void, don't bother fetching the return
- value. */
+ value. See also "using_struct_return". */
if (TYPE_CODE (valtype) == TYPE_CODE_VOID)
return val;
return val;
}
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
- and TYPE is the type (which is known to be struct, union or array).
+/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
+ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE
+ is the type (which is known to be struct, union or array).
On most machines, the struct convention is used unless we are
using gcc and the type is of a special size. */
if (code == TYPE_CODE_ERROR)
error ("Function return type unknown.");
+ if (code == TYPE_CODE_VOID)
+ /* A void return value is never in memory. See also corresponding
+ code in "register_value_being_returned". */
+ return 0;
+
if (!gdbarch_return_value_p (current_gdbarch))
{
/* FIXME: cagney/2003-10-01: The below is dead. Instead an