/* Perform non-arithmetic operations on values, for GDB.
- Copyright (C) 1986-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986-2013 Free Software Foundation, Inc.
This file is part of GDB.
minus one, instead of biasing the normal case. */
return value_from_longest (type, -1);
}
- else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type) && scalar)
- {
- /* Widen the scalar to a vector. */
- struct type *eltype;
- struct value *val;
- LONGEST low_bound, high_bound;
- int i;
-
- if (!get_array_bounds (type, &low_bound, &high_bound))
- error (_("Could not determine the vector bounds"));
-
- eltype = check_typedef (TYPE_TARGET_TYPE (type));
- arg2 = value_cast (eltype, arg2);
- val = allocate_value (type);
-
- for (i = 0; i < high_bound - low_bound + 1; i++)
- {
- /* Duplicate the contents of arg2 into the destination vector. */
- memcpy (value_contents_writeable (val) + (i * TYPE_LENGTH (eltype)),
- value_contents_all (arg2), TYPE_LENGTH (eltype));
- }
- return val;
- }
+ else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ && code2 == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)
+ && TYPE_LENGTH (type) != TYPE_LENGTH (type2))
+ error (_("Cannot convert between vector values of different sizes"));
+ else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type) && scalar
+ && TYPE_LENGTH (type) != TYPE_LENGTH (type2))
+ error (_("can only cast scalar to vector of same size"));
else if (code1 == TYPE_CODE_VOID)
{
return value_zero (type, not_lval);
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
{
int base_offset;
- int skip = 0;
int this_offset;
if (BASETYPE_VIA_VIRTUAL (type, i))
/* Given an array of arguments (ARGS) (which includes an
entry for "this" in the case of C++ methods), the number of
- arguments NARGS, the NAME of a function whether it's a method or
- not (METHOD), and the degree of laxness (LAX) in conforming to
- overload resolution rules in ANSI C++, find the best function that
- matches on the argument types according to the overload resolution
- rules.
+ arguments NARGS, the NAME of a function, and whether it's a method or
+ not (METHOD), find the best function that matches on the argument types
+ according to the overload resolution rules.
METHOD can be one of three values:
NON_METHOD for non-member functions.
int
find_overload_match (struct value **args, int nargs,
const char *name, enum oload_search_type method,
- int lax, struct value **objp, struct symbol *fsym,
+ struct value **objp, struct symbol *fsym,
struct value **valp, struct symbol **symp,
int *staticp, const int no_adl)
{
return 0;
}
-/* Given TYPE, a structure/union,
- return 1 if the component named NAME from the ultimate target
- structure/union is defined, otherwise, return 0. */
-
-int
-check_field (struct type *type, const char *name)
-{
- int i;
-
- /* The type may be a stub. */
- CHECK_TYPEDEF (type);
-
- for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
- {
- const char *t_field_name = TYPE_FIELD_NAME (type, i);
-
- if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
- return 1;
- }
-
- /* C++: If it was not found as a data field, then try to return it
- as a pointer to a method. */
-
- for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
- {
- if (strcmp_iw (TYPE_FN_FIELDLIST_NAME (type, i), name) == 0)
- return 1;
- }
-
- for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- if (check_field (TYPE_BASECLASS (type, i), name))
- return 1;
-
- return 0;
-}
-
/* C++: Given an aggregate type CURTYPE, and a member name NAME,
return the appropriate member (or the address of the member, if
WANT_ADDRESS). This function is used to resolve user expressions