mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:54:41 +08:00
gdb: remove TYPE_VECTOR
gdb/ChangeLog: * gdbtypes.h (TYPE_VECTOR): Remove, replace all uses with type::is_vector. Change-Id: I1ac28755af44b1585c190553f9961288c8fb9137
This commit is contained in:
parent
2062087b35
commit
bd63c87008
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -1393,7 +1393,7 @@ static ULONGEST
|
||||
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. */
|
||||
@ -1453,7 +1453,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
|
||||
|
||||
case TYPE_CODE_ARRAY:
|
||||
{
|
||||
if (TYPE_VECTOR (type))
|
||||
if (type->is_vector ())
|
||||
{
|
||||
if (TYPE_LENGTH (type) != 8 && TYPE_LENGTH (type) != 16)
|
||||
return -1;
|
||||
@ -1760,7 +1760,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
}
|
||||
|
||||
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. */
|
||||
|
@ -3417,7 +3417,7 @@ static ULONGEST
|
||||
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. */
|
||||
@ -3562,7 +3562,7 @@ arm_vfp_cprc_sub_candidate (struct type *t,
|
||||
|
||||
case TYPE_CODE_ARRAY:
|
||||
{
|
||||
if (TYPE_VECTOR (t))
|
||||
if (t->is_vector ())
|
||||
{
|
||||
/* A 64-bit or 128-bit containerized vector type are VFP
|
||||
CPRCs. */
|
||||
@ -8017,7 +8017,7 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type)
|
||||
&& 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. */
|
||||
|
@ -133,7 +133,7 @@ c_print_type_1 (struct type *type,
|
||||
&& (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))))
|
||||
@ -772,7 +772,7 @@ c_type_print_varspec_suffix (struct type *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, ")");
|
||||
|
@ -56,7 +56,7 @@ convert_array (compile_c_instance *context, struct type *type)
|
||||
{
|
||||
gcc_type result;
|
||||
|
||||
if (TYPE_VECTOR (type))
|
||||
if (type->is_vector ())
|
||||
return context->plugin ().error (_("variably-sized vector type"
|
||||
" is not supported"));
|
||||
|
||||
@ -78,7 +78,7 @@ convert_array (compile_c_instance *context, struct type *type)
|
||||
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);
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ compile_cplus_convert_array (compile_cplus_instance *instance,
|
||||
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");
|
||||
|
||||
@ -499,7 +499,7 @@ compile_cplus_convert_array (compile_cplus_instance *instance,
|
||||
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);
|
||||
|
@ -622,7 +622,7 @@ ptrmath_type_p (const struct language_defn *lang, struct type *type)
|
||||
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;
|
||||
@ -3137,7 +3137,7 @@ evaluate_subexp_with_coercion (struct expression *exp,
|
||||
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;
|
||||
|
@ -3993,7 +3993,7 @@ check_types_equal (struct type *type1, struct type *type2,
|
||||
|| 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 ())
|
||||
@ -5095,7 +5095,7 @@ recursive_dump_type (struct type *type, int spaces)
|
||||
/* 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");
|
||||
}
|
||||
|
@ -216,11 +216,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags);
|
||||
|
||||
#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
|
||||
@ -1116,6 +1111,10 @@ struct type
|
||||
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;
|
||||
|
@ -109,7 +109,7 @@ darwin_dwarf_signal_frame_p (struct gdbarch *gdbarch,
|
||||
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);
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ i386_darwin_arg_type_alignment (struct type *type)
|
||||
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
|
||||
|
@ -2636,7 +2636,7 @@ i386_16_byte_align_p (struct type *type)
|
||||
{
|
||||
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)
|
||||
|
@ -329,7 +329,7 @@ ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|
||||
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)
|
||||
|
@ -220,7 +220,7 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg,
|
||||
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:
|
||||
|
@ -2134,7 +2134,7 @@ default_print_one_register_info (struct ui_file *file,
|
||||
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);
|
||||
|
@ -686,7 +686,7 @@ mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|
||||
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. */
|
||||
|
@ -96,7 +96,7 @@ lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
|
||||
{
|
||||
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
|
||||
@ -497,7 +497,7 @@ opencl_logical_not (struct expression *exp, struct value *arg)
|
||||
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;
|
||||
@ -586,8 +586,8 @@ vector_relop (struct expression *exp, struct value *val1, struct value *val2,
|
||||
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"));
|
||||
@ -658,7 +658,7 @@ opencl_value_cast (struct type *type, struct value *arg)
|
||||
|| 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;
|
||||
|
||||
@ -688,9 +688,9 @@ opencl_relop (struct expression *exp, struct value *arg1, struct value *arg2,
|
||||
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)
|
||||
{
|
||||
@ -831,8 +831,8 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp,
|
||||
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);
|
||||
|
||||
@ -867,7 +867,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp,
|
||||
(*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;
|
||||
@ -879,9 +879,9 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp,
|
||||
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)
|
||||
@ -970,7 +970,7 @@ Cannot perform conditional operation on vectors with different sizes"));
|
||||
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);
|
||||
@ -1062,7 +1062,7 @@ public:
|
||||
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;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ ppc_linux_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
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,
|
||||
|
@ -78,7 +78,7 @@ ppcnbsd_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
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
|
||||
|
@ -335,7 +335,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
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
|
||||
@ -422,7 +422,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
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
|
||||
@ -451,7 +451,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
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
|
||||
@ -472,7 +472,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
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
|
||||
@ -509,7 +509,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
/* 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
|
||||
@ -804,7 +804,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
/* 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)
|
||||
{
|
||||
@ -858,7 +858,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
}
|
||||
/* 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)
|
||||
{
|
||||
@ -880,7 +880,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
}
|
||||
if (TYPE_LENGTH (type) == 16
|
||||
&& type->code () == TYPE_CODE_ARRAY
|
||||
&& TYPE_VECTOR (type)
|
||||
&& type->is_vector ()
|
||||
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC)
|
||||
{
|
||||
if (readbuf)
|
||||
@ -897,7 +897,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
}
|
||||
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.
|
||||
@ -921,7 +921,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
}
|
||||
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
|
||||
@ -1101,7 +1101,7 @@ ppc64_aggregate_candidate (struct type *type,
|
||||
break;
|
||||
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (TYPE_VECTOR (type))
|
||||
if (type->is_vector ())
|
||||
{
|
||||
if (!*field_type)
|
||||
*field_type = type;
|
||||
@ -1186,7 +1186,7 @@ ppc64_elfv2_abi_homogeneous_aggregate (struct 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);
|
||||
@ -1428,7 +1428,7 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
|
||||
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)
|
||||
{
|
||||
@ -1436,7 +1436,7 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
|
||||
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. */
|
||||
@ -1520,7 +1520,7 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
|
||||
|| 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);
|
||||
@ -1644,7 +1644,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
|
||||
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
|
||||
@ -1856,7 +1856,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
|
||||
|
||||
/* 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;
|
||||
@ -1870,7 +1870,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
|
||||
|
||||
/* 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;
|
||||
@ -1938,7 +1938,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
/* 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)
|
||||
@ -1975,7 +1975,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
/* 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)
|
||||
@ -1999,7 +1999,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
&& (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)))
|
||||
{
|
||||
@ -2025,7 +2025,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
&& (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);
|
||||
|
@ -201,7 +201,7 @@ default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|
||||
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));
|
||||
|
@ -935,7 +935,7 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
|
||||
{
|
||||
/* 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;
|
||||
@ -1772,7 +1772,7 @@ static ULONGEST
|
||||
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. */
|
||||
|
@ -527,7 +527,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
/* 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)
|
||||
|
@ -274,7 +274,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
/* 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)
|
||||
|
@ -75,7 +75,7 @@ s390_type_align (gdbarch *gdbarch, struct type *t)
|
||||
return 8;
|
||||
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (TYPE_VECTOR (t))
|
||||
if (t->is_vector ())
|
||||
return 8;
|
||||
break;
|
||||
}
|
||||
@ -1697,7 +1697,7 @@ s390_function_arg_vector (struct type *type)
|
||||
/* 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. */
|
||||
@ -2093,7 +2093,7 @@ s390_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
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;
|
||||
|
@ -303,7 +303,7 @@ sparc_structure_or_union_p (const struct type *type)
|
||||
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))))
|
||||
@ -331,7 +331,7 @@ sparc_structure_return_p (const struct 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))))
|
||||
|
@ -263,7 +263,7 @@ make_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *ttype)
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
|
@ -1440,7 +1440,7 @@ value_vector_widen (struct value *scalar_value, struct type *vector_type)
|
||||
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"));
|
||||
@ -1480,9 +1480,9 @@ vector_binop (struct value *val1, struct value *val2, enum exp_opcode op)
|
||||
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"));
|
||||
@ -1525,9 +1525,9 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||
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);
|
||||
@ -1767,7 +1767,7 @@ value_pos (struct value *arg1)
|
||||
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
|
||||
@ -1784,7 +1784,7 @@ value_neg (struct value *arg1)
|
||||
|
||||
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));
|
||||
@ -1826,7 +1826,7 @@ value_complement (struct value *arg1)
|
||||
|
||||
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));
|
||||
|
12
gdb/valops.c
12
gdb/valops.c
@ -416,7 +416,7 @@ value_cast (struct type *type, struct value *arg2)
|
||||
|
||||
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)
|
||||
@ -529,11 +529,11 @@ value_cast (struct type *type, struct value *arg2)
|
||||
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)
|
||||
@ -854,7 +854,7 @@ value_one (struct type *type)
|
||||
{
|
||||
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;
|
||||
@ -1361,7 +1361,7 @@ value_must_coerce_to_target (struct value *val)
|
||||
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:
|
||||
|
@ -3687,7 +3687,7 @@ coerce_array (struct value *arg)
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user