+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (TYPE_VECTOR): Remove, replace all
+ uses with type::is_vector.
+
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (struct type) <is_vector, set_is_vector>: New methods.
aarch64_type_align (gdbarch *gdbarch, struct type *t)
{
t = check_typedef (t);
- if (t->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (t))
+ if (t->code () == TYPE_CODE_ARRAY && t->is_vector ())
{
/* Use the natural alignment for vector types (the same for
scalar type), but the maximum alignment is 128-bit. */
case TYPE_CODE_ARRAY:
{
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
{
if (TYPE_LENGTH (type) != 8 && TYPE_LENGTH (type) != 16)
return -1;
}
case TYPE_CODE_ARRAY:
- if (TYPE_VECTOR (arg_type))
+ if (arg_type->is_vector ())
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
value_contents (arg));
/* fall through. */
arm_type_align (gdbarch *gdbarch, struct type *t)
{
t = check_typedef (t);
- if (t->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (t))
+ if (t->code () == TYPE_CODE_ARRAY && t->is_vector ())
{
/* Use the natural alignment for vector types (the same for
scalar type), but the maximum alignment is 64-bit. */
case TYPE_CODE_ARRAY:
{
- if (TYPE_VECTOR (t))
+ if (t->is_vector ())
{
/* A 64-bit or 128-bit containerized vector type are VFP
CPRCs. */
&& TYPE_CODE_ARRAY != code && TYPE_CODE_COMPLEX != code)
return 0;
- if (TYPE_CODE_ARRAY == code && TYPE_VECTOR (type))
+ if (TYPE_CODE_ARRAY == code && type->is_vector ())
{
/* Vector values should be returned using ARM registers if they
are not over 16 bytes. */
&& (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
|| code == TYPE_CODE_METHOD
|| (code == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (type))
+ && !type->is_vector ())
|| code == TYPE_CODE_MEMBERPTR
|| code == TYPE_CODE_METHODPTR
|| TYPE_IS_REFERENCE (type))))
case TYPE_CODE_ARRAY:
{
LONGEST low_bound, high_bound;
- int is_vector = TYPE_VECTOR (type);
+ int is_vector = type->is_vector ();
if (passed_a_ptr)
fprintf_filtered (stream, ")");
{
gcc_type result;
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
return context->plugin ().error (_("variably-sized vector type"
" is not supported"));
count = high_bound + 1;
}
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
return context->plugin ().build_vector_type (element_type, count);
return context->plugin ().build_array_type (element_type, count);
}
if (range->bounds ()->high.kind () == PROP_LOCEXPR
|| range->bounds ()->high.kind () == PROP_LOCLIST)
{
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
{
const char *s = _("variably-sized vector type is not supported");
count = high_bound + 1;
}
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
return instance->plugin ().build_vector_type (element_type, count);
return instance->plugin ().build_array_type (element_type, count);
return 1;
case TYPE_CODE_ARRAY:
- return TYPE_VECTOR (type) ? 0 : lang->c_style_arrays;
+ return type->is_vector () ? 0 : lang->c_style_arrays;
default:
return 0;
var = exp->elts[pc + 2].symbol;
type = check_typedef (SYMBOL_TYPE (var));
if (type->code () == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (type)
+ && !type->is_vector ()
&& CAST_IS_CONVERSION (exp->language_defn))
{
(*pos) += 4;
|| type1->has_no_signedness () != type2->has_no_signedness ()
|| TYPE_ENDIANITY_NOT_DEFAULT (type1) != TYPE_ENDIANITY_NOT_DEFAULT (type2)
|| type1->has_varargs () != type2->has_varargs ()
- || TYPE_VECTOR (type1) != TYPE_VECTOR (type2)
+ || type1->is_vector () != type2->is_vector ()
|| TYPE_NOTTEXT (type1) != TYPE_NOTTEXT (type2)
|| TYPE_INSTANCE_FLAGS (type1) != TYPE_INSTANCE_FLAGS (type2)
|| type1->num_fields () != type2->num_fields ())
/* This is used for things like AltiVec registers on ppc. Gcc emits
an attribute for the array type, which tells whether or not we
have a vector, instead of a regular array. */
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
{
puts_filtered (" TYPE_VECTOR");
}
#define TYPE_ENDIANITY_NOT_DEFAULT(t) (TYPE_MAIN_TYPE (t)->flag_endianity_not_default)
-/* * Identify a vector type. Gcc is handling this by adding an extra
- attribute to the array type. We slurp that in as a new flag of a
- type. This is used only in dwarf2read.c. */
-#define TYPE_VECTOR(t) ((t)->is_vector ())
-
/* * The debugging formats (especially STABS) do not contain enough
information to represent all Ada types---especially those whose
size depends on dynamic quantities. Therefore, the GNAT Ada
this->main_type->m_flag_varargs = has_varargs;
}
+ /* Identify a vector type. Gcc is handling this by adding an extra
+ attribute to the array type. We slurp that in as a new flag of a
+ type. This is used only in dwarf2read.c. */
+
bool is_vector () const
{
return this->main_type->m_flag_vector;
static int
i386_m128_p (struct type *type)
{
- return (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ return (type->code () == TYPE_CODE_ARRAY && type->is_vector ()
&& TYPE_LENGTH (type) == 16);
}
aligned to 8-byte boundaries.
7. [...] The caller aligns 128-bit vectors in the parameter area to
16-byte boundaries. */
- if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
return TYPE_LENGTH (type);
/* 4. The caller places all the fields of structures (or unions) with no
vector elements in the parameter area. These structures are 4-byte
{
type = check_typedef (type);
if ((type->code () == TYPE_CODE_DECFLOAT
- || (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)))
+ || (type->code () == TYPE_CODE_ARRAY && type->is_vector ()))
&& TYPE_LENGTH (type) == 16)
return 1;
if (type->code () == TYPE_CODE_ARRAY)
int raw_p;
if (group == all_reggroup)
return 1;
- vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
+ vector_p = register_type (gdbarch, regnum)->is_vector ();
float_p = register_type (gdbarch, regnum)->code () == TYPE_CODE_FLT;
raw_p = regnum < NUM_IA64_RAW_REGS;
if (group == float_reggroup)
they are vectors, in which case we want to leave them alone,
because they are passed by value. */
if (current_language->c_style_arrays)
- if (!TYPE_VECTOR (type))
+ if (!type->is_vector ())
type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
break;
case TYPE_CODE_UNDEF:
common_val_print (val, &format_stream, 0, &opts, current_language);
/* If not a vector register, print it also according to its
natural format. */
- if (print_raw_format && TYPE_VECTOR (regtype) == 0)
+ if (print_raw_format && regtype->is_vector () == 0)
{
pad_to_column (format_stream, value_column_2);
get_user_print_options (&opts);
int pseudo = regnum / gdbarch_num_regs (gdbarch);
if (reggroup == all_reggroup)
return pseudo;
- vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
+ vector_p = register_type (gdbarch, regnum)->is_vector ();
float_p = register_type (gdbarch, regnum)->code () == TYPE_CODE_FLT;
/* FIXME: cagney/2003-04-13: Can't yet use gdbarch_num_regs
(gdbarch), as not all architectures are multi-arch. */
{
LONGEST lowb, highb;
- if (types[i]->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (types[i])
+ if (types[i]->code () == TYPE_CODE_ARRAY && types[i]->is_vector ()
&& get_array_bounds (types[i], &lowb, &highb)
&& TYPE_TARGET_TYPE (types[i])->code () == code
&& TYPE_TARGET_TYPE (types[i])->is_unsigned () == flag_unsigned
struct type *rettype;
struct value *ret;
- if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
{
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type));
LONGEST lowb, highb;
type1 = check_typedef (value_type (val1));
type2 = check_typedef (value_type (val2));
- t1_is_vec = (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1));
- t2_is_vec = (type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2));
+ t1_is_vec = (type1->code () == TYPE_CODE_ARRAY && type1->is_vector ());
+ t2_is_vec = (type2->code () == TYPE_CODE_ARRAY && type2->is_vector ());
if (!t1_is_vec || !t2_is_vec)
error (_("Vector operations are not supported on scalar types"));
|| code2 == TYPE_CODE_DECFLOAT || code2 == TYPE_CODE_ENUM
|| code2 == TYPE_CODE_RANGE);
- if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (to_type) && scalar)
+ if (code1 == TYPE_CODE_ARRAY && to_type->is_vector () && scalar)
{
struct type *eltype;
struct type *type1 = check_typedef (value_type (arg1));
struct type *type2 = check_typedef (value_type (arg2));
int t1_is_vec = (type1->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type1));
+ && type1->is_vector ());
int t2_is_vec = (type2->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type2));
+ && type2->is_vector ());
if (!t1_is_vec && !t2_is_vec)
{
type1 = check_typedef (value_type (arg1));
type2 = check_typedef (value_type (arg2));
- if ((type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
- || (type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)))
+ if ((type1->code () == TYPE_CODE_ARRAY && type1->is_vector ())
+ || (type2->code () == TYPE_CODE_ARRAY && type2->is_vector ()))
{
arg2 = evaluate_subexp (nullptr, exp, pos, noside);
(*pos)++;
arg1 = evaluate_subexp (nullptr, exp, pos, noside);
type1 = check_typedef (value_type (arg1));
- if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
+ if (type1->code () == TYPE_CODE_ARRAY && type1->is_vector ())
{
struct value *arg3, *tmp, *ret;
struct type *eltype2, *type3, *eltype3;
type2 = check_typedef (value_type (arg2));
type3 = check_typedef (value_type (arg3));
t2_is_vec
- = type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2);
+ = type2->code () == TYPE_CODE_ARRAY && type2->is_vector ();
t3_is_vec
- = type3->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type3);
+ = type3->code () == TYPE_CODE_ARRAY && type3->is_vector ();
/* Widen the scalar operand to a vector if necessary. */
if (t2_is_vec || !t3_is_vec)
return value_from_longest (builtin_type (exp->gdbarch)->
builtin_int, 1);
}
- else if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
+ else if (type1->code () == TYPE_CODE_ARRAY && type1->is_vector ())
{
return opencl_component_ref (exp, arg1, &exp->elts[pc + 2].string,
noside);
if (show > 0)
{
type = check_typedef (type);
- if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ if (type->code () == TYPE_CODE_ARRAY && type->is_vector ()
&& type->name () != NULL)
show = 0;
}
if ((valtype->code () == TYPE_CODE_STRUCT
|| valtype->code () == TYPE_CODE_UNION)
&& !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8)
- && TYPE_VECTOR (valtype)))
+ && valtype->is_vector ()))
return RETURN_VALUE_STRUCT_CONVENTION;
else
return ppc_sysv_abi_return_value (gdbarch, function, valtype, regcache,
if ((valtype->code () == TYPE_CODE_STRUCT
|| valtype->code () == TYPE_CODE_UNION)
&& !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8)
- && TYPE_VECTOR (valtype))
+ && valtype->is_vector ())
&& !(TYPE_LENGTH (valtype) == 1
|| TYPE_LENGTH (valtype) == 2
|| TYPE_LENGTH (valtype) == 4
}
else if (len < 16
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& opencl_abi)
{
/* OpenCL vectors shorter than 16 bytes are passed as if
}
else if (len >= 16
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& opencl_abi)
{
/* OpenCL vectors 16 bytes or longer are passed as if
}
else if (len == 16
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
{
/* Vector parameter passed in an Altivec register, or
}
else if (len == 8
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_SPE)
{
/* Vector parameter passed in an e500 register, or when
/* Structs and large values are put in an
aligned stack slot ... */
if (type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& len >= 16)
structoffset = align_up (structoffset, 16);
else
/* OpenCL vectors < 16 bytes are returned as distinct
scalars in f1..f2 or r3..r10. */
if (type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& TYPE_LENGTH (type) < 16
&& opencl_abi)
{
}
/* OpenCL vectors >= 16 bytes are returned in v2..v9. */
if (type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& TYPE_LENGTH (type) >= 16
&& opencl_abi)
{
}
if (TYPE_LENGTH (type) == 16
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
{
if (readbuf)
}
if (TYPE_LENGTH (type) == 16
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_GENERIC)
{
/* GCC -maltivec -mabi=no-altivec returns vectors in r3/r4/r5/r6.
}
if (TYPE_LENGTH (type) == 8
&& type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type)
+ && type->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_SPE)
{
/* The e500 ABI places return values for the 64-bit DSP types
break;
case TYPE_CODE_ARRAY:
- if (TYPE_VECTOR (type))
+ if (type->is_vector ())
{
if (!*field_type)
*field_type = type;
complex types can be elements of homogeneous aggregates. */
if (type->code () == TYPE_CODE_STRUCT
|| type->code () == TYPE_CODE_UNION
- || (type->code () == TYPE_CODE_ARRAY && !TYPE_VECTOR (type)))
+ || (type->code () == TYPE_CODE_ARRAY && !type->is_vector ()))
{
struct type *field_type = NULL;
LONGEST field_count = ppc64_aggregate_candidate (type, &field_type);
ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos);
ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos);
}
- else if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ else if (type->code () == TYPE_CODE_ARRAY && type->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC
&& TYPE_LENGTH (type) == 16)
{
ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 16, argpos);
ppc64_sysv_abi_push_vreg (gdbarch, val, argpos);
}
- else if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ else if (type->code () == TYPE_CODE_ARRAY && type->is_vector ()
&& TYPE_LENGTH (type) >= 16)
{
/* Non-Altivec vectors are passed by reference. */
|| eltype->code () == TYPE_CODE_DECFLOAT)
ppc64_sysv_abi_push_freg (gdbarch, eltype, elval, argpos);
else if (eltype->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (eltype)
+ && eltype->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC
&& TYPE_LENGTH (eltype) == 16)
ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos);
ppc64_sysv_abi_push_param (gdbarch, eltype,
val + TYPE_LENGTH (eltype), &argpos);
}
- else if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ else if (type->code () == TYPE_CODE_ARRAY && type->is_vector ()
&& opencl_abi)
{
/* OpenCL vectors shorter than 16 bytes are passed as if
/* AltiVec vectors are returned in VRs starting at v2. */
if (TYPE_LENGTH (valtype) == 16
- && valtype->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
+ && valtype->code () == TYPE_CODE_ARRAY && valtype->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
{
int regnum = tdep->ppc_vr0_regnum + 2 + index;
/* Short vectors are returned in GPRs starting at r3. */
if (TYPE_LENGTH (valtype) <= 8
- && valtype->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype))
+ && valtype->code () == TYPE_CODE_ARRAY && valtype->is_vector ())
{
int regnum = tdep->ppc_gp0_regnum + 3 + index;
int offset = 0;
/* OpenCL vectors shorter than 16 bytes are returned as if
a series of independent scalars; OpenCL vectors 16 bytes
or longer are returned as if a series of AltiVec vectors. */
- if (valtype->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
+ if (valtype->code () == TYPE_CODE_ARRAY && valtype->is_vector ()
&& opencl_abi)
{
if (TYPE_LENGTH (valtype) < 16)
/* Small character arrays are returned, right justified, in r3. */
if (valtype->code () == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (valtype)
+ && !valtype->is_vector ()
&& TYPE_LENGTH (valtype) <= 8
&& TYPE_TARGET_TYPE (valtype)->code () == TYPE_CODE_INT
&& TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
&& (eltype->code () == TYPE_CODE_FLT
|| eltype->code () == TYPE_CODE_DECFLOAT
|| (eltype->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (eltype)
+ && eltype->is_vector ()
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC
&& TYPE_LENGTH (eltype) == 16)))
{
&& (valtype->code () == TYPE_CODE_STRUCT
|| valtype->code () == TYPE_CODE_UNION
|| (valtype->code () == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (valtype))))
+ && !valtype->is_vector ())))
{
int n_regs = ((TYPE_LENGTH (valtype) + tdep->wordsize - 1)
/ tdep->wordsize);
return 0;
if (group == all_reggroup)
return 1;
- vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
+ vector_p = register_type (gdbarch, regnum)->is_vector ();
float_p = (register_type (gdbarch, regnum)->code () == TYPE_CODE_FLT
|| (register_type (gdbarch, regnum)->code ()
== TYPE_CODE_DECFLOAT));
{
/* If not a vector register, print it also according to its
natural format. */
- if (TYPE_VECTOR (regtype) == 0)
+ if (regtype->is_vector () == 0)
{
get_user_print_options (&opts);
opts.deref_ref = 1;
riscv_type_align (gdbarch *gdbarch, type *type)
{
type = check_typedef (type);
- if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
return std::min (TYPE_LENGTH (type), (ULONGEST) BIGGEST_ALIGNMENT);
/* Anything else will be aligned by the generic code. */
/* AltiVec extension: Functions that declare a vector data type as a
return value place that return value in VR2. */
- if (valtype->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
+ if (valtype->code () == TYPE_CODE_ARRAY && valtype->is_vector ()
&& TYPE_LENGTH (valtype) == 16)
{
if (readbuf)
/* AltiVec extension: Functions that declare a vector data type as a
return value place that return value in VR2. */
- if (valtype->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
+ if (valtype->code () == TYPE_CODE_ARRAY && valtype->is_vector ()
&& TYPE_LENGTH (valtype) == 16)
{
if (readbuf)
return 8;
case TYPE_CODE_ARRAY:
- if (TYPE_VECTOR (t))
+ if (t->is_vector ())
return 8;
break;
}
/* Structs containing just a vector are passed like a vector. */
type = s390_effective_inner_type (type, TYPE_LENGTH (type));
- return type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type);
+ return type->code () == TYPE_CODE_ARRAY && type->is_vector ();
}
/* Determine whether N is a power of two. */
break;
case TYPE_CODE_ARRAY:
rvc = (gdbarch_tdep (gdbarch)->vector_abi == S390_VECTOR_ABI_128
- && TYPE_LENGTH (type) <= 16 && TYPE_VECTOR (type))
+ && TYPE_LENGTH (type) <= 16 && type->is_vector ())
? RETURN_VALUE_REGISTER_CONVENTION
: RETURN_VALUE_STRUCT_CONVENTION;
break;
static bool
sparc_structure_return_p (const struct type *type)
{
- if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
{
/* Float vectors are always returned by memory. */
if (sparc_floating_p (check_typedef (TYPE_TARGET_TYPE (type))))
static bool
sparc_arg_by_memory_p (const struct type *type)
{
- if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
{
/* Float vectors are always passed by memory. */
if (sparc_floating_p (check_typedef (TYPE_TARGET_TYPE (type))))
/* If any of the children of a union are vectors, flag the
union as a vector also. This allows e.g. a union of two
vector types to show up automatically in "info vector". */
- if (TYPE_VECTOR (field_gdb_type))
+ if (field_gdb_type->is_vector ())
m_type->set_is_vector (true);
}
}
vector_type = check_typedef (vector_type);
gdb_assert (vector_type->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (vector_type));
+ && vector_type->is_vector ());
if (!get_array_bounds (vector_type, &low_bound, &high_bound))
error (_("Could not determine the vector bounds"));
type2 = check_typedef (value_type (val2));
t1_is_vec = (type1->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type1)) ? 1 : 0;
+ && type1->is_vector ()) ? 1 : 0;
t2_is_vec = (type2->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type2)) ? 1 : 0;
+ && type2->is_vector ()) ? 1 : 0;
if (!t1_is_vec || !t2_is_vec)
error (_("Vector operations are only supported among vectors"));
struct type *type1 = check_typedef (value_type (arg1));
struct type *type2 = check_typedef (value_type (arg2));
int t1_is_vec = (type1->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type1));
+ && type1->is_vector ());
int t2_is_vec = (type2->code () == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type2));
+ && type2->is_vector ());
if (!t1_is_vec && !t2_is_vec)
val = scalar_binop (arg1, arg2, op);
type = check_typedef (value_type (arg1));
if (is_integral_type (type) || is_floating_value (arg1)
- || (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ || (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
|| type->code () == TYPE_CODE_COMPLEX)
return value_from_contents (type, value_contents (arg1));
else
if (is_integral_type (type) || is_floating_type (type))
return value_binop (value_from_longest (type, 0), arg1, BINOP_SUB);
- else if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ else if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
{
struct value *tmp, *val = allocate_value (type);
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type));
if (is_integral_type (type))
val = value_from_longest (type, ~value_as_long (arg1));
- else if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
+ else if (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
{
struct value *tmp;
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type));
if (current_language->c_style_arrays
&& type2->code () == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (type2))
+ && !type2->is_vector ())
arg2 = value_coerce_array (arg2);
if (type2->code () == TYPE_CODE_FUNC)
minus one, instead of biasing the normal case. */
return value_from_longest (to_type, -1);
}
- else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
- && code2 == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)
+ else if (code1 == TYPE_CODE_ARRAY && type->is_vector ()
+ && code2 == TYPE_CODE_ARRAY && type2->is_vector ()
&& 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
+ else if (code1 == TYPE_CODE_ARRAY && type->is_vector () && scalar
&& TYPE_LENGTH (type) != TYPE_LENGTH (type2))
error (_("can only cast scalar to vector of same size"));
else if (code1 == TYPE_CODE_VOID)
{
val = value_from_longest (type, (LONGEST) 1);
}
- else if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
+ else if (type1->code () == TYPE_CODE_ARRAY && type1->is_vector ())
{
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type1));
int i;
switch (valtype->code ())
{
case TYPE_CODE_ARRAY:
- return TYPE_VECTOR (valtype) ? 0 : 1;
+ return valtype->is_vector () ? 0 : 1;
case TYPE_CODE_STRING:
return true;
default:
switch (type->code ())
{
case TYPE_CODE_ARRAY:
- if (!TYPE_VECTOR (type) && current_language->c_style_arrays)
+ if (!type->is_vector () && current_language->c_style_arrays)
arg = value_coerce_array (arg);
break;
case TYPE_CODE_FUNC: