gdb: remove TYPE_CODE macro
Remove TYPE_CODE, changing all the call sites to use type::code directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_CODE): Remove. Change all call sites to use type::code instead.
This commit is contained in:
parent
67607e24d0
commit
7813437494
|
@ -1,3 +1,8 @@
|
|||
2020-05-14 Simon Marchi <simon.marchi@efficios.com>
|
||||
|
||||
* gdbtypes.h (TYPE_CODE): Remove. Change all call sites to use
|
||||
type::code instead.
|
||||
|
||||
2020-05-14 Simon Marchi <simon.marchi@efficios.com>
|
||||
|
||||
* gdbtypes.h (struct type) <code, set_code>: New methods.
|
||||
|
|
|
@ -1254,7 +1254,7 @@ static ULONGEST
|
|||
aarch64_type_align (gdbarch *gdbarch, struct type *t)
|
||||
{
|
||||
t = check_typedef (t);
|
||||
if (TYPE_CODE (t) == TYPE_CODE_ARRAY && TYPE_VECTOR (t))
|
||||
if (t->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (t))
|
||||
{
|
||||
/* Use the natural alignment for vector types (the same for
|
||||
scalar type), but the maximum alignment is 128-bit. */
|
||||
|
@ -1283,7 +1283,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
|
|||
if (type == nullptr)
|
||||
return -1;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
if (TYPE_LENGTH (type) > 16)
|
||||
|
@ -1292,7 +1292,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
|
|||
if (*fundamental_type == nullptr)
|
||||
*fundamental_type = type;
|
||||
else if (TYPE_LENGTH (type) != TYPE_LENGTH (*fundamental_type)
|
||||
|| TYPE_CODE (type) != TYPE_CODE (*fundamental_type))
|
||||
|| type->code () != (*fundamental_type)->code ())
|
||||
return -1;
|
||||
|
||||
return 1;
|
||||
|
@ -1306,7 +1306,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
|
|||
if (*fundamental_type == nullptr)
|
||||
*fundamental_type = target_type;
|
||||
else if (TYPE_LENGTH (target_type) != TYPE_LENGTH (*fundamental_type)
|
||||
|| TYPE_CODE (target_type) != TYPE_CODE (*fundamental_type))
|
||||
|| target_type->code () != (*fundamental_type)->code ())
|
||||
return -1;
|
||||
|
||||
return 2;
|
||||
|
@ -1322,7 +1322,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
|
|||
if (*fundamental_type == nullptr)
|
||||
*fundamental_type = type;
|
||||
else if (TYPE_LENGTH (type) != TYPE_LENGTH (*fundamental_type)
|
||||
|| TYPE_CODE (type) != TYPE_CODE (*fundamental_type))
|
||||
|| type->code () != (*fundamental_type)->code ())
|
||||
return -1;
|
||||
|
||||
return 1;
|
||||
|
@ -1449,7 +1449,7 @@ pass_in_x (struct gdbarch *gdbarch, struct regcache *regcache,
|
|||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
int len = TYPE_LENGTH (type);
|
||||
enum type_code typecode = TYPE_CODE (type);
|
||||
enum type_code typecode = type->code ();
|
||||
int regnum = AARCH64_X0_REGNUM + info->ngrn;
|
||||
const bfd_byte *buf = value_contents (arg);
|
||||
|
||||
|
@ -1600,7 +1600,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
|
|||
struct aarch64_call_info *info, struct type *arg_type,
|
||||
struct value *arg)
|
||||
{
|
||||
switch (TYPE_CODE (arg_type))
|
||||
switch (arg_type->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
|
||||
|
@ -1736,7 +1736,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
continue;
|
||||
}
|
||||
|
||||
switch (TYPE_CODE (arg_type))
|
||||
switch (arg_type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_BOOL:
|
||||
|
@ -2120,12 +2120,12 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
|
|||
valbuf += len;
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
||||
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
||||
|| TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
else if (type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_CHAR
|
||||
|| type->code () == TYPE_CODE_BOOL
|
||||
|| type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
|| type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
/* If the type is a plain integer, then the access is
|
||||
straight-forward. Otherwise we have to play around a bit
|
||||
|
@ -2233,12 +2233,12 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
|
|||
valbuf += len;
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
||||
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
||||
|| TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
else if (type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_CHAR
|
||||
|| type->code () == TYPE_CODE_BOOL
|
||||
|| type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
|| type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
if (TYPE_LENGTH (type) <= X_REGISTER_SIZE)
|
||||
{
|
||||
|
@ -2294,9 +2294,9 @@ aarch64_return_value (struct gdbarch *gdbarch, struct value *func_value,
|
|||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
|
||||
if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
|
||||
if (valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION
|
||||
|| valtype->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
if (aarch64_return_in_memory (gdbarch, valtype))
|
||||
{
|
||||
|
|
|
@ -1386,7 +1386,7 @@ convert_char_literal (struct type *type, LONGEST val)
|
|||
if (type == NULL)
|
||||
return val;
|
||||
type = check_typedef (type);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_ENUM)
|
||||
if (type->code () != TYPE_CODE_ENUM)
|
||||
return val;
|
||||
|
||||
if ((val >= 'a' && val <= 'z') || (val >= '0' && val <= '9'))
|
||||
|
|
384
gdb/ada-lang.c
384
gdb/ada-lang.c
File diff suppressed because it is too large
Load Diff
|
@ -431,9 +431,9 @@ read_fat_string_value (char *dest, struct value *val, int max_len)
|
|||
bounds_fieldno = ada_get_field_index (type, "P_BOUNDS", 0);
|
||||
|
||||
bounds_type = TYPE_FIELD_TYPE (type, bounds_fieldno);
|
||||
if (TYPE_CODE (bounds_type) == TYPE_CODE_PTR)
|
||||
if (bounds_type->code () == TYPE_CODE_PTR)
|
||||
bounds_type = TYPE_TARGET_TYPE (bounds_type);
|
||||
if (TYPE_CODE (bounds_type) != TYPE_CODE_STRUCT)
|
||||
if (bounds_type->code () != TYPE_CODE_STRUCT)
|
||||
error (_("Unknown task name format. Aborting"));
|
||||
upper_bound_fieldno = ada_get_field_index (bounds_type, "UB0", 0);
|
||||
|
||||
|
@ -890,10 +890,10 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
|
|||
struct type *eltype = NULL;
|
||||
struct type *idxtype = NULL;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
eltype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
if (eltype != NULL
|
||||
&& TYPE_CODE (eltype) == TYPE_CODE_PTR)
|
||||
&& eltype->code () == TYPE_CODE_PTR)
|
||||
idxtype = check_typedef (TYPE_INDEX_TYPE (type));
|
||||
if (idxtype != NULL
|
||||
&& !TYPE_LOW_BOUND_UNDEFINED (idxtype)
|
||||
|
@ -933,7 +933,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
|
|||
/* Validate. */
|
||||
struct type *type = check_typedef (SYMBOL_TYPE (sym));
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
data->known_tasks_element = type;
|
||||
return;
|
||||
|
|
|
@ -101,7 +101,7 @@ type_is_full_subrange_of_target_type (struct type *type)
|
|||
{
|
||||
struct type *subtype;
|
||||
|
||||
if (TYPE_CODE (type) != TYPE_CODE_RANGE)
|
||||
if (type->code () != TYPE_CODE_RANGE)
|
||||
return 0;
|
||||
|
||||
subtype = TYPE_TARGET_TYPE (type);
|
||||
|
@ -146,7 +146,7 @@ print_range (struct type *type, struct ui_file *stream,
|
|||
type = TYPE_TARGET_TYPE (type);
|
||||
}
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_RANGE:
|
||||
case TYPE_CODE_ENUM:
|
||||
|
@ -208,7 +208,7 @@ print_range_bound (struct type *type, const char *bounds, int *n,
|
|||
to indicate default output when we detect that the bound is negative,
|
||||
and the type is a TYPE_CODE_INT. The bound is negative when
|
||||
'm' is the last character of the number scanned in BOUNDS. */
|
||||
if (bounds[*n - 1] == 'm' && TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
if (bounds[*n - 1] == 'm' && type->code () == TYPE_CODE_INT)
|
||||
type = NULL;
|
||||
ada_print_scalar (type, B, stream);
|
||||
if (bounds[*n] == '_')
|
||||
|
@ -270,7 +270,7 @@ print_range_type (struct type *raw_type, struct ui_file *stream,
|
|||
name = TYPE_NAME (raw_type);
|
||||
gdb_assert (name != NULL);
|
||||
|
||||
if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE)
|
||||
if (raw_type->code () == TYPE_CODE_RANGE)
|
||||
base_type = TYPE_TARGET_TYPE (raw_type);
|
||||
else
|
||||
base_type = raw_type;
|
||||
|
@ -402,7 +402,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
|
|||
bitsize = 0;
|
||||
if (range_desc_type == NULL)
|
||||
{
|
||||
for (arr_type = type; TYPE_CODE (arr_type) == TYPE_CODE_ARRAY;
|
||||
for (arr_type = type; arr_type->code () == TYPE_CODE_ARRAY;
|
||||
arr_type = TYPE_TARGET_TYPE (arr_type))
|
||||
{
|
||||
if (arr_type != type)
|
||||
|
@ -552,10 +552,10 @@ print_variant_clauses (struct type *type, int field_num,
|
|||
var_type = TYPE_FIELD_TYPE (type, field_num);
|
||||
discr_type = ada_variant_discrim_type (var_type, outer_type);
|
||||
|
||||
if (TYPE_CODE (var_type) == TYPE_CODE_PTR)
|
||||
if (var_type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
var_type = TYPE_TARGET_TYPE (var_type);
|
||||
if (var_type == NULL || TYPE_CODE (var_type) != TYPE_CODE_UNION)
|
||||
if (var_type == NULL || var_type->code () != TYPE_CODE_UNION)
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -898,7 +898,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
|
|||
int i, len = TYPE_NFIELDS (type);
|
||||
|
||||
if (TYPE_TARGET_TYPE (type) != NULL
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
|
||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID)
|
||||
fprintf_filtered (stream, "procedure");
|
||||
else
|
||||
fprintf_filtered (stream, "function");
|
||||
|
@ -928,7 +928,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
|
|||
|
||||
if (TYPE_TARGET_TYPE (type) == NULL)
|
||||
fprintf_filtered (stream, " return <unknown return type>");
|
||||
else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
|
||||
else if (TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
fprintf_filtered (stream, " return ");
|
||||
ada_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, 0, flags);
|
||||
|
@ -970,7 +970,7 @@ ada_print_type (struct type *type0, const char *varstring,
|
|||
if (show > 0)
|
||||
type = ada_check_typedef (type);
|
||||
|
||||
if (is_var_decl && TYPE_CODE (type) != TYPE_CODE_FUNC)
|
||||
if (is_var_decl && type->code () != TYPE_CODE_FUNC)
|
||||
fprintf_filtered (stream, "%.*s: ",
|
||||
ada_name_prefix_len (varstring), varstring);
|
||||
|
||||
|
@ -984,10 +984,10 @@ ada_print_type (struct type *type0, const char *varstring,
|
|||
if (ada_is_aligner_type (type))
|
||||
ada_print_type (ada_aligned_type (type), "", stream, show, level, flags);
|
||||
else if (ada_is_constrained_packed_array_type (type)
|
||||
&& TYPE_CODE (type) != TYPE_CODE_PTR)
|
||||
&& type->code () != TYPE_CODE_PTR)
|
||||
print_array_type (type, stream, show, level, flags);
|
||||
else
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
default:
|
||||
fprintf_filtered (stream, "<");
|
||||
|
|
|
@ -41,7 +41,7 @@ static int print_field_values (struct value *, struct value *,
|
|||
static void
|
||||
adjust_type_signedness (struct type *type)
|
||||
{
|
||||
if (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE
|
||||
if (type != NULL && type->code () == TYPE_CODE_RANGE
|
||||
&& TYPE_LOW_BOUND (type) >= 0)
|
||||
TYPE_UNSIGNED (type) = 1;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
|
|||
|
||||
index_type = TYPE_INDEX_TYPE (type);
|
||||
|
||||
while (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
|
||||
while (index_type->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
/* We need to know what the base type is, in order to do the
|
||||
appropriate check below. Otherwise, if this is a subrange
|
||||
|
@ -84,7 +84,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
|
|||
}
|
||||
|
||||
/* Don't print the lower bound if it's the default one. */
|
||||
switch (TYPE_CODE (index_type))
|
||||
switch (index_type->code ())
|
||||
{
|
||||
case TYPE_CODE_BOOL:
|
||||
case TYPE_CODE_CHAR:
|
||||
|
@ -141,12 +141,12 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
|
|||
else
|
||||
len = high - low + 1;
|
||||
|
||||
if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
|
||||
if (index_type->code () == TYPE_CODE_RANGE)
|
||||
base_index_type = TYPE_TARGET_TYPE (index_type);
|
||||
else
|
||||
base_index_type = index_type;
|
||||
|
||||
if (TYPE_CODE (base_index_type) == TYPE_CODE_ENUM)
|
||||
if (base_index_type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
LONGEST low_pos, high_pos;
|
||||
|
||||
|
@ -396,7 +396,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
|
|||
|
||||
type = ada_check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
|
||||
case TYPE_CODE_ENUM:
|
||||
|
@ -749,13 +749,13 @@ ada_val_print_gnat_array (struct value *val,
|
|||
of the case where ADDRESS is meaningless because original_value
|
||||
was not an lval. */
|
||||
val = coerce_ref (val);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF) /* array access type. */
|
||||
if (type->code () == TYPE_CODE_TYPEDEF) /* array access type. */
|
||||
val = ada_coerce_to_simple_array_ptr (val);
|
||||
else
|
||||
val = ada_coerce_to_simple_array (val);
|
||||
if (val == NULL)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_TYPEDEF);
|
||||
gdb_assert (type->code () == TYPE_CODE_TYPEDEF);
|
||||
fprintf_filtered (stream, "0x0");
|
||||
}
|
||||
else
|
||||
|
@ -805,10 +805,10 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
|
|||
fputs_filtered (str.c_str (), stream);
|
||||
return;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_RANGE
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ENUM
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_BOOL
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CHAR))
|
||||
else if (type->code () == TYPE_CODE_RANGE
|
||||
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ENUM
|
||||
|| TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_BOOL
|
||||
|| TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR))
|
||||
{
|
||||
/* For enum-valued ranges, we want to recurse, because we'll end
|
||||
up printing the constant's name rather than its numeric
|
||||
|
@ -992,7 +992,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
|
|||
struct value *deref_val;
|
||||
CORE_ADDR deref_val_int;
|
||||
|
||||
if (TYPE_CODE (elttype) == TYPE_CODE_UNDEF)
|
||||
if (elttype->code () == TYPE_CODE_UNDEF)
|
||||
{
|
||||
fputs_styled ("<ref to undefined type>", metadata_style.style (),
|
||||
stream);
|
||||
|
@ -1048,7 +1048,7 @@ ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
|
|||
|
||||
if (ada_is_array_descriptor_type (type)
|
||||
|| (ada_is_constrained_packed_array_type (type)
|
||||
&& TYPE_CODE (type) != TYPE_CODE_PTR))
|
||||
&& type->code () != TYPE_CODE_PTR))
|
||||
{
|
||||
ada_val_print_gnat_array (val, stream, recurse, options);
|
||||
return;
|
||||
|
@ -1069,7 +1069,7 @@ ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
|
|||
deprecated_set_value_type (val, type);
|
||||
}
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
default:
|
||||
common_val_print (val, stream, recurse, options,
|
||||
|
@ -1145,12 +1145,12 @@ ada_value_print (struct value *val0, struct ui_file *stream,
|
|||
struct value_print_options opts;
|
||||
|
||||
/* If it is a pointer, indicate what it points to. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
/* Hack: don't print (char *) for char strings. Their
|
||||
type is indicated by the quoted string anyway. */
|
||||
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char)
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_INT
|
||||
|| TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_INT
|
||||
|| TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
|
||||
{
|
||||
fprintf_filtered (stream, "(");
|
||||
|
@ -1163,7 +1163,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
|
|||
/* We do not print the type description unless TYPE is an array
|
||||
access type (this is encoded by the compiler as a typedef to
|
||||
a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
|
||||
if (type->code () == TYPE_CODE_TYPEDEF)
|
||||
{
|
||||
fprintf_filtered (stream, "(");
|
||||
type_print (type, "", stream, -1);
|
||||
|
|
|
@ -132,11 +132,11 @@ ada_varobj_ind (struct value *parent_value,
|
|||
ada_get_decoded_value would have transformed our parent_type
|
||||
into a simple array pointer type. */
|
||||
gdb_assert (parent_value == NULL);
|
||||
gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF);
|
||||
gdb_assert (parent_type->code () == TYPE_CODE_TYPEDEF);
|
||||
|
||||
/* Decode parent_type by the equivalent pointer to (decoded)
|
||||
array. */
|
||||
while (TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF)
|
||||
while (parent_type->code () == TYPE_CODE_TYPEDEF)
|
||||
parent_type = TYPE_TARGET_TYPE (parent_type);
|
||||
parent_type = ada_coerce_to_simple_array_type (parent_type);
|
||||
parent_type = lookup_pointer_type (parent_type);
|
||||
|
@ -206,9 +206,9 @@ ada_varobj_adjust_for_child_access (struct value **value,
|
|||
one child (the struct), their children are the components of
|
||||
the struct/union type. We handle this situation by dereferencing
|
||||
the (value, type) couple. */
|
||||
if (TYPE_CODE (*type) == TYPE_CODE_PTR
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (*type)) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (*type)) == TYPE_CODE_UNION)
|
||||
if ((*type)->code () == TYPE_CODE_PTR
|
||||
&& (TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_STRUCT
|
||||
|| TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_UNION)
|
||||
&& !ada_is_array_descriptor_type (TYPE_TARGET_TYPE (*type))
|
||||
&& !ada_is_constrained_packed_array_type (TYPE_TARGET_TYPE (*type)))
|
||||
ada_varobj_ind (*value, *type, value, type);
|
||||
|
@ -270,8 +270,8 @@ ada_varobj_get_struct_number_of_children (struct value *parent_value,
|
|||
int n_children = 0;
|
||||
int i;
|
||||
|
||||
gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (parent_type) == TYPE_CODE_UNION);
|
||||
gdb_assert (parent_type->code () == TYPE_CODE_STRUCT
|
||||
|| parent_type->code () == TYPE_CODE_UNION);
|
||||
|
||||
for (i = 0; i < TYPE_NFIELDS (parent_type); i++)
|
||||
{
|
||||
|
@ -329,8 +329,8 @@ ada_varobj_get_ptr_number_of_children (struct value *parent_value,
|
|||
|
||||
/* Pointer to functions and to void do not have a child, since
|
||||
you cannot print what they point to. */
|
||||
if (TYPE_CODE (child_type) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (child_type) == TYPE_CODE_VOID)
|
||||
if (child_type->code () == TYPE_CODE_FUNC
|
||||
|| child_type->code () == TYPE_CODE_VOID)
|
||||
return 0;
|
||||
|
||||
/* All other types have 1 child. */
|
||||
|
@ -353,16 +353,16 @@ ada_varobj_get_number_of_children (struct value *parent_value,
|
|||
if (ada_is_access_to_unconstrained_array (parent_type))
|
||||
return 1;
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY)
|
||||
if (parent_type->code () == TYPE_CODE_ARRAY)
|
||||
return ada_varobj_get_array_number_of_children (parent_value,
|
||||
parent_type);
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (parent_type) == TYPE_CODE_UNION)
|
||||
if (parent_type->code () == TYPE_CODE_STRUCT
|
||||
|| parent_type->code () == TYPE_CODE_UNION)
|
||||
return ada_varobj_get_struct_number_of_children (parent_value,
|
||||
parent_type);
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_PTR)
|
||||
if (parent_type->code () == TYPE_CODE_PTR)
|
||||
return ada_varobj_get_ptr_number_of_children (parent_value,
|
||||
parent_type);
|
||||
|
||||
|
@ -418,8 +418,8 @@ ada_varobj_describe_struct_child (struct value *parent_value,
|
|||
int fieldno;
|
||||
int childno = 0;
|
||||
|
||||
gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (parent_type) == TYPE_CODE_UNION);
|
||||
gdb_assert (parent_type->code () == TYPE_CODE_STRUCT
|
||||
|| parent_type->code () == TYPE_CODE_UNION);
|
||||
|
||||
for (fieldno = 0; fieldno < TYPE_NFIELDS (parent_type); fieldno++)
|
||||
{
|
||||
|
@ -587,7 +587,7 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
|
|||
struct type *index_type;
|
||||
int real_index;
|
||||
|
||||
gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY);
|
||||
gdb_assert (parent_type->code () == TYPE_CODE_ARRAY);
|
||||
|
||||
index_type = TYPE_INDEX_TYPE (parent_type);
|
||||
real_index = child_index + ada_discrete_type_low_bound (index_type);
|
||||
|
@ -627,11 +627,11 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
|
|||
std::string decoded;
|
||||
|
||||
/* If the index type is a range type, find the base type. */
|
||||
while (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
|
||||
while (index_type->code () == TYPE_CODE_RANGE)
|
||||
index_type = TYPE_TARGET_TYPE (index_type);
|
||||
|
||||
if (TYPE_CODE (index_type) == TYPE_CODE_ENUM
|
||||
|| TYPE_CODE (index_type) == TYPE_CODE_BOOL)
|
||||
if (index_type->code () == TYPE_CODE_ENUM
|
||||
|| index_type->code () == TYPE_CODE_BOOL)
|
||||
{
|
||||
index_type_name = ada_type_name (index_type);
|
||||
if (index_type_name)
|
||||
|
@ -693,7 +693,7 @@ ada_varobj_describe_child (struct value *parent_value,
|
|||
return;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY)
|
||||
if (parent_type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
ada_varobj_describe_simple_array_child
|
||||
(parent_value, parent_type, parent_name, parent_path_expr,
|
||||
|
@ -702,8 +702,8 @@ ada_varobj_describe_child (struct value *parent_value,
|
|||
return;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (parent_type) == TYPE_CODE_UNION)
|
||||
if (parent_type->code () == TYPE_CODE_STRUCT
|
||||
|| parent_type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
ada_varobj_describe_struct_child (parent_value, parent_type,
|
||||
parent_name, parent_path_expr,
|
||||
|
@ -713,7 +713,7 @@ ada_varobj_describe_child (struct value *parent_value,
|
|||
return;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_PTR)
|
||||
if (parent_type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
ada_varobj_describe_ptr_child (parent_value, parent_type,
|
||||
parent_name, parent_path_expr,
|
||||
|
@ -856,7 +856,7 @@ ada_varobj_get_value_of_variable (struct value *value,
|
|||
{
|
||||
ada_varobj_decode_var (&value, &type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
|
@ -939,7 +939,7 @@ ada_value_is_changeable_p (const struct varobj *var)
|
|||
struct type *type = (var->value != nullptr
|
||||
? value_type (var->value.get ()) : var->type);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
if (type->code () == TYPE_CODE_REF)
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
|
||||
if (ada_is_access_to_unconstrained_array (type))
|
||||
|
|
|
@ -327,7 +327,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
|
||||
/* Cast argument to long if necessary as the compiler does it too. */
|
||||
switch (TYPE_CODE (arg_type))
|
||||
switch (arg_type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_BOOL:
|
||||
|
@ -478,7 +478,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
|
|||
gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
|
||||
ULONGEST l;
|
||||
|
||||
switch (TYPE_CODE (valtype))
|
||||
switch (valtype->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
switch (TYPE_LENGTH (valtype))
|
||||
|
@ -546,7 +546,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
|
|||
gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
|
||||
ULONGEST l;
|
||||
|
||||
switch (TYPE_CODE (valtype))
|
||||
switch (valtype->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
switch (TYPE_LENGTH (valtype))
|
||||
|
@ -614,7 +614,7 @@ alpha_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *type, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
|
||||
if ((code == TYPE_CODE_STRUCT
|
||||
|| code == TYPE_CODE_UNION
|
||||
|
|
|
@ -546,8 +546,8 @@ static void amd64_classify (struct type *type, enum amd64_reg_class theclass[2])
|
|||
static bool
|
||||
amd64_has_unaligned_fields (struct type *type)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
for (int i = 0; i < TYPE_NFIELDS (type); i++)
|
||||
{
|
||||
|
@ -603,8 +603,8 @@ amd64_classify_aggregate_field (struct type *type, int i,
|
|||
if (field_is_static (&TYPE_FIELD (type, i)) || bitsize == 0)
|
||||
return;
|
||||
|
||||
if (TYPE_CODE (subtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (subtype) == TYPE_CODE_UNION)
|
||||
if (subtype->code () == TYPE_CODE_STRUCT
|
||||
|| subtype->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
/* Each field of an object is classified recursively. */
|
||||
int j;
|
||||
|
@ -667,7 +667,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
|
|||
calculated according to the classes of the fields in the
|
||||
eightbyte: */
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
struct type *subtype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
|
@ -681,8 +681,8 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
|
|||
int i;
|
||||
|
||||
/* Structure or union. */
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
|
||||
for (i = 0; i < TYPE_NFIELDS (type); i++)
|
||||
amd64_classify_aggregate_field (type, i, theclass, 0);
|
||||
|
@ -708,7 +708,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
|
|||
static void
|
||||
amd64_classify (struct type *type, enum amd64_reg_class theclass[2])
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
||||
theclass[0] = theclass[1] = AMD64_NO_CLASS;
|
||||
|
|
|
@ -48,7 +48,7 @@ static int amd64_windows_dummy_call_integer_regs[] =
|
|||
static int
|
||||
amd64_windows_passed_by_integer_register (struct type *type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_ENUM:
|
||||
|
@ -76,8 +76,8 @@ amd64_windows_passed_by_integer_register (struct type *type)
|
|||
static int
|
||||
amd64_windows_passed_by_xmm_register (struct type *type)
|
||||
{
|
||||
return ((TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
|
||||
return ((type->code () == TYPE_CODE_FLT
|
||||
|| type->code () == TYPE_CODE_DECFLOAT)
|
||||
&& (TYPE_LENGTH (type) == 4 || TYPE_LENGTH (type) == 8));
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
|
||||
/* See if our value is returned through a register. If it is, then
|
||||
store the associated register number in REGNUM. */
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
case TYPE_CODE_DECFLOAT:
|
||||
|
|
|
@ -893,8 +893,8 @@ arc_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
function passes a hidden first parameter to the callee (in R0). That
|
||||
parameter is the address at which the value being returned should be
|
||||
stored. Otherwise, the result is returned in registers. */
|
||||
int is_struct_return = (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
||||
int is_struct_return = (valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION
|
||||
|| TYPE_LENGTH (valtype) > 2 * ARC_REGISTER_SIZE);
|
||||
|
||||
if (arc_debug)
|
||||
|
@ -1916,7 +1916,7 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc,
|
|||
static ULONGEST
|
||||
arc_type_align (struct gdbarch *gdbarch, struct type *type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_FUNC:
|
||||
|
|
|
@ -3306,7 +3306,7 @@ static ULONGEST
|
|||
arm_type_align (gdbarch *gdbarch, struct type *t)
|
||||
{
|
||||
t = check_typedef (t);
|
||||
if (TYPE_CODE (t) == TYPE_CODE_ARRAY && TYPE_VECTOR (t))
|
||||
if (t->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (t))
|
||||
{
|
||||
/* Use the natural alignment for vector types (the same for
|
||||
scalar type), but the maximum alignment is 64-bit. */
|
||||
|
@ -3393,7 +3393,7 @@ arm_vfp_cprc_sub_candidate (struct type *t,
|
|||
enum arm_vfp_cprc_base_type *base_type)
|
||||
{
|
||||
t = check_typedef (t);
|
||||
switch (TYPE_CODE (t))
|
||||
switch (t->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
switch (TYPE_LENGTH (t))
|
||||
|
@ -3615,7 +3615,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
/* Determine the type of this function and whether the VFP ABI
|
||||
applies. */
|
||||
ftype = check_typedef (value_type (function));
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_PTR)
|
||||
if (ftype->code () == TYPE_CODE_PTR)
|
||||
ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
|
||||
use_vfp_abi = arm_vfp_abi_for_function (gdbarch, ftype);
|
||||
|
||||
|
@ -3660,7 +3660,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
arg_type = check_typedef (value_type (args[argnum]));
|
||||
len = TYPE_LENGTH (arg_type);
|
||||
target_type = TYPE_TARGET_TYPE (arg_type);
|
||||
typecode = TYPE_CODE (arg_type);
|
||||
typecode = arg_type->code ();
|
||||
val = value_contents (args[argnum]);
|
||||
|
||||
align = type_align (arg_type);
|
||||
|
@ -3758,7 +3758,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
the THUMB bit in it. */
|
||||
if (TYPE_CODE_PTR == typecode
|
||||
&& target_type != NULL
|
||||
&& TYPE_CODE_FUNC == TYPE_CODE (check_typedef (target_type)))
|
||||
&& TYPE_CODE_FUNC == check_typedef (target_type)->code ())
|
||||
{
|
||||
CORE_ADDR regval = extract_unsigned_integer (val, len, byte_order);
|
||||
if (arm_pc_is_thumb (gdbarch, regval))
|
||||
|
@ -3990,7 +3990,7 @@ arm_register_type (struct gdbarch *gdbarch, int regnum)
|
|||
struct type *t = tdesc_register_type (gdbarch, regnum);
|
||||
|
||||
if (regnum >= ARM_D0_REGNUM && regnum < ARM_D0_REGNUM + 32
|
||||
&& TYPE_CODE (t) == TYPE_CODE_FLT
|
||||
&& t->code () == TYPE_CODE_FLT
|
||||
&& gdbarch_tdep (gdbarch)->have_neon)
|
||||
return arm_neon_double_type (gdbarch);
|
||||
else
|
||||
|
@ -7805,7 +7805,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
|
|||
struct gdbarch *gdbarch = regs->arch ();
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
|
||||
if (TYPE_CODE_FLT == TYPE_CODE (type))
|
||||
if (TYPE_CODE_FLT == type->code ())
|
||||
{
|
||||
switch (gdbarch_tdep (gdbarch)->fp_model)
|
||||
{
|
||||
|
@ -7840,12 +7840,12 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
||||
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
||||
|| TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
else if (type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_CHAR
|
||||
|| type->code () == TYPE_CODE_BOOL
|
||||
|| type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
|| type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
/* If the type is a plain integer, then the access is
|
||||
straight-forward. Otherwise we have to play around a bit
|
||||
|
@ -7901,7 +7901,7 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type)
|
|||
|
||||
/* Simple, non-aggregate types (ie not including vectors and
|
||||
complex) are always returned in a register (or registers). */
|
||||
code = TYPE_CODE (type);
|
||||
code = type->code ();
|
||||
if (TYPE_CODE_STRUCT != code && TYPE_CODE_UNION != code
|
||||
&& TYPE_CODE_ARRAY != code && TYPE_CODE_COMPLEX != code)
|
||||
return 0;
|
||||
|
@ -7975,8 +7975,7 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type)
|
|||
enum type_code field_type_code;
|
||||
|
||||
field_type_code
|
||||
= TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type,
|
||||
i)));
|
||||
= check_typedef (TYPE_FIELD_TYPE (type, i))->code ();
|
||||
|
||||
/* Is it a floating point type field? */
|
||||
if (field_type_code == TYPE_CODE_FLT)
|
||||
|
@ -8014,7 +8013,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
|
|||
struct gdbarch *gdbarch = regs->arch ();
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
gdb_byte buf[ARM_FP_REGISTER_SIZE];
|
||||
|
||||
|
@ -8044,12 +8043,12 @@ arm_store_return_value (struct type *type, struct regcache *regs,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
||||
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
||||
|| TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
else if (type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_CHAR
|
||||
|| type->code () == TYPE_CODE_BOOL
|
||||
|| type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
|| type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
if (TYPE_LENGTH (type) <= 4)
|
||||
{
|
||||
|
@ -8145,15 +8144,15 @@ arm_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
|
||||
if (valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION
|
||||
|| valtype->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
if (tdep->struct_return == pcc_struct_return
|
||||
|| arm_return_in_memory (gdbarch, valtype))
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
}
|
||||
else if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX)
|
||||
else if (valtype->code () == TYPE_CODE_COMPLEX)
|
||||
{
|
||||
if (arm_return_in_memory (gdbarch, valtype))
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
|
|
|
@ -314,8 +314,8 @@ avr_address_to_pointer (struct gdbarch *gdbarch,
|
|||
avr_convert_iaddr_to_raw (addr));
|
||||
}
|
||||
/* Is it a code address? */
|
||||
else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD)
|
||||
else if (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC
|
||||
|| TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_METHOD)
|
||||
{
|
||||
/* A code pointer is word (16 bits) addressed. We shift the address down
|
||||
by 1 bit to convert it to a pointer. */
|
||||
|
@ -345,8 +345,8 @@ avr_pointer_to_address (struct gdbarch *gdbarch,
|
|||
return avr_make_iaddr (addr);
|
||||
}
|
||||
/* Is it a code address? */
|
||||
else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD
|
||||
else if (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC
|
||||
|| TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_METHOD
|
||||
|| TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)))
|
||||
{
|
||||
/* A code pointer is word (16 bits) addressed so we shift it up
|
||||
|
@ -935,9 +935,9 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
register holds the LSB. */
|
||||
int lsb_reg;
|
||||
|
||||
if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
|
||||
if ((valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION
|
||||
|| valtype->code () == TYPE_CODE_ARRAY)
|
||||
&& TYPE_LENGTH (valtype) > 8)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
|
||||
|
|
74
gdb/ax-gdb.c
74
gdb/ax-gdb.c
|
@ -362,7 +362,7 @@ gen_traced_pop (struct agent_expr *ax, struct axs_value *value)
|
|||
{
|
||||
int string_trace = 0;
|
||||
if (ax->trace_string
|
||||
&& TYPE_CODE (value->type) == TYPE_CODE_PTR
|
||||
&& value->type->code () == TYPE_CODE_PTR
|
||||
&& c_textual_element_type (check_typedef (TYPE_TARGET_TYPE (value->type)),
|
||||
's'))
|
||||
string_trace = 1;
|
||||
|
@ -429,8 +429,8 @@ gen_traced_pop (struct agent_expr *ax, struct axs_value *value)
|
|||
|
||||
/* To trace C++ classes with static fields stored elsewhere. */
|
||||
if (ax->tracing
|
||||
&& (TYPE_CODE (value->type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (value->type) == TYPE_CODE_UNION))
|
||||
&& (value->type->code () == TYPE_CODE_STRUCT
|
||||
|| value->type->code () == TYPE_CODE_UNION))
|
||||
gen_trace_static_fields (ax, value->type);
|
||||
}
|
||||
|
||||
|
@ -474,10 +474,10 @@ gen_fetch (struct agent_expr *ax, struct type *type)
|
|||
ax_trace_quick (ax, TYPE_LENGTH (type));
|
||||
}
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_RANGE)
|
||||
if (type->code () == TYPE_CODE_RANGE)
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_REF:
|
||||
|
@ -775,10 +775,10 @@ require_rvalue (struct agent_expr *ax, struct axs_value *value)
|
|||
/* Only deal with scalars, structs and such may be too large
|
||||
to fit in a stack entry. */
|
||||
value->type = check_typedef (value->type);
|
||||
if (TYPE_CODE (value->type) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (value->type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (value->type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (value->type) == TYPE_CODE_FUNC)
|
||||
if (value->type->code () == TYPE_CODE_ARRAY
|
||||
|| value->type->code () == TYPE_CODE_STRUCT
|
||||
|| value->type->code () == TYPE_CODE_UNION
|
||||
|| value->type->code () == TYPE_CODE_FUNC)
|
||||
error (_("Value not scalar: cannot be an rvalue."));
|
||||
|
||||
switch (value->kind)
|
||||
|
@ -831,7 +831,7 @@ gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
|
|||
the stack. Should we tweak the type? */
|
||||
|
||||
/* Some types require special handling. */
|
||||
switch (TYPE_CODE (value->type))
|
||||
switch (value->type->code ())
|
||||
{
|
||||
/* Functions get converted to a pointer to the function. */
|
||||
case TYPE_CODE_FUNC:
|
||||
|
@ -943,8 +943,8 @@ gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
|
|||
struct axs_value *value2)
|
||||
{
|
||||
/* Do the usual binary conversions. */
|
||||
if (TYPE_CODE (value1->type) == TYPE_CODE_INT
|
||||
&& TYPE_CODE (value2->type) == TYPE_CODE_INT)
|
||||
if (value1->type->code () == TYPE_CODE_INT
|
||||
&& value2->type->code () == TYPE_CODE_INT)
|
||||
{
|
||||
/* The ANSI integral promotions seem to work this way: Order the
|
||||
integer types by size, and then by signedness: an n-bit
|
||||
|
@ -1003,7 +1003,7 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
|
|||
/* Dereference typedefs. */
|
||||
type = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_REF:
|
||||
|
@ -1070,7 +1070,7 @@ gen_ptradd (struct agent_expr *ax, struct axs_value *value,
|
|||
struct axs_value *value1, struct axs_value *value2)
|
||||
{
|
||||
gdb_assert (pointer_type (value1->type));
|
||||
gdb_assert (TYPE_CODE (value2->type) == TYPE_CODE_INT);
|
||||
gdb_assert (value2->type->code () == TYPE_CODE_INT);
|
||||
|
||||
gen_scale (ax, aop_mul, value1->type);
|
||||
ax_simple (ax, aop_add);
|
||||
|
@ -1086,7 +1086,7 @@ gen_ptrsub (struct agent_expr *ax, struct axs_value *value,
|
|||
struct axs_value *value1, struct axs_value *value2)
|
||||
{
|
||||
gdb_assert (pointer_type (value1->type));
|
||||
gdb_assert (TYPE_CODE (value2->type) == TYPE_CODE_INT);
|
||||
gdb_assert (value2->type->code () == TYPE_CODE_INT);
|
||||
|
||||
gen_scale (ax, aop_mul, value1->type);
|
||||
ax_simple (ax, aop_sub);
|
||||
|
@ -1158,8 +1158,8 @@ gen_binop (struct agent_expr *ax, struct axs_value *value,
|
|||
int may_carry, const char *name)
|
||||
{
|
||||
/* We only handle INT op INT. */
|
||||
if ((TYPE_CODE (value1->type) != TYPE_CODE_INT)
|
||||
|| (TYPE_CODE (value2->type) != TYPE_CODE_INT))
|
||||
if ((value1->type->code () != TYPE_CODE_INT)
|
||||
|| (value2->type->code () != TYPE_CODE_INT))
|
||||
error (_("Invalid combination of types in %s."), name);
|
||||
|
||||
ax_simple (ax,
|
||||
|
@ -1175,8 +1175,8 @@ static void
|
|||
gen_logical_not (struct agent_expr *ax, struct axs_value *value,
|
||||
struct type *result_type)
|
||||
{
|
||||
if (TYPE_CODE (value->type) != TYPE_CODE_INT
|
||||
&& TYPE_CODE (value->type) != TYPE_CODE_PTR)
|
||||
if (value->type->code () != TYPE_CODE_INT
|
||||
&& value->type->code () != TYPE_CODE_PTR)
|
||||
error (_("Invalid type of operand to `!'."));
|
||||
|
||||
ax_simple (ax, aop_log_not);
|
||||
|
@ -1187,7 +1187,7 @@ gen_logical_not (struct agent_expr *ax, struct axs_value *value,
|
|||
static void
|
||||
gen_complement (struct agent_expr *ax, struct axs_value *value)
|
||||
{
|
||||
if (TYPE_CODE (value->type) != TYPE_CODE_INT)
|
||||
if (value->type->code () != TYPE_CODE_INT)
|
||||
error (_("Invalid type of operand to `~'."));
|
||||
|
||||
ax_simple (ax, aop_bit_not);
|
||||
|
@ -1214,9 +1214,9 @@ gen_deref (struct axs_value *value)
|
|||
T" to "T", and mark the value as an lvalue in memory. Leave it
|
||||
to the consumer to actually dereference it. */
|
||||
value->type = check_typedef (TYPE_TARGET_TYPE (value->type));
|
||||
if (TYPE_CODE (value->type) == TYPE_CODE_VOID)
|
||||
if (value->type->code () == TYPE_CODE_VOID)
|
||||
error (_("Attempt to dereference a generic pointer."));
|
||||
value->kind = ((TYPE_CODE (value->type) == TYPE_CODE_FUNC)
|
||||
value->kind = ((value->type->code () == TYPE_CODE_FUNC)
|
||||
? axs_rvalue : axs_lvalue_memory);
|
||||
}
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ gen_address_of (struct axs_value *value)
|
|||
/* Special case for taking the address of a function. The ANSI
|
||||
standard describes this as a special case, too, so this
|
||||
arrangement is not without motivation. */
|
||||
if (TYPE_CODE (value->type) == TYPE_CODE_FUNC)
|
||||
if (value->type->code () == TYPE_CODE_FUNC)
|
||||
/* The value's already an rvalue on the stack, so we just need to
|
||||
change the type. */
|
||||
value->type = lookup_pointer_type (value->type);
|
||||
|
@ -1518,8 +1518,8 @@ gen_struct_ref (struct agent_expr *ax, struct axs_value *value,
|
|||
type = check_typedef (value->type);
|
||||
|
||||
/* This must yield a structure or a union. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
error (_("The left operand of `%s' is not a %s."),
|
||||
operator_name, operand_name);
|
||||
|
||||
|
@ -1583,8 +1583,8 @@ gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
|
|||
struct type *t = type;
|
||||
int i;
|
||||
|
||||
if (TYPE_CODE (t) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (t) != TYPE_CODE_UNION)
|
||||
if (t->code () != TYPE_CODE_STRUCT
|
||||
&& t->code () != TYPE_CODE_UNION)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("non-aggregate type to gen_struct_elt_for_reference"));
|
||||
|
||||
|
@ -1668,7 +1668,7 @@ static int
|
|||
gen_aggregate_elt_ref (struct agent_expr *ax, struct axs_value *value,
|
||||
struct type *type, char *field)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
|
@ -1716,7 +1716,7 @@ gen_repeat (struct expression *exp, union exp_element **pc,
|
|||
if (!v)
|
||||
error (_("Right operand of `@' must be a "
|
||||
"constant, in agent expressions."));
|
||||
if (TYPE_CODE (value_type (v)) != TYPE_CODE_INT)
|
||||
if (value_type (v)->code () != TYPE_CODE_INT)
|
||||
error (_("Right operand of `@' must be an integer."));
|
||||
length = value_as_long (v);
|
||||
if (length <= 0)
|
||||
|
@ -1788,7 +1788,7 @@ gen_expr_for_cast (struct expression *exp, union exp_element **pc,
|
|||
}
|
||||
else
|
||||
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
|
||||
if (TYPE_CODE (value->type) == TYPE_CODE_ERROR)
|
||||
if (value->type->code () == TYPE_CODE_ERROR)
|
||||
value->type = to_type;
|
||||
(*pc) += 4;
|
||||
}
|
||||
|
@ -2010,7 +2010,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||
error (_("`%s' has been optimized out, cannot use"),
|
||||
(*pc)[2].symbol->print_name ());
|
||||
|
||||
if (TYPE_CODE (value->type) == TYPE_CODE_ERROR)
|
||||
if (value->type->code () == TYPE_CODE_ERROR)
|
||||
error_unknown_type ((*pc)[2].symbol->print_name ());
|
||||
|
||||
(*pc) += 4;
|
||||
|
@ -2019,7 +2019,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||
case OP_VAR_MSYM_VALUE:
|
||||
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
|
||||
|
||||
if (TYPE_CODE (value->type) == TYPE_CODE_ERROR)
|
||||
if (value->type->code () == TYPE_CODE_ERROR)
|
||||
error_unknown_type ((*pc)[2].msymbol->linkage_name ());
|
||||
|
||||
(*pc) += 4;
|
||||
|
@ -2289,7 +2289,7 @@ gen_expr_binop_rest (struct expression *exp,
|
|||
switch (op)
|
||||
{
|
||||
case BINOP_ADD:
|
||||
if (TYPE_CODE (value1->type) == TYPE_CODE_INT
|
||||
if (value1->type->code () == TYPE_CODE_INT
|
||||
&& pointer_type (value2->type))
|
||||
{
|
||||
/* Swap the values and proceed normally. */
|
||||
|
@ -2297,7 +2297,7 @@ gen_expr_binop_rest (struct expression *exp,
|
|||
gen_ptradd (ax, value, value2, value1);
|
||||
}
|
||||
else if (pointer_type (value1->type)
|
||||
&& TYPE_CODE (value2->type) == TYPE_CODE_INT)
|
||||
&& value2->type->code () == TYPE_CODE_INT)
|
||||
gen_ptradd (ax, value, value1, value2);
|
||||
else
|
||||
gen_binop (ax, value, value1, value2,
|
||||
|
@ -2305,7 +2305,7 @@ gen_expr_binop_rest (struct expression *exp,
|
|||
break;
|
||||
case BINOP_SUB:
|
||||
if (pointer_type (value1->type)
|
||||
&& TYPE_CODE (value2->type) == TYPE_CODE_INT)
|
||||
&& value2->type->code () == TYPE_CODE_INT)
|
||||
gen_ptrsub (ax,value, value1, value2);
|
||||
else if (pointer_type (value1->type)
|
||||
&& pointer_type (value2->type))
|
||||
|
@ -2351,8 +2351,8 @@ gen_expr_binop_rest (struct expression *exp,
|
|||
an array or pointer type (like a plain int variable for
|
||||
example), then report this as an error. */
|
||||
type = check_typedef (value1->type);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (type) != TYPE_CODE_PTR)
|
||||
if (type->code () != TYPE_CODE_ARRAY
|
||||
&& type->code () != TYPE_CODE_PTR)
|
||||
{
|
||||
if (TYPE_NAME (type))
|
||||
error (_("cannot subscript something of type `%s'"),
|
||||
|
|
|
@ -429,11 +429,11 @@ find_gnu_ifunc_target_type (CORE_ADDR resolver_funaddr)
|
|||
|
||||
/* If we found a pointer to function, then the resolved type
|
||||
is the type of the pointed-to function. */
|
||||
if (TYPE_CODE (resolver_ret_type) == TYPE_CODE_PTR)
|
||||
if (resolver_ret_type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
struct type *resolved_type
|
||||
= TYPE_TARGET_TYPE (resolver_ret_type);
|
||||
if (TYPE_CODE (check_typedef (resolved_type)) == TYPE_CODE_FUNC)
|
||||
if (check_typedef (resolved_type)->code () == TYPE_CODE_FUNC)
|
||||
return resolved_type;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1806,8 +1806,8 @@ update_watchpoint (struct watchpoint *b, int reparse)
|
|||
for it explicitly, never if they just happen to
|
||||
appear in the middle of some value chain. */
|
||||
if (v == result
|
||||
|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
|
||||
|| (vtype->code () != TYPE_CODE_STRUCT
|
||||
&& vtype->code () != TYPE_CODE_ARRAY))
|
||||
{
|
||||
CORE_ADDR addr;
|
||||
enum target_hw_bp_type type;
|
||||
|
@ -10806,8 +10806,8 @@ can_use_hardware_watchpoint (const std::vector<value_ref_ptr> &vals)
|
|||
explicitly, never if they just happen to appear in a
|
||||
middle of some value chain. */
|
||||
if (v == head
|
||||
|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
|
||||
|| (vtype->code () != TYPE_CODE_STRUCT
|
||||
&& vtype->code () != TYPE_CODE_ARRAY))
|
||||
{
|
||||
CORE_ADDR vaddr = value_address (v);
|
||||
int len;
|
||||
|
|
10
gdb/c-exp.y
10
gdb/c-exp.y
|
@ -1852,10 +1852,10 @@ typename_stoken (const char *type)
|
|||
static int
|
||||
type_aggregate_p (struct type *type)
|
||||
{
|
||||
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_NAMESPACE
|
||||
|| (TYPE_CODE (type) == TYPE_CODE_ENUM
|
||||
return (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_NAMESPACE
|
||||
|| (type->code () == TYPE_CODE_ENUM
|
||||
&& TYPE_DECLARED_CLASS (type)));
|
||||
}
|
||||
|
||||
|
@ -1870,7 +1870,7 @@ check_parameter_typelist (std::vector<struct type *> *params)
|
|||
for (ix = 0; ix < params->size (); ++ix)
|
||||
{
|
||||
type = (*params)[ix];
|
||||
if (type != NULL && TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
|
||||
if (type != NULL && check_typedef (type)->code () == TYPE_CODE_VOID)
|
||||
{
|
||||
if (ix == 0)
|
||||
{
|
||||
|
|
24
gdb/c-lang.c
24
gdb/c-lang.c
|
@ -86,7 +86,7 @@ classify_type (struct type *elttype, struct gdbarch *gdbarch,
|
|||
{
|
||||
const char *name = TYPE_NAME (elttype);
|
||||
|
||||
if (TYPE_CODE (elttype) == TYPE_CODE_CHAR || !name)
|
||||
if (elttype->code () == TYPE_CODE_CHAR || !name)
|
||||
{
|
||||
result = C_CHAR;
|
||||
goto done;
|
||||
|
@ -110,7 +110,7 @@ classify_type (struct type *elttype, struct gdbarch *gdbarch,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (elttype) != TYPE_CODE_TYPEDEF)
|
||||
if (elttype->code () != TYPE_CODE_TYPEDEF)
|
||||
break;
|
||||
|
||||
/* Call for side effects. */
|
||||
|
@ -250,12 +250,12 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
|||
if (element_type == NULL)
|
||||
goto error;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
/* If we know the size of the array, we can use it as a limit on
|
||||
the number of characters to be fetched. */
|
||||
if (TYPE_NFIELDS (type) == 1
|
||||
&& TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_RANGE)
|
||||
&& TYPE_FIELD_TYPE (type, 0)->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
LONGEST low_bound, high_bound;
|
||||
|
||||
|
@ -266,7 +266,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
|||
else
|
||||
fetchlimit = UINT_MAX;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
else if (type->code () == TYPE_CODE_PTR)
|
||||
fetchlimit = UINT_MAX;
|
||||
else
|
||||
/* We work only with arrays and pointers. */
|
||||
|
@ -292,7 +292,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
|||
avoids running off the end of the value's contents. */
|
||||
if ((VALUE_LVAL (value) == not_lval
|
||||
|| VALUE_LVAL (value) == lval_internalvar
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
|| type->code () == TYPE_CODE_ARRAY)
|
||||
&& fetchlimit != UINT_MAX
|
||||
&& (*length < 0 || *length <= fetchlimit))
|
||||
{
|
||||
|
@ -322,7 +322,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
|||
c_style_arrays is false, so we handle that specially
|
||||
here. */
|
||||
CORE_ADDR addr;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
if (VALUE_LVAL (value) != lval_memory)
|
||||
error (_("Attempt to take address of value "
|
||||
|
@ -629,13 +629,13 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
|
|||
/* If the caller expects an array of some integral type,
|
||||
satisfy them. If something odder is expected, rely on the
|
||||
caller to cast. */
|
||||
if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_ARRAY)
|
||||
if (expect_type && expect_type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
struct type *element_type
|
||||
= check_typedef (TYPE_TARGET_TYPE (expect_type));
|
||||
|
||||
if (TYPE_CODE (element_type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (element_type) == TYPE_CODE_CHAR)
|
||||
if (element_type->code () == TYPE_CODE_INT
|
||||
|| element_type->code () == TYPE_CODE_CHAR)
|
||||
{
|
||||
type = element_type;
|
||||
satisfy_expected = 1;
|
||||
|
@ -742,13 +742,13 @@ bool
|
|||
c_is_string_type_p (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
while (TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
while (type->code () == TYPE_CODE_REF)
|
||||
{
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
type = check_typedef (type);
|
||||
}
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
{
|
||||
|
|
|
@ -116,7 +116,7 @@ c_print_type_1 (struct type *type,
|
|||
type = check_typedef (type);
|
||||
|
||||
local_name = typedef_hash_table::find_typedef (flags, type);
|
||||
code = TYPE_CODE (type);
|
||||
code = type->code ();
|
||||
if (local_name != NULL)
|
||||
{
|
||||
fputs_filtered (local_name, stream);
|
||||
|
@ -209,7 +209,7 @@ c_print_typedef (struct type *type,
|
|||
if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0
|
||||
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
|
||||
new_symbol->linkage_name ()) != 0
|
||||
|| TYPE_CODE (SYMBOL_TYPE (new_symbol)) == TYPE_CODE_TYPEDEF)
|
||||
|| SYMBOL_TYPE (new_symbol)->code () == TYPE_CODE_TYPEDEF)
|
||||
fprintf_filtered (stream, " %s", new_symbol->print_name ());
|
||||
fprintf_filtered (stream, ";");
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
|
|||
struct type *domain;
|
||||
|
||||
gdb_assert (nargs > 0);
|
||||
gdb_assert (TYPE_CODE (args[0].type) == TYPE_CODE_PTR);
|
||||
gdb_assert (args[0].type->code () == TYPE_CODE_PTR);
|
||||
domain = TYPE_TARGET_TYPE (args[0].type);
|
||||
|
||||
if (TYPE_CONST (domain))
|
||||
|
@ -378,7 +378,7 @@ c_type_print_varspec_prefix (struct type *type,
|
|||
|
||||
QUIT;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
|
||||
|
@ -421,7 +421,7 @@ c_type_print_varspec_prefix (struct type *type,
|
|||
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
|
||||
stream, show, 1, 0, language, flags,
|
||||
podata);
|
||||
fprintf_filtered (stream, TYPE_CODE(type) == TYPE_CODE_REF ? "&" : "&&");
|
||||
fprintf_filtered (stream, type->code () == TYPE_CODE_REF ? "&" : "&&");
|
||||
c_type_print_modifier (type, stream, 1, need_post_space, language);
|
||||
break;
|
||||
|
||||
|
@ -767,7 +767,7 @@ c_type_print_varspec_suffix (struct type *type,
|
|||
|
||||
QUIT;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
{
|
||||
|
@ -1056,7 +1056,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
|
|||
}
|
||||
|
||||
c_type_print_modifier (type, stream, 0, 1, language);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_UNION)
|
||||
fprintf_filtered (stream, "union ");
|
||||
else if (TYPE_DECLARED_CLASS (type))
|
||||
fprintf_filtered (stream, "class ");
|
||||
|
@ -1179,8 +1179,8 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
|
|||
int newshow = show - 1;
|
||||
|
||||
if (!is_static && flags->print_offsets
|
||||
&& (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_UNION))
|
||||
&& (TYPE_FIELD_TYPE (type, i)->code () == TYPE_CODE_STRUCT
|
||||
|| TYPE_FIELD_TYPE (type, i)->code () == TYPE_CODE_UNION))
|
||||
{
|
||||
/* If we're printing offsets and this field's type is
|
||||
either a struct or an union, then we're interested in
|
||||
|
@ -1401,7 +1401,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
|
|||
struct type *target = TYPE_TYPEDEF_FIELD_TYPE (type, i);
|
||||
|
||||
/* Dereference the typedef declaration itself. */
|
||||
gdb_assert (TYPE_CODE (target) == TYPE_CODE_TYPEDEF);
|
||||
gdb_assert (target->code () == TYPE_CODE_TYPEDEF);
|
||||
target = TYPE_TARGET_TYPE (target);
|
||||
|
||||
if (need_access_label)
|
||||
|
@ -1492,16 +1492,16 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
|||
way. */
|
||||
if (language == language_c || language == language_minimal)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_UNION)
|
||||
fprintf_filtered (stream, "union ");
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
else if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
if (TYPE_DECLARED_CLASS (type))
|
||||
fprintf_filtered (stream, "class ");
|
||||
else
|
||||
fprintf_filtered (stream, "struct ");
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
else if (type->code () == TYPE_CODE_ENUM)
|
||||
fprintf_filtered (stream, "enum ");
|
||||
}
|
||||
|
||||
|
@ -1511,7 +1511,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
|||
|
||||
type = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_TYPEDEF:
|
||||
/* If we get here, the typedef doesn't have a name, and we
|
||||
|
@ -1702,7 +1702,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
|||
/* At least for dump_symtab, it is important that this not
|
||||
be an error (). */
|
||||
fprintf_styled (stream, metadata_style.style (),
|
||||
_("<invalid type code %d>"), TYPE_CODE (type));
|
||||
_("<invalid type code %d>"), type->code ());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -66,11 +66,11 @@ c_textual_element_type (struct type *type, char format)
|
|||
true_type = check_typedef (type);
|
||||
|
||||
/* TYPE_CODE_CHAR is always textual. */
|
||||
if (TYPE_CODE (true_type) == TYPE_CODE_CHAR)
|
||||
if (true_type->code () == TYPE_CODE_CHAR)
|
||||
return 1;
|
||||
|
||||
/* Any other character-like types must be integral. */
|
||||
if (TYPE_CODE (true_type) != TYPE_CODE_INT)
|
||||
if (true_type->code () != TYPE_CODE_INT)
|
||||
return 0;
|
||||
|
||||
/* We peel typedefs one by one, looking for a match. */
|
||||
|
@ -81,7 +81,7 @@ c_textual_element_type (struct type *type, char format)
|
|||
if (TYPE_NAME (iter_type) && textual_name (TYPE_NAME (iter_type)))
|
||||
return 1;
|
||||
|
||||
if (TYPE_CODE (iter_type) != TYPE_CODE_TYPEDEF)
|
||||
if (iter_type->code () != TYPE_CODE_TYPEDEF)
|
||||
break;
|
||||
|
||||
/* Peel a single typedef. If the typedef doesn't have a target
|
||||
|
@ -97,7 +97,7 @@ c_textual_element_type (struct type *type, char format)
|
|||
{
|
||||
/* Print this as a string if we can manage it. For now, no wide
|
||||
character support. */
|
||||
if (TYPE_CODE (true_type) == TYPE_CODE_INT
|
||||
if (true_type->code () == TYPE_CODE_INT
|
||||
&& TYPE_LENGTH (true_type) == 1)
|
||||
return 1;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ c_textual_element_type (struct type *type, char format)
|
|||
/* If a one-byte TYPE_CODE_INT is missing the not-a-character
|
||||
flag, then we treat it as text; otherwise, we assume it's
|
||||
being used as data. */
|
||||
if (TYPE_CODE (true_type) == TYPE_CODE_INT
|
||||
if (true_type->code () == TYPE_CODE_INT
|
||||
&& TYPE_LENGTH (true_type) == 1
|
||||
&& !TYPE_NOTTEXT (true_type))
|
||||
return 1;
|
||||
|
@ -146,7 +146,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
|
|||
int want_space = 0;
|
||||
struct gdbarch *gdbarch = get_type_arch (type);
|
||||
|
||||
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
|
||||
if (elttype->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* Try to print what function it points to. */
|
||||
print_function_pointer_address (options, gdbarch, address, stream);
|
||||
|
@ -365,7 +365,7 @@ c_value_print_struct (struct value *val, struct ui_file *stream, int recurse,
|
|||
{
|
||||
struct type *type = check_typedef (value_type (val));
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION && recurse && !options->unionprint)
|
||||
if (type->code () == TYPE_CODE_UNION && recurse && !options->unionprint)
|
||||
fprintf_filtered (stream, "{...}");
|
||||
else if (options->vtblprint && cp_is_vtbl_ptr_type (type))
|
||||
{
|
||||
|
@ -443,7 +443,7 @@ c_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
|
|||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
||||
|
||||
type = check_typedef (type);
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
c_value_print_array (val, stream, recurse, options);
|
||||
|
@ -512,7 +512,7 @@ c_value_print (struct value *val, struct ui_file *stream,
|
|||
|
||||
type = check_typedef (value_type (val));
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type))
|
||||
if (type->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type))
|
||||
{
|
||||
struct type *original_type = value_type (val);
|
||||
|
||||
|
@ -520,7 +520,7 @@ c_value_print (struct value *val, struct ui_file *stream,
|
|||
type is indicated by the quoted string anyway.
|
||||
(Don't use c_textual_element_type here; quoted strings
|
||||
are always exactly (char *), (wchar_t *), or the like. */
|
||||
if (TYPE_CODE (original_type) == TYPE_CODE_PTR
|
||||
if (original_type->code () == TYPE_CODE_PTR
|
||||
&& TYPE_NAME (original_type) == NULL
|
||||
&& TYPE_NAME (TYPE_TARGET_TYPE (original_type)) != NULL
|
||||
&& (strcmp (TYPE_NAME (TYPE_TARGET_TYPE (original_type)),
|
||||
|
@ -530,7 +530,7 @@ c_value_print (struct value *val, struct ui_file *stream,
|
|||
/* Print nothing. */
|
||||
}
|
||||
else if (options->objectprint
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
|
||||
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_STRUCT))
|
||||
{
|
||||
int is_ref = TYPE_IS_REFERENCE (type);
|
||||
enum type_code refcode = TYPE_CODE_UNDEF;
|
||||
|
@ -538,7 +538,7 @@ c_value_print (struct value *val, struct ui_file *stream,
|
|||
if (is_ref)
|
||||
{
|
||||
val = value_addr (val);
|
||||
refcode = TYPE_CODE (type);
|
||||
refcode = type->code ();
|
||||
}
|
||||
|
||||
/* Pointer to class, check real type of object. */
|
||||
|
@ -581,7 +581,7 @@ c_value_print (struct value *val, struct ui_file *stream,
|
|||
if (!value_initialized (val))
|
||||
fprintf_filtered (stream, " [uninitialized] ");
|
||||
|
||||
if (options->objectprint && (TYPE_CODE (type) == TYPE_CODE_STRUCT))
|
||||
if (options->objectprint && (type->code () == TYPE_CODE_STRUCT))
|
||||
{
|
||||
/* Attempt to determine real type of object. */
|
||||
real_type = value_rtti_type (val, &full, &top, &using_enc);
|
||||
|
|
|
@ -83,11 +83,11 @@ adjust_value_for_child_access (struct value **value,
|
|||
/* Pointers to structures are treated just like
|
||||
structures when accessing children. Don't
|
||||
dereference pointers to other types. */
|
||||
if (TYPE_CODE (*type) == TYPE_CODE_PTR)
|
||||
if ((*type)->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
struct type *target_type = get_target_type (*type);
|
||||
if (TYPE_CODE (target_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (target_type) == TYPE_CODE_UNION)
|
||||
if (target_type->code () == TYPE_CODE_STRUCT
|
||||
|| target_type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
if (value && *value)
|
||||
{
|
||||
|
@ -142,8 +142,8 @@ c_is_path_expr_parent (const struct varobj *var)
|
|||
type = varobj_get_gdb_type (var);
|
||||
|
||||
/* Anonymous unions and structs are also not path_expr parents. */
|
||||
if ((TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if ((type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
&& TYPE_NAME (type) == NULL)
|
||||
{
|
||||
const struct varobj *parent = var->parent;
|
||||
|
@ -159,8 +159,8 @@ c_is_path_expr_parent (const struct varobj *var)
|
|||
parent_type = varobj_get_value_type (parent);
|
||||
adjust_value_for_child_access (NULL, &parent_type, &was_ptr, 0);
|
||||
|
||||
if (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (parent_type) == TYPE_CODE_UNION)
|
||||
if (parent_type->code () == TYPE_CODE_STRUCT
|
||||
|| parent_type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
const char *field_name;
|
||||
|
||||
|
@ -188,7 +188,7 @@ c_number_of_children (const struct varobj *var)
|
|||
adjust_value_for_child_access (NULL, &type, NULL, 0);
|
||||
target = get_target_type (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (target) > 0
|
||||
|
@ -214,8 +214,8 @@ c_number_of_children (const struct varobj *var)
|
|||
to test for it, please mind that a little magic is necessary to
|
||||
properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
|
||||
TYPE_NAME == "char". */
|
||||
if (TYPE_CODE (target) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (target) == TYPE_CODE_VOID)
|
||||
if (target->code () == TYPE_CODE_FUNC
|
||||
|| target->code () == TYPE_CODE_VOID)
|
||||
children = 0;
|
||||
else
|
||||
children = 1;
|
||||
|
@ -249,8 +249,8 @@ value_struct_element_index (struct value *value, int type_index)
|
|||
|
||||
type = check_typedef (type);
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -302,7 +302,7 @@ c_describe_child (const struct varobj *parent, int index,
|
|||
}
|
||||
adjust_value_for_child_access (&value, &type, &was_ptr, 0);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (cname)
|
||||
|
@ -348,7 +348,7 @@ c_describe_child (const struct varobj *parent, int index,
|
|||
{
|
||||
if (cname)
|
||||
{
|
||||
if (TYPE_CODE (TYPE_FIELD_TYPE (type, index))
|
||||
if (TYPE_FIELD_TYPE (type, index)->code ()
|
||||
== TYPE_CODE_STRUCT)
|
||||
*cname = ANONYMOUS_STRUCT_NAME;
|
||||
else
|
||||
|
@ -486,7 +486,7 @@ c_value_of_variable (const struct varobj *var,
|
|||
while (TYPE_IS_REFERENCE (type))
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
|
@ -577,12 +577,12 @@ cplus_number_of_children (const struct varobj *var)
|
|||
{
|
||||
value = var->value.get ();
|
||||
lookup_actual_type = (TYPE_IS_REFERENCE (var->type)
|
||||
|| TYPE_CODE (var->type) == TYPE_CODE_PTR);
|
||||
|| var->type->code () == TYPE_CODE_PTR);
|
||||
}
|
||||
adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type);
|
||||
|
||||
if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT)
|
||||
|| ((TYPE_CODE (type)) == TYPE_CODE_UNION))
|
||||
if (((type->code ()) == TYPE_CODE_STRUCT)
|
||||
|| ((type->code ()) == TYPE_CODE_UNION))
|
||||
{
|
||||
int kids[3];
|
||||
|
||||
|
@ -614,7 +614,7 @@ cplus_number_of_children (const struct varobj *var)
|
|||
|
||||
value = parent->value.get ();
|
||||
lookup_actual_type = (TYPE_IS_REFERENCE (parent->type)
|
||||
|| TYPE_CODE (parent->type) == TYPE_CODE_PTR);
|
||||
|| parent->type->code () == TYPE_CODE_PTR);
|
||||
}
|
||||
adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type);
|
||||
|
||||
|
@ -719,7 +719,7 @@ cplus_describe_child (const struct varobj *parent, int index,
|
|||
var = (CPLUS_FAKE_CHILD (parent)) ? parent->parent : parent;
|
||||
if (opts.objectprint)
|
||||
lookup_actual_type = (TYPE_IS_REFERENCE (var->type)
|
||||
|| TYPE_CODE (var->type) == TYPE_CODE_PTR);
|
||||
|| var->type->code () == TYPE_CODE_PTR);
|
||||
value = var->value.get ();
|
||||
type = varobj_get_value_type (var);
|
||||
if (cfull_expression)
|
||||
|
@ -728,8 +728,8 @@ cplus_describe_child (const struct varobj *parent, int index,
|
|||
|
||||
adjust_value_for_child_access (&value, &type, &was_ptr, lookup_actual_type);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
const char *join = was_ptr ? "->" : ".";
|
||||
|
||||
|
@ -771,10 +771,10 @@ cplus_describe_child (const struct varobj *parent, int index,
|
|||
{
|
||||
if (cname)
|
||||
{
|
||||
if (TYPE_CODE (TYPE_FIELD_TYPE (type, type_index))
|
||||
if (TYPE_FIELD_TYPE (type, type_index)->code ()
|
||||
== TYPE_CODE_STRUCT)
|
||||
*cname = ANONYMOUS_STRUCT_NAME;
|
||||
else if (TYPE_CODE (TYPE_FIELD_TYPE (type, type_index))
|
||||
else if (TYPE_FIELD_TYPE (type, type_index)->code ()
|
||||
== TYPE_CODE_UNION)
|
||||
*cname = ANONYMOUS_UNION_NAME;
|
||||
}
|
||||
|
|
|
@ -1912,8 +1912,8 @@ setting_cmd (const char *fnname, struct cmd_list_element *showlist,
|
|||
|
||||
struct type *type0 = check_typedef (value_type (argv[0]));
|
||||
|
||||
if (TYPE_CODE (type0) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (type0) != TYPE_CODE_STRING)
|
||||
if (type0->code () != TYPE_CODE_ARRAY
|
||||
&& type0->code () != TYPE_CODE_STRING)
|
||||
error (_("First argument of %s must be a string."), fnname);
|
||||
|
||||
const char *a0 = (const char *) value_contents (argv[0]);
|
||||
|
|
|
@ -37,7 +37,7 @@ get_ulongest (const char **pp, int trailer)
|
|||
|
||||
if (val != NULL) /* Value history reference */
|
||||
{
|
||||
if (TYPE_CODE (value_type (val)) == TYPE_CODE_INT)
|
||||
if (value_type (val)->code () == TYPE_CODE_INT)
|
||||
retval = value_as_long (val);
|
||||
else
|
||||
error (_("History value must have integer type."));
|
||||
|
@ -96,7 +96,7 @@ get_number_trailer (const char **pp, int trailer)
|
|||
|
||||
if (val) /* Value history reference */
|
||||
{
|
||||
if (TYPE_CODE (value_type (val)) == TYPE_CODE_INT)
|
||||
if (value_type (val)->code () == TYPE_CODE_INT)
|
||||
retval = value_as_long (val);
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1494,7 +1494,7 @@ patch_opaque_types (struct symtab *s)
|
|||
from different files with the same name. */
|
||||
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF
|
||||
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
|
||||
&& TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR
|
||||
&& SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
|
||||
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
|
||||
{
|
||||
const char *name = real_sym->linkage_name ();
|
||||
|
@ -1660,8 +1660,8 @@ process_coff_symbol (struct coff_symbol *cs,
|
|||
/* If type has no name, give it one. */
|
||||
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
|
||||
{
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
|
||||
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
|
||||
if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
|
||||
|| SYMBOL_TYPE (sym)->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* If we are giving a name to a type such as
|
||||
"pointer to foo" or "function returning foo", we
|
||||
|
@ -1694,10 +1694,10 @@ process_coff_symbol (struct coff_symbol *cs,
|
|||
not an empty structured type, though; the forward
|
||||
references work themselves out via the magic of
|
||||
coff_lookup_type. */
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
|
||||
if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
|
||||
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) == 0
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym)))
|
||||
!= TYPE_CODE_UNDEF)
|
||||
&& TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))->code ()
|
||||
!= TYPE_CODE_UNDEF)
|
||||
{
|
||||
int i = hashname (sym->linkage_name ());
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
|
|||
maximally-aligned array of the correct size. */
|
||||
|
||||
fputs_unfiltered (" ", stream);
|
||||
switch (TYPE_CODE (regtype))
|
||||
switch (regtype->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
fprintf_filtered (stream, "__gdb_uintptr %s",
|
||||
|
|
|
@ -99,7 +99,7 @@ convert_one_symbol (compile_c_instance *context,
|
|||
break;
|
||||
|
||||
case LOC_CONST:
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym.symbol)) == TYPE_CODE_ENUM)
|
||||
if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
/* Already handled by convert_enum. */
|
||||
return;
|
||||
|
@ -497,7 +497,7 @@ generate_vla_size (compile_instance *compiler,
|
|||
if (TYPE_IS_REFERENCE (type))
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_RANGE:
|
||||
{
|
||||
|
|
|
@ -94,11 +94,11 @@ convert_struct_or_union (compile_c_instance *context, struct type *type)
|
|||
|
||||
/* First we create the resulting type and enter it into our hash
|
||||
table. This lets recursive types work. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
result = context->plugin ().build_record_type ();
|
||||
else
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_UNION);
|
||||
result = context->plugin ().build_union_type ();
|
||||
}
|
||||
context->insert_type (type, result);
|
||||
|
@ -282,7 +282,7 @@ convert_type_basic (compile_c_instance *context, struct type *type)
|
|||
| TYPE_INSTANCE_FLAG_RESTRICT)) != 0)
|
||||
return convert_qualified (context, type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
return convert_pointer (context, type);
|
||||
|
|
|
@ -73,9 +73,9 @@ convert_one_symbol (compile_cplus_instance *instance,
|
|||
switch (SYMBOL_CLASS (sym.symbol))
|
||||
{
|
||||
case LOC_TYPEDEF:
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym.symbol)) == TYPE_CODE_TYPEDEF)
|
||||
if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_TYPEDEF)
|
||||
kind = GCC_CP_SYMBOL_TYPEDEF;
|
||||
else if (TYPE_CODE (SYMBOL_TYPE (sym.symbol)) == TYPE_CODE_NAMESPACE)
|
||||
else if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_NAMESPACE)
|
||||
return;
|
||||
break;
|
||||
|
||||
|
@ -94,7 +94,7 @@ convert_one_symbol (compile_cplus_instance *instance,
|
|||
break;
|
||||
|
||||
case LOC_CONST:
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym.symbol)) == TYPE_CODE_ENUM)
|
||||
if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
/* Already handled by convert_enum. */
|
||||
return;
|
||||
|
|
|
@ -88,7 +88,7 @@ get_field_access_flag (const struct type *type, int num)
|
|||
enum gcc_cp_symbol_kind
|
||||
get_method_access_flag (const struct type *type, int fni, int num)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT);
|
||||
|
||||
/* If this type was not declared a class, everything is public. */
|
||||
if (!TYPE_DECLARED_CLASS (type))
|
||||
|
@ -161,7 +161,7 @@ type_name_to_scope (const char *type_name, const struct block *block)
|
|||
|
||||
scope.push_back (comp);
|
||||
|
||||
if (TYPE_CODE (SYMBOL_TYPE (bsymbol.symbol)) != TYPE_CODE_NAMESPACE)
|
||||
if (SYMBOL_TYPE (bsymbol.symbol)->code () != TYPE_CODE_NAMESPACE)
|
||||
{
|
||||
/* We're done. */
|
||||
break;
|
||||
|
@ -271,7 +271,7 @@ compile_cplus_instance::enter_scope (compile_scope &&new_scope)
|
|||
(m_scopes.back ().begin (), m_scopes.back ().end () - 1,
|
||||
[this] (const scope_component &comp)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (SYMBOL_TYPE (comp.bsymbol.symbol))
|
||||
gdb_assert (SYMBOL_TYPE (comp.bsymbol.symbol)->code ()
|
||||
== TYPE_CODE_NAMESPACE);
|
||||
|
||||
const char *ns = (comp.name == CP_ANONYMOUS_NAMESPACE_STR ? nullptr
|
||||
|
@ -313,7 +313,7 @@ compile_cplus_instance::leave_scope ()
|
|||
std::for_each
|
||||
(current.begin (),current.end () - 1,
|
||||
[this] (const scope_component &comp) {
|
||||
gdb_assert (TYPE_CODE (SYMBOL_TYPE (comp.bsymbol.symbol))
|
||||
gdb_assert (SYMBOL_TYPE (comp.bsymbol.symbol)->code ()
|
||||
== TYPE_CODE_NAMESPACE);
|
||||
this->plugin ().pop_binding_level (comp.name.c_str ());
|
||||
});
|
||||
|
@ -413,7 +413,7 @@ compile_cplus_convert_reference (compile_cplus_instance *instance,
|
|||
gcc_type target = instance->convert_type (TYPE_TARGET_TYPE (type));
|
||||
|
||||
enum gcc_cp_ref_qualifiers quals = GCC_CP_REF_QUAL_NONE;
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_REF:
|
||||
quals = GCC_CP_REF_QUAL_LVALUE;
|
||||
|
@ -826,7 +826,7 @@ compile_cplus_convert_struct_or_union (compile_cplus_instance *instance,
|
|||
table. This lets recursive types work. */
|
||||
|
||||
gcc_decl resuld;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
const char *what = TYPE_DECLARED_CLASS (type) ? "struct" : "class";
|
||||
|
||||
|
@ -839,14 +839,14 @@ compile_cplus_convert_struct_or_union (compile_cplus_instance *instance,
|
|||
}
|
||||
else
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_UNION);
|
||||
resuld = instance->plugin ().build_decl
|
||||
("union", name.get (), GCC_CP_SYMBOL_UNION | nested_access,
|
||||
0, nullptr, 0, filename, line);
|
||||
}
|
||||
|
||||
gcc_type result;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
struct gcc_vbase_array bases;
|
||||
int num_baseclasses = TYPE_N_BASECLASSES (type);
|
||||
|
@ -878,7 +878,7 @@ compile_cplus_convert_struct_or_union (compile_cplus_instance *instance,
|
|||
}
|
||||
else
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_UNION);
|
||||
result = instance->plugin ().start_class_type
|
||||
(name.get (), resuld, nullptr, filename, line);
|
||||
}
|
||||
|
@ -1140,7 +1140,7 @@ convert_type_cplus_basic (compile_cplus_instance *instance,
|
|||
| TYPE_INSTANCE_FLAG_RESTRICT)) != 0)
|
||||
return compile_cplus_convert_qualified (instance, type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_REF:
|
||||
case TYPE_CODE_RVALUE_REF:
|
||||
|
@ -1198,7 +1198,7 @@ convert_type_cplus_basic (compile_cplus_instance *instance,
|
|||
}
|
||||
|
||||
std::string s = string_printf (_("unhandled TYPE_CODE %d"),
|
||||
TYPE_CODE (type));
|
||||
type->code ());
|
||||
|
||||
return instance->plugin ().error (s.c_str ());
|
||||
}
|
||||
|
|
|
@ -452,7 +452,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
|
|||
error (_("No \"%s\" symbol found"), COMPILE_I_EXPR_PTR_TYPE);
|
||||
gdb_ptr_type = SYMBOL_TYPE (gdb_ptr_type_sym);
|
||||
gdb_ptr_type = check_typedef (gdb_ptr_type);
|
||||
if (TYPE_CODE (gdb_ptr_type) != TYPE_CODE_PTR)
|
||||
if (gdb_ptr_type->code () != TYPE_CODE_PTR)
|
||||
error (_("Type of \"%s\" is not a pointer"), COMPILE_I_EXPR_PTR_TYPE);
|
||||
gdb_type_from_ptr = check_typedef (TYPE_TARGET_TYPE (gdb_ptr_type));
|
||||
|
||||
|
@ -464,14 +464,14 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
|
|||
return gdb_type;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (gdb_type) != TYPE_CODE_PTR)
|
||||
if (gdb_type->code () != TYPE_CODE_PTR)
|
||||
error (_("Invalid type code %d of symbol \"%s\" "
|
||||
"in compiled module \"%s\"."),
|
||||
TYPE_CODE (gdb_type_from_ptr), COMPILE_I_EXPR_VAL,
|
||||
gdb_type_from_ptr->code (), COMPILE_I_EXPR_VAL,
|
||||
objfile_name (objfile));
|
||||
|
||||
retval = gdb_type_from_ptr;
|
||||
switch (TYPE_CODE (gdb_type_from_ptr))
|
||||
switch (gdb_type_from_ptr->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
gdb_type_from_ptr = TYPE_TARGET_TYPE (gdb_type_from_ptr);
|
||||
|
@ -481,7 +481,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
|
|||
default:
|
||||
error (_("Invalid type code %d of symbol \"%s\" "
|
||||
"in compiled module \"%s\"."),
|
||||
TYPE_CODE (gdb_type_from_ptr), COMPILE_I_EXPR_PTR_TYPE,
|
||||
gdb_type_from_ptr->code (), COMPILE_I_EXPR_PTR_TYPE,
|
||||
objfile_name (objfile));
|
||||
}
|
||||
if (!types_deeply_equal (gdb_type_from_ptr,
|
||||
|
@ -509,17 +509,17 @@ get_regs_type (struct symbol *func_sym, struct objfile *objfile)
|
|||
return NULL;
|
||||
|
||||
regsp_type = check_typedef (TYPE_FIELD_TYPE (func_type, 0));
|
||||
if (TYPE_CODE (regsp_type) != TYPE_CODE_PTR)
|
||||
if (regsp_type->code () != TYPE_CODE_PTR)
|
||||
error (_("Invalid type code %d of first parameter of function \"%s\" "
|
||||
"in compiled module \"%s\"."),
|
||||
TYPE_CODE (regsp_type), GCC_FE_WRAPPER_FUNCTION,
|
||||
regsp_type->code (), GCC_FE_WRAPPER_FUNCTION,
|
||||
objfile_name (objfile));
|
||||
|
||||
regs_type = check_typedef (TYPE_TARGET_TYPE (regsp_type));
|
||||
if (TYPE_CODE (regs_type) != TYPE_CODE_STRUCT)
|
||||
if (regs_type->code () != TYPE_CODE_STRUCT)
|
||||
error (_("Invalid type code %d of dereferenced first parameter "
|
||||
"of function \"%s\" in compiled module \"%s\"."),
|
||||
TYPE_CODE (regs_type), GCC_FE_WRAPPER_FUNCTION,
|
||||
regs_type->code (), GCC_FE_WRAPPER_FUNCTION,
|
||||
objfile_name (objfile));
|
||||
|
||||
return regs_type;
|
||||
|
@ -555,10 +555,10 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
|
|||
reg_name, pulongest (reg_bitpos), pulongest (reg_bitsize));
|
||||
reg_offset = reg_bitpos / 8;
|
||||
|
||||
if (TYPE_CODE (reg_type) != TYPE_CODE_INT
|
||||
&& TYPE_CODE (reg_type) != TYPE_CODE_PTR)
|
||||
if (reg_type->code () != TYPE_CODE_INT
|
||||
&& reg_type->code () != TYPE_CODE_PTR)
|
||||
error (_("Invalid register \"%s\" type code %d"), reg_name,
|
||||
TYPE_CODE (reg_type));
|
||||
reg_type->code ());
|
||||
|
||||
regnum = compile_register_name_demangle (gdbarch, reg_name);
|
||||
|
||||
|
@ -646,10 +646,10 @@ compile_object_load (const compile_file_names &file_names,
|
|||
error (_("Cannot find function \"%s\" in compiled module \"%s\"."),
|
||||
GCC_FE_WRAPPER_FUNCTION, objfile_name (objfile));
|
||||
func_type = SYMBOL_TYPE (func_sym);
|
||||
if (TYPE_CODE (func_type) != TYPE_CODE_FUNC)
|
||||
if (func_type->code () != TYPE_CODE_FUNC)
|
||||
error (_("Invalid type code %d of function \"%s\" in compiled "
|
||||
"module \"%s\"."),
|
||||
TYPE_CODE (func_type), GCC_FE_WRAPPER_FUNCTION,
|
||||
func_type->code (), GCC_FE_WRAPPER_FUNCTION,
|
||||
objfile_name (objfile));
|
||||
|
||||
switch (scope)
|
||||
|
|
|
@ -149,7 +149,7 @@ compile_object_run (struct compile_module *module)
|
|||
func_type = copy_type_recursive (objfile, func_type, copied_types);
|
||||
htab_delete (copied_types);
|
||||
|
||||
gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC);
|
||||
gdb_assert (func_type->code () == TYPE_CODE_FUNC);
|
||||
func_val = value_from_pointer (lookup_pointer_type (func_type),
|
||||
BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func_sym)));
|
||||
|
||||
|
|
|
@ -1103,7 +1103,7 @@ add_struct_fields (struct type *type, completion_list &output,
|
|||
fieldname, namelen))
|
||||
output.emplace_back (xstrdup (TYPE_FIELD_NAME (type, i)));
|
||||
}
|
||||
else if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_UNION)
|
||||
else if (TYPE_FIELD_TYPE (type, i)->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
/* Recurse into anonymous unions. */
|
||||
add_struct_fields (TYPE_FIELD_TYPE (type, i),
|
||||
|
@ -1156,13 +1156,13 @@ complete_expression (completion_tracker &tracker,
|
|||
for (;;)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
|
||||
if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
|
||||
break;
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
}
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
completion_list result;
|
||||
|
||||
|
|
|
@ -278,8 +278,8 @@ cp_search_static_and_baseclasses (const char *name,
|
|||
|
||||
/* If the scope is a function/method, then look up NESTED as a local
|
||||
static variable. E.g., "print 'function()::static_var'". */
|
||||
if ((TYPE_CODE (scope_type) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (scope_type) == TYPE_CODE_METHOD)
|
||||
if ((scope_type->code () == TYPE_CODE_FUNC
|
||||
|| scope_type->code () == TYPE_CODE_METHOD)
|
||||
&& domain == VAR_DOMAIN)
|
||||
return lookup_symbol (nested, SYMBOL_BLOCK_VALUE (scope_sym.symbol),
|
||||
VAR_DOMAIN, NULL);
|
||||
|
@ -927,7 +927,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
|
|||
domain_name (domain));
|
||||
}
|
||||
|
||||
switch (TYPE_CODE (parent_type))
|
||||
switch (parent_type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_NAMESPACE:
|
||||
|
|
|
@ -183,8 +183,8 @@ inspect_type (struct demangle_parse_info *info,
|
|||
}
|
||||
|
||||
/* If the type is a typedef or namespace alias, replace it. */
|
||||
if (TYPE_CODE (otype) == TYPE_CODE_TYPEDEF
|
||||
|| TYPE_CODE (otype) == TYPE_CODE_NAMESPACE)
|
||||
if (otype->code () == TYPE_CODE_TYPEDEF
|
||||
|| otype->code () == TYPE_CODE_NAMESPACE)
|
||||
{
|
||||
long len;
|
||||
int is_anon;
|
||||
|
@ -212,16 +212,16 @@ inspect_type (struct demangle_parse_info *info,
|
|||
return 0;
|
||||
|
||||
is_anon = (TYPE_NAME (type) == NULL
|
||||
&& (TYPE_CODE (type) == TYPE_CODE_ENUM
|
||||
|| TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION));
|
||||
&& (type->code () == TYPE_CODE_ENUM
|
||||
|| type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION));
|
||||
if (is_anon)
|
||||
{
|
||||
struct type *last = otype;
|
||||
|
||||
/* Find the last typedef for the type. */
|
||||
while (TYPE_TARGET_TYPE (last) != NULL
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (last))
|
||||
&& (TYPE_TARGET_TYPE (last)->code ()
|
||||
== TYPE_CODE_TYPEDEF))
|
||||
last = TYPE_TARGET_TYPE (last);
|
||||
|
||||
|
@ -1267,13 +1267,13 @@ add_symbol_overload_list_adl_namespace (struct type *type,
|
|||
const char *type_name;
|
||||
int i, prefix_len;
|
||||
|
||||
while (TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
while (type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
|
||||
|| type->code () == TYPE_CODE_ARRAY
|
||||
|| type->code () == TYPE_CODE_TYPEDEF)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
|
||||
type = check_typedef(type);
|
||||
if (type->code () == TYPE_CODE_TYPEDEF)
|
||||
type = check_typedef (type);
|
||||
else
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
}
|
||||
|
@ -1296,7 +1296,7 @@ add_symbol_overload_list_adl_namespace (struct type *type,
|
|||
}
|
||||
|
||||
/* Check public base type */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
|
||||
{
|
||||
if (BASETYPE_VIA_PUBLIC (type, i))
|
||||
|
@ -1450,7 +1450,7 @@ cp_lookup_rtti_type (const char *name, const struct block *block)
|
|||
|
||||
rtti_type = check_typedef (SYMBOL_TYPE (rtti_sym));
|
||||
|
||||
switch (TYPE_CODE (rtti_type))
|
||||
switch (rtti_type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
break;
|
||||
|
|
|
@ -74,25 +74,25 @@ cp_is_vtbl_member (struct type *type)
|
|||
{
|
||||
/* With older versions of g++, the vtbl field pointed to an array of
|
||||
structures. Nowadays it points directly to the structure. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT /* if not using thunks */
|
||||
|| TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
|
||||
if (type->code () == TYPE_CODE_STRUCT /* if not using thunks */
|
||||
|| type->code () == TYPE_CODE_PTR) /* if using thunks */
|
||||
{
|
||||
/* Virtual functions tables are full of pointers
|
||||
to virtual functions. */
|
||||
return cp_is_vtbl_ptr_type (type);
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT) /* if not using thunks */
|
||||
else if (type->code () == TYPE_CODE_STRUCT) /* if not using thunks */
|
||||
{
|
||||
return cp_is_vtbl_ptr_type (type);
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
|
||||
else if (type->code () == TYPE_CODE_PTR) /* if using thunks */
|
||||
{
|
||||
/* The type name of the thunk pointer is NULL when using
|
||||
dwarf2. We could test for a pointer to a function, but
|
||||
|
@ -563,7 +563,7 @@ cp_print_static_field (struct type *type,
|
|||
}
|
||||
|
||||
struct type *real_type = check_typedef (type);
|
||||
if (TYPE_CODE (real_type) == TYPE_CODE_STRUCT)
|
||||
if (real_type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
CORE_ADDR *first_dont_print;
|
||||
CORE_ADDR addr = value_address (val);
|
||||
|
@ -591,7 +591,7 @@ cp_print_static_field (struct type *type,
|
|||
return;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (real_type) == TYPE_CODE_ARRAY)
|
||||
if (real_type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
struct type **first_dont_print;
|
||||
int i;
|
||||
|
|
|
@ -1805,8 +1805,8 @@ cris_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *type, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| TYPE_LENGTH (type) > 8)
|
||||
/* Structs, unions, and anything larger than 8 bytes (2 registers)
|
||||
goes on the stack. */
|
||||
|
|
|
@ -460,7 +460,7 @@ new_symbol (struct ctf_context *ccp, struct type *type, ctf_id_t tid)
|
|||
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
|
||||
break;
|
||||
case CTF_K_CONST:
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
|
||||
if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_VOID)
|
||||
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_int;
|
||||
break;
|
||||
case CTF_K_TYPEDEF:
|
||||
|
@ -726,7 +726,7 @@ add_array_cv_type (struct ctf_context *ccp,
|
|||
base_type = copy_type (base_type);
|
||||
inner_array = base_type;
|
||||
|
||||
while (TYPE_CODE (TYPE_TARGET_TYPE (inner_array)) == TYPE_CODE_ARRAY)
|
||||
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
TYPE_TARGET_TYPE (inner_array)
|
||||
= copy_type (TYPE_TARGET_TYPE (inner_array));
|
||||
|
|
10
gdb/d-exp.y
10
gdb/d-exp.y
|
@ -462,7 +462,7 @@ PrimaryExpression:
|
|||
/* Check if the qualified name is in the global
|
||||
context. However if the symbol has not already
|
||||
been resolved, it's not likely to be found. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_MODULE)
|
||||
if (type->code () == TYPE_CODE_MODULE)
|
||||
{
|
||||
struct bound_minimal_symbol msymbol;
|
||||
struct block_symbol sym;
|
||||
|
@ -644,10 +644,10 @@ BasicType:
|
|||
static int
|
||||
type_aggregate_p (struct type *type)
|
||||
{
|
||||
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_MODULE
|
||||
|| (TYPE_CODE (type) == TYPE_CODE_ENUM
|
||||
return (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_MODULE
|
||||
|| (type->code () == TYPE_CODE_ENUM
|
||||
&& TYPE_DECLARED_CLASS (type)));
|
||||
}
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ d_lookup_nested_symbol (struct type *parent_type,
|
|||
|
||||
parent_type = check_typedef (parent_type);
|
||||
|
||||
switch (TYPE_CODE (parent_type))
|
||||
switch (parent_type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
|
|
|
@ -35,7 +35,7 @@ dynamic_array_type (struct type *type,
|
|||
const struct value_print_options *options)
|
||||
{
|
||||
if (TYPE_NFIELDS (type) == 2
|
||||
&& TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_INT
|
||||
&& TYPE_FIELD_TYPE (type, 0)->code () == TYPE_CODE_INT
|
||||
&& strcmp (TYPE_FIELD_NAME (type, 0), "length") == 0
|
||||
&& strcmp (TYPE_FIELD_NAME (type, 1), "ptr") == 0
|
||||
&& !value_bits_any_optimized_out (val,
|
||||
|
@ -78,7 +78,7 @@ d_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
|
|||
int ret;
|
||||
|
||||
struct type *type = check_typedef (value_type (val));
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
ret = dynamic_array_type (type, value_embedded_offset (val),
|
||||
|
|
|
@ -146,9 +146,9 @@ dwarf_expr_context::fetch (int n)
|
|||
static void
|
||||
dwarf_require_integral (struct type *type)
|
||||
{
|
||||
if (TYPE_CODE (type) != TYPE_CODE_INT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_CHAR
|
||||
&& TYPE_CODE (type) != TYPE_CODE_BOOL)
|
||||
if (type->code () != TYPE_CODE_INT
|
||||
&& type->code () != TYPE_CODE_CHAR
|
||||
&& type->code () != TYPE_CODE_BOOL)
|
||||
error (_("integral type expected in DWARF expression"));
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ dwarf_expr_require_composition (const gdb_byte *op_ptr, const gdb_byte *op_end,
|
|||
static int
|
||||
base_types_equal_p (struct type *t1, struct type *t2)
|
||||
{
|
||||
if (TYPE_CODE (t1) != TYPE_CODE (t2))
|
||||
if (t1->code () != t2->code ())
|
||||
return 0;
|
||||
if (TYPE_UNSIGNED (t1) != TYPE_UNSIGNED (t2))
|
||||
return 0;
|
||||
|
|
|
@ -605,8 +605,8 @@ sect_variable_value (struct dwarf_expr_context *ctx, sect_offset sect_off,
|
|||
|
||||
/* Note: Things still work when the following test is removed. This
|
||||
test and error is here to conform to the proposed specification. */
|
||||
if (TYPE_CODE (die_type) != TYPE_CODE_INT
|
||||
&& TYPE_CODE (die_type) != TYPE_CODE_PTR)
|
||||
if (die_type->code () != TYPE_CODE_INT
|
||||
&& die_type->code () != TYPE_CODE_PTR)
|
||||
error (_("Type of DW_OP_GNU_variable_value DIE must be an integer or pointer."));
|
||||
|
||||
struct type *type = lookup_pointer_type (die_type);
|
||||
|
@ -915,7 +915,7 @@ func_addr_to_tail_call_list (struct gdbarch *gdbarch, CORE_ADDR addr)
|
|||
paddress (gdbarch, addr));
|
||||
|
||||
type = SYMBOL_TYPE (sym);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FUNC);
|
||||
gdb_assert (type->code () == TYPE_CODE_FUNC);
|
||||
gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_FUNC);
|
||||
|
||||
return sym;
|
||||
|
@ -2027,7 +2027,7 @@ indirect_pieced_value (struct value *value)
|
|||
enum bfd_endian byte_order;
|
||||
|
||||
type = check_typedef (value_type (value));
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR)
|
||||
if (type->code () != TYPE_CODE_PTR)
|
||||
return NULL;
|
||||
|
||||
bit_length = 8 * TYPE_LENGTH (type);
|
||||
|
@ -2289,7 +2289,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
|
|||
the operation. Therefore, we do the conversion here
|
||||
since the type is readily available. */
|
||||
|
||||
switch (TYPE_CODE (subobj_type))
|
||||
switch (subobj_type->code ())
|
||||
{
|
||||
case TYPE_CODE_FUNC:
|
||||
case TYPE_CODE_METHOD:
|
||||
|
|
|
@ -9285,7 +9285,7 @@ alloc_rust_variant (struct obstack *obstack, struct type *type,
|
|||
static void
|
||||
quirk_rust_enum (struct type *type, struct objfile *objfile)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_UNION);
|
||||
|
||||
/* We don't need to deal with empty enums. */
|
||||
if (TYPE_NFIELDS (type) == 0)
|
||||
|
@ -9385,7 +9385,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
|
|||
{
|
||||
disr_type = TYPE_FIELD_TYPE (type, i);
|
||||
|
||||
if (TYPE_CODE (disr_type) != TYPE_CODE_STRUCT)
|
||||
if (disr_type->code () != TYPE_CODE_STRUCT)
|
||||
{
|
||||
/* All fields of a true enum will be structs. */
|
||||
return;
|
||||
|
@ -10299,7 +10299,7 @@ dwarf2_compute_name (const char *name,
|
|||
the two cases. */
|
||||
if (TYPE_NFIELDS (type) > 0
|
||||
&& TYPE_FIELD_ARTIFICIAL (type, 0)
|
||||
&& TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_PTR
|
||||
&& TYPE_FIELD_TYPE (type, 0)->code () == TYPE_CODE_PTR
|
||||
&& TYPE_CONST (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type,
|
||||
0))))
|
||||
buf.puts (" const");
|
||||
|
@ -10483,7 +10483,7 @@ read_namespace_alias (struct die_info *die, struct dwarf2_cu *cu)
|
|||
sect_offset sect_off = attr->get_ref_die_offset ();
|
||||
|
||||
type = get_die_type_at_offset (sect_off, cu->per_cu);
|
||||
if (type != NULL && TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
|
||||
if (type != NULL && type->code () == TYPE_CODE_NAMESPACE)
|
||||
{
|
||||
/* This declaration is a global namespace alias. Add
|
||||
a symbol for it whose type is the aliased namespace. */
|
||||
|
@ -13308,7 +13308,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
|
|||
func_type = get_die_type (func_die, cu);
|
||||
if (func_type != NULL)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC);
|
||||
gdb_assert (func_type->code () == TYPE_CODE_FUNC);
|
||||
|
||||
/* Enlist this call site to the function. */
|
||||
call_site->tail_call_next = TYPE_TAIL_CALL_LIST (func_type);
|
||||
|
@ -14959,7 +14959,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
|
|||
|
||||
fnp->type = alloc_type (objfile);
|
||||
this_type = read_type_die (die, cu);
|
||||
if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC)
|
||||
if (this_type && this_type->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
int nparams = TYPE_NFIELDS (this_type);
|
||||
|
||||
|
@ -15157,7 +15157,7 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile)
|
|||
struct type *pfn_type, *self_type, *new_type;
|
||||
|
||||
/* Check for a structure with no name and two children. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT || TYPE_NFIELDS (type) != 2)
|
||||
if (type->code () != TYPE_CODE_STRUCT || TYPE_NFIELDS (type) != 2)
|
||||
return;
|
||||
|
||||
/* Check for __pfn and __delta members. */
|
||||
|
@ -15170,15 +15170,15 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile)
|
|||
/* Find the type of the method. */
|
||||
pfn_type = TYPE_FIELD_TYPE (type, 0);
|
||||
if (pfn_type == NULL
|
||||
|| TYPE_CODE (pfn_type) != TYPE_CODE_PTR
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (pfn_type)) != TYPE_CODE_FUNC)
|
||||
|| pfn_type->code () != TYPE_CODE_PTR
|
||||
|| TYPE_TARGET_TYPE (pfn_type)->code () != TYPE_CODE_FUNC)
|
||||
return;
|
||||
|
||||
/* Look for the "this" argument. */
|
||||
pfn_type = TYPE_TARGET_TYPE (pfn_type);
|
||||
if (TYPE_NFIELDS (pfn_type) == 0
|
||||
/* || TYPE_FIELD_TYPE (pfn_type, 0) == NULL */
|
||||
|| TYPE_CODE (TYPE_FIELD_TYPE (pfn_type, 0)) != TYPE_CODE_PTR)
|
||||
|| TYPE_FIELD_TYPE (pfn_type, 0)->code () != TYPE_CODE_PTR)
|
||||
return;
|
||||
|
||||
self_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0));
|
||||
|
@ -16679,9 +16679,9 @@ read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
if (type)
|
||||
return type;
|
||||
|
||||
if (TYPE_CODE (check_typedef (to_type)) == TYPE_CODE_METHOD)
|
||||
if (check_typedef (to_type)->code () == TYPE_CODE_METHOD)
|
||||
type = lookup_methodptr_type (to_type);
|
||||
else if (TYPE_CODE (check_typedef (to_type)) == TYPE_CODE_FUNC)
|
||||
else if (check_typedef (to_type)->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
struct type *new_type
|
||||
= alloc_type (cu->per_cu->dwarf2_per_objfile->objfile);
|
||||
|
@ -16746,7 +16746,7 @@ add_array_cv_type (struct die_info *die, struct dwarf2_cu *cu,
|
|||
base_type = copy_type (base_type);
|
||||
inner_array = base_type;
|
||||
|
||||
while (TYPE_CODE (TYPE_TARGET_TYPE (inner_array)) == TYPE_CODE_ARRAY)
|
||||
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
TYPE_TARGET_TYPE (inner_array) =
|
||||
copy_type (TYPE_TARGET_TYPE (inner_array));
|
||||
|
@ -16775,7 +16775,7 @@ read_tag_const_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
|
||||
/* In case the const qualifier is applied to an array type, the element type
|
||||
is so qualified, not the array type (section 6.7.3 of C99). */
|
||||
if (TYPE_CODE (base_type) == TYPE_CODE_ARRAY)
|
||||
if (base_type->code () == TYPE_CODE_ARRAY)
|
||||
return add_array_cv_type (die, cu, base_type, 1, 0);
|
||||
|
||||
cv_type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0);
|
||||
|
@ -16797,7 +16797,7 @@ read_tag_volatile_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
/* In case the volatile qualifier is applied to an array type, the
|
||||
element type is so qualified, not the array type (section 6.7.3
|
||||
of C99). */
|
||||
if (TYPE_CODE (base_type) == TYPE_CODE_ARRAY)
|
||||
if (base_type->code () == TYPE_CODE_ARRAY)
|
||||
return add_array_cv_type (die, cu, base_type, 0, 1);
|
||||
|
||||
cv_type = make_cv_type (TYPE_CONST (base_type), 1, base_type, 0);
|
||||
|
@ -17323,7 +17323,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
case DW_ATE_complex_float:
|
||||
type = dwarf2_init_complex_target_type (cu, objfile, bits / 2, name,
|
||||
byte_order);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ERROR)
|
||||
if (type->code () == TYPE_CODE_ERROR)
|
||||
{
|
||||
if (name == nullptr)
|
||||
{
|
||||
|
@ -17578,7 +17578,7 @@ read_subrange_index_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
GCC produces an empty range DIE.
|
||||
FIXME: muller/2010-05-28: Possible references to object for low bound,
|
||||
high bound or count are not yet handled by this code. */
|
||||
if (TYPE_CODE (index_type) == TYPE_CODE_VOID)
|
||||
if (index_type->code () == TYPE_CODE_VOID)
|
||||
index_type = cu->per_cu->addr_sized_int_type (false);
|
||||
|
||||
return index_type;
|
||||
|
@ -20717,7 +20717,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
|
|||
/* Compilation with minimal debug info may result in
|
||||
variables with missing type entries. Change the
|
||||
misleading `void' type to something sensible. */
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
|
||||
if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_VOID)
|
||||
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_int;
|
||||
|
||||
attr = dwarf2_attr (die, DW_AT_const_value, cu);
|
||||
|
@ -23639,11 +23639,11 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
|
|||
But this is not a problem, because the gnat-specific information
|
||||
is actually not needed for these types. */
|
||||
if (need_gnat_info (cu)
|
||||
&& TYPE_CODE (type) != TYPE_CODE_FUNC
|
||||
&& TYPE_CODE (type) != TYPE_CODE_FLT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_METHODPTR
|
||||
&& TYPE_CODE (type) != TYPE_CODE_MEMBERPTR
|
||||
&& TYPE_CODE (type) != TYPE_CODE_METHOD
|
||||
&& type->code () != TYPE_CODE_FUNC
|
||||
&& type->code () != TYPE_CODE_FLT
|
||||
&& type->code () != TYPE_CODE_METHODPTR
|
||||
&& type->code () != TYPE_CODE_MEMBERPTR
|
||||
&& type->code () != TYPE_CODE_METHOD
|
||||
&& !HAVE_GNAT_AUX_INFO (type))
|
||||
INIT_GNAT_SPECIFIC (type);
|
||||
|
||||
|
|
148
gdb/eval.c
148
gdb/eval.c
|
@ -302,7 +302,7 @@ evaluate_struct_tuple (struct value *struct_val,
|
|||
if (fieldno >= TYPE_NFIELDS (struct_type))
|
||||
error (_("too many initializers"));
|
||||
field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
|
||||
if (TYPE_CODE (field_type) == TYPE_CODE_UNION
|
||||
if (field_type->code () == TYPE_CODE_UNION
|
||||
&& TYPE_FIELD_NAME (struct_type, fieldno)[0] == '0')
|
||||
error (_("don't know which variant you want to set"));
|
||||
|
||||
|
@ -450,21 +450,21 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch,
|
|||
type1 = check_typedef (value_type (*arg1));
|
||||
type2 = check_typedef (value_type (*arg2));
|
||||
|
||||
if ((TYPE_CODE (type1) != TYPE_CODE_FLT
|
||||
&& TYPE_CODE (type1) != TYPE_CODE_DECFLOAT
|
||||
if ((type1->code () != TYPE_CODE_FLT
|
||||
&& type1->code () != TYPE_CODE_DECFLOAT
|
||||
&& !is_integral_type (type1))
|
||||
|| (TYPE_CODE (type2) != TYPE_CODE_FLT
|
||||
&& TYPE_CODE (type2) != TYPE_CODE_DECFLOAT
|
||||
|| (type2->code () != TYPE_CODE_FLT
|
||||
&& type2->code () != TYPE_CODE_DECFLOAT
|
||||
&& !is_integral_type (type2)))
|
||||
return;
|
||||
|
||||
if (TYPE_CODE (type1) == TYPE_CODE_DECFLOAT
|
||||
|| TYPE_CODE (type2) == TYPE_CODE_DECFLOAT)
|
||||
if (type1->code () == TYPE_CODE_DECFLOAT
|
||||
|| type2->code () == TYPE_CODE_DECFLOAT)
|
||||
{
|
||||
/* No promotion required. */
|
||||
}
|
||||
else if (TYPE_CODE (type1) == TYPE_CODE_FLT
|
||||
|| TYPE_CODE (type2) == TYPE_CODE_FLT)
|
||||
else if (type1->code () == TYPE_CODE_FLT
|
||||
|| type2->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
switch (language->la_language)
|
||||
{
|
||||
|
@ -489,8 +489,8 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type1) == TYPE_CODE_BOOL
|
||||
&& TYPE_CODE (type2) == TYPE_CODE_BOOL)
|
||||
else if (type1->code () == TYPE_CODE_BOOL
|
||||
&& type2->code () == TYPE_CODE_BOOL)
|
||||
{
|
||||
/* No promotion required. */
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ ptrmath_type_p (const struct language_defn *lang, struct type *type)
|
|||
if (TYPE_IS_REFERENCE (type))
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_FUNC:
|
||||
|
@ -668,7 +668,7 @@ fake_method::fake_method (type_instance_flags flags,
|
|||
--num_types;
|
||||
TYPE_VARARGS (type) = 1;
|
||||
}
|
||||
else if (TYPE_CODE (check_typedef (param_types[num_types - 1]))
|
||||
else if (check_typedef (param_types[num_types - 1])->code ()
|
||||
== TYPE_CODE_VOID)
|
||||
{
|
||||
--num_types;
|
||||
|
@ -772,7 +772,7 @@ eval_call (expression *exp, enum noside noside,
|
|||
|
||||
type *ftype = value_type (argvec[0]);
|
||||
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_INTERNAL_FUNCTION)
|
||||
if (ftype->code () == TYPE_CODE_INTERNAL_FUNCTION)
|
||||
{
|
||||
/* We don't know anything about what the internal
|
||||
function might return, but we have to return
|
||||
|
@ -780,7 +780,7 @@ eval_call (expression *exp, enum noside noside,
|
|||
return value_zero (builtin_type (exp->gdbarch)->builtin_int,
|
||||
not_lval);
|
||||
}
|
||||
else if (TYPE_CODE (ftype) == TYPE_CODE_XMETHOD)
|
||||
else if (ftype->code () == TYPE_CODE_XMETHOD)
|
||||
{
|
||||
type *return_type
|
||||
= result_type_of_xmethod (argvec[0],
|
||||
|
@ -791,8 +791,8 @@ eval_call (expression *exp, enum noside noside,
|
|||
error (_("Xmethod is missing return type."));
|
||||
return value_zero (return_type, not_lval);
|
||||
}
|
||||
else if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
|
||||
else if (ftype->code () == TYPE_CODE_FUNC
|
||||
|| ftype->code () == TYPE_CODE_METHOD)
|
||||
{
|
||||
if (TYPE_GNU_IFUNC (ftype))
|
||||
{
|
||||
|
@ -817,7 +817,7 @@ eval_call (expression *exp, enum noside noside,
|
|||
error (_("Expression of type other than "
|
||||
"\"Function returning ...\" used as function"));
|
||||
}
|
||||
switch (TYPE_CODE (value_type (argvec[0])))
|
||||
switch (value_type (argvec[0])->code ())
|
||||
{
|
||||
case TYPE_CODE_INTERNAL_FUNCTION:
|
||||
return call_internal_function (exp->gdbarch, exp->language_defn,
|
||||
|
@ -879,7 +879,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
|||
if (noside == EVAL_SKIP)
|
||||
tem = 1; /* Set it to the right arg index so that all
|
||||
arguments can also be skipped. */
|
||||
else if (TYPE_CODE (a1_type) == TYPE_CODE_METHODPTR)
|
||||
else if (a1_type->code () == TYPE_CODE_METHODPTR)
|
||||
{
|
||||
if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
||||
arg1 = value_zero (TYPE_TARGET_TYPE (a1_type), not_lval);
|
||||
|
@ -891,7 +891,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
|||
tem = 2;
|
||||
argvec[1] = arg2;
|
||||
}
|
||||
else if (TYPE_CODE (a1_type) == TYPE_CODE_MEMBERPTR)
|
||||
else if (a1_type->code () == TYPE_CODE_MEMBERPTR)
|
||||
{
|
||||
struct type *type_ptr
|
||||
= lookup_pointer_type (TYPE_SELF_TYPE (a1_type));
|
||||
|
@ -987,7 +987,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
|||
|
||||
function = NULL;
|
||||
function_name = NULL;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
|
||||
if (type->code () == TYPE_CODE_NAMESPACE)
|
||||
{
|
||||
function = cp_lookup_symbol_namespace (TYPE_NAME (type),
|
||||
name,
|
||||
|
@ -1002,8 +1002,8 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
|||
}
|
||||
else
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
function_name = name;
|
||||
|
||||
/* We need a properly typed value for method lookup. For
|
||||
|
@ -1054,9 +1054,9 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
|||
|
||||
argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
type *type = value_type (argvec[0]);
|
||||
if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type && type->code () == TYPE_CODE_PTR)
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
if (type && TYPE_CODE (type) == TYPE_CODE_FUNC)
|
||||
if (type && type->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
|
||||
{
|
||||
|
@ -1313,7 +1313,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
{
|
||||
(*pos) += 3;
|
||||
symbol *var = exp->elts[pc + 2].symbol;
|
||||
if (TYPE_CODE (SYMBOL_TYPE (var)) == TYPE_CODE_ERROR)
|
||||
if (SYMBOL_TYPE (var)->code () == TYPE_CODE_ERROR)
|
||||
error_unknown_type (var->print_name ());
|
||||
if (noside != EVAL_SKIP)
|
||||
return evaluate_var_value (noside, exp->elts[pc + 1].block, var);
|
||||
|
@ -1335,7 +1335,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
msymbol);
|
||||
|
||||
type = value_type (val);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ERROR
|
||||
if (type->code () == TYPE_CODE_ERROR
|
||||
&& (noside != EVAL_AVOID_SIDE_EFFECTS || pc != 0))
|
||||
error_unknown_type (msymbol->print_name ());
|
||||
return val;
|
||||
|
@ -1449,7 +1449,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
type = expect_type ? check_typedef (expect_type) : NULL_TYPE;
|
||||
|
||||
if (expect_type != NULL_TYPE && noside != EVAL_SKIP
|
||||
&& TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
&& type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
struct value *rec = allocate_value (expect_type);
|
||||
|
||||
|
@ -1458,7 +1458,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
}
|
||||
|
||||
if (expect_type != NULL_TYPE && noside != EVAL_SKIP
|
||||
&& TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
&& type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
struct type *range_type = TYPE_INDEX_TYPE (type);
|
||||
struct type *element_type = TYPE_TARGET_TYPE (type);
|
||||
|
@ -1506,7 +1506,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
}
|
||||
|
||||
if (expect_type != NULL_TYPE && noside != EVAL_SKIP
|
||||
&& TYPE_CODE (type) == TYPE_CODE_SET)
|
||||
&& type->code () == TYPE_CODE_SET)
|
||||
{
|
||||
struct value *set = allocate_value (expect_type);
|
||||
gdb_byte *valaddr = value_contents_raw (set);
|
||||
|
@ -1515,8 +1515,8 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
LONGEST low_bound, high_bound;
|
||||
|
||||
/* Get targettype of elementtype. */
|
||||
while (TYPE_CODE (check_type) == TYPE_CODE_RANGE
|
||||
|| TYPE_CODE (check_type) == TYPE_CODE_TYPEDEF)
|
||||
while (check_type->code () == TYPE_CODE_RANGE
|
||||
|| check_type->code () == TYPE_CODE_TYPEDEF)
|
||||
check_type = TYPE_TARGET_TYPE (check_type);
|
||||
|
||||
if (get_discrete_bounds (element_type, &low_bound, &high_bound) < 0)
|
||||
|
@ -1535,17 +1535,17 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
/* Check types of elements to avoid mixture of elements from
|
||||
different types. Also check if type of element is "compatible"
|
||||
with element type of powerset. */
|
||||
if (TYPE_CODE (range_low_type) == TYPE_CODE_RANGE)
|
||||
if (range_low_type->code () == TYPE_CODE_RANGE)
|
||||
range_low_type = TYPE_TARGET_TYPE (range_low_type);
|
||||
if (TYPE_CODE (range_high_type) == TYPE_CODE_RANGE)
|
||||
if (range_high_type->code () == TYPE_CODE_RANGE)
|
||||
range_high_type = TYPE_TARGET_TYPE (range_high_type);
|
||||
if ((TYPE_CODE (range_low_type) != TYPE_CODE (range_high_type))
|
||||
|| (TYPE_CODE (range_low_type) == TYPE_CODE_ENUM
|
||||
if ((range_low_type->code () != range_high_type->code ())
|
||||
|| (range_low_type->code () == TYPE_CODE_ENUM
|
||||
&& (range_low_type != range_high_type)))
|
||||
/* different element modes. */
|
||||
error (_("POWERSET tuple elements of different mode"));
|
||||
if ((TYPE_CODE (check_type) != TYPE_CODE (range_low_type))
|
||||
|| (TYPE_CODE (check_type) == TYPE_CODE_ENUM
|
||||
if ((check_type->code () != range_low_type->code ())
|
||||
|| (check_type->code () == TYPE_CODE_ENUM
|
||||
&& range_low_type != check_type))
|
||||
error (_("incompatible POWERSET tuple elements"));
|
||||
if (range_low > range_high)
|
||||
|
@ -1799,9 +1799,9 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
block_for_pc (funaddr);
|
||||
|
||||
val_type = check_typedef (val_type);
|
||||
|
||||
if ((val_type == NULL)
|
||||
|| (TYPE_CODE(val_type) == TYPE_CODE_ERROR))
|
||||
|
||||
if ((val_type == NULL)
|
||||
|| (val_type->code () == TYPE_CODE_ERROR))
|
||||
{
|
||||
if (expect_type != NULL)
|
||||
val_type = expect_type;
|
||||
|
@ -1815,7 +1815,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
struct_return = using_struct_return (exp->gdbarch, NULL,
|
||||
check_typedef (expect_type));
|
||||
}
|
||||
|
||||
|
||||
/* Found a function symbol. Now we will substitute its
|
||||
value in place of the message dispatcher (obj_msgSend),
|
||||
so that we call the method directly instead of thru
|
||||
|
@ -1831,7 +1831,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
|
||||
if (method)
|
||||
{
|
||||
if (TYPE_CODE (value_type (method)) != TYPE_CODE_FUNC)
|
||||
if (value_type (method)->code () != TYPE_CODE_FUNC)
|
||||
error (_("method address has symbol information "
|
||||
"with non-function type; skipping"));
|
||||
|
||||
|
@ -1873,13 +1873,13 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
|
||||
struct type *callee_type = value_type (called_method);
|
||||
|
||||
if (callee_type && TYPE_CODE (callee_type) == TYPE_CODE_PTR)
|
||||
if (callee_type && callee_type->code () == TYPE_CODE_PTR)
|
||||
callee_type = TYPE_TARGET_TYPE (callee_type);
|
||||
callee_type = TYPE_TARGET_TYPE (callee_type);
|
||||
|
||||
if (callee_type)
|
||||
{
|
||||
if ((TYPE_CODE (callee_type) == TYPE_CODE_ERROR) && expect_type)
|
||||
if ((callee_type->code () == TYPE_CODE_ERROR) && expect_type)
|
||||
return allocate_value (expect_type);
|
||||
else
|
||||
return allocate_value (callee_type);
|
||||
|
@ -1933,7 +1933,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
/* First determine the type code we are dealing with. */
|
||||
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
type = check_typedef (value_type (arg1));
|
||||
code = TYPE_CODE (type);
|
||||
code = type->code ();
|
||||
|
||||
if (code == TYPE_CODE_PTR)
|
||||
{
|
||||
|
@ -1943,13 +1943,13 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
to the target value the original one points to. */
|
||||
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
if (TYPE_CODE (target_type) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (target_type) == TYPE_CODE_STRING
|
||||
|| TYPE_CODE (target_type) == TYPE_CODE_FUNC)
|
||||
if (target_type->code () == TYPE_CODE_ARRAY
|
||||
|| target_type->code () == TYPE_CODE_STRING
|
||||
|| target_type->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
arg1 = value_ind (arg1);
|
||||
type = check_typedef (value_type (arg1));
|
||||
code = TYPE_CODE (type);
|
||||
code = type->code ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2082,7 +2082,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
|
||||
get_user_print_options (&opts);
|
||||
if (opts.objectprint && TYPE_TARGET_TYPE (arg_type)
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (arg_type)) == TYPE_CODE_STRUCT))
|
||||
&& (TYPE_TARGET_TYPE (arg_type)->code () == TYPE_CODE_STRUCT))
|
||||
{
|
||||
real_type = value_rtti_indirect_type (arg1, &full, &top,
|
||||
&using_enc);
|
||||
|
@ -2110,7 +2110,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
return eval_skip_value (exp);
|
||||
|
||||
type = check_typedef (value_type (arg2));
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_METHODPTR:
|
||||
if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
||||
|
@ -2118,7 +2118,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
else
|
||||
{
|
||||
arg2 = cplus_method_ptr_to_value (&arg1, arg2);
|
||||
gdb_assert (TYPE_CODE (value_type (arg2)) == TYPE_CODE_PTR);
|
||||
gdb_assert (value_type (arg2)->code () == TYPE_CODE_PTR);
|
||||
return value_ind (arg2);
|
||||
}
|
||||
|
||||
|
@ -2324,8 +2324,8 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
|
||||
arg1 = coerce_ref (arg1);
|
||||
type = check_typedef (value_type (arg1));
|
||||
if (TYPE_CODE (type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (type) != TYPE_CODE_PTR)
|
||||
if (type->code () != TYPE_CODE_ARRAY
|
||||
&& type->code () != TYPE_CODE_PTR)
|
||||
{
|
||||
if (TYPE_NAME (type))
|
||||
error (_("cannot subscript something of type `%s'"),
|
||||
|
@ -2383,7 +2383,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
arg1 = coerce_ref (arg1);
|
||||
type = check_typedef (value_type (arg1));
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_ARRAY:
|
||||
|
@ -2607,8 +2607,8 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
if (noside == EVAL_SKIP)
|
||||
return eval_skip_value (exp);
|
||||
type = check_typedef (value_type (arg2));
|
||||
if (TYPE_CODE (type) != TYPE_CODE_INT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_ENUM)
|
||||
if (type->code () != TYPE_CODE_INT
|
||||
&& type->code () != TYPE_CODE_ENUM)
|
||||
error (_("Non-integral right operand for \"@\" operator."));
|
||||
if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
||||
{
|
||||
|
@ -2673,12 +2673,12 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
}
|
||||
|
||||
case UNOP_IND:
|
||||
if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
|
||||
if (expect_type && expect_type->code () == TYPE_CODE_PTR)
|
||||
expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
|
||||
arg1 = evaluate_subexp (expect_type, exp, pos, noside);
|
||||
type = check_typedef (value_type (arg1));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_METHODPTR
|
||||
|| TYPE_CODE (type) == TYPE_CODE_MEMBERPTR)
|
||||
if (type->code () == TYPE_CODE_METHODPTR
|
||||
|| type->code () == TYPE_CODE_MEMBERPTR)
|
||||
error (_("Attempt to dereference pointer "
|
||||
"to member without an object"));
|
||||
if (noside == EVAL_SKIP)
|
||||
|
@ -2688,14 +2688,14 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
||||
{
|
||||
type = check_typedef (value_type (arg1));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
if (type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
/* In C you can dereference an array to get the 1st elt. */
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
|| type->code () == TYPE_CODE_ARRAY
|
||||
)
|
||||
return value_zero (TYPE_TARGET_TYPE (type),
|
||||
lval_memory);
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
else if (type->code () == TYPE_CODE_INT)
|
||||
/* GDB allows dereferencing an int. */
|
||||
return value_zero (builtin_type (exp->gdbarch)->builtin_int,
|
||||
lval_memory);
|
||||
|
@ -2707,7 +2707,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
This returns an int, which seems like the most C-like thing to
|
||||
do. "long long" variables are rare enough that
|
||||
BUILTIN_TYPE_LONGEST would seem to be a mistake. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
if (type->code () == TYPE_CODE_INT)
|
||||
return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int,
|
||||
(CORE_ADDR) value_as_address (arg1));
|
||||
return value_ind (arg1);
|
||||
|
@ -3140,7 +3140,7 @@ evaluate_subexp_with_coercion (struct expression *exp,
|
|||
case OP_VAR_VALUE:
|
||||
var = exp->elts[pc + 2].symbol;
|
||||
type = check_typedef (SYMBOL_TYPE (var));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
if (type->code () == TYPE_CODE_ARRAY
|
||||
&& !TYPE_VECTOR (type)
|
||||
&& CAST_IS_CONVERSION (exp->language_defn))
|
||||
{
|
||||
|
@ -3186,9 +3186,9 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
|
|||
(*pos)++;
|
||||
val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
|
||||
type = check_typedef (value_type (val));
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR
|
||||
if (type->code () != TYPE_CODE_PTR
|
||||
&& !TYPE_IS_REFERENCE (type)
|
||||
&& TYPE_CODE (type) != TYPE_CODE_ARRAY)
|
||||
&& type->code () != TYPE_CODE_ARRAY)
|
||||
error (_("Attempt to take contents of a non-pointer value."));
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
if (is_dynamic_type (type))
|
||||
|
@ -3212,7 +3212,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
|
|||
{
|
||||
val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL);
|
||||
type = value_type (val);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
if (type->code () == TYPE_CODE_ARRAY
|
||||
&& is_dynamic_type (TYPE_INDEX_TYPE (type))
|
||||
&& TYPE_HIGH_BOUND_UNDEFINED (TYPE_INDEX_TYPE (type)))
|
||||
return allocate_optimized_out_value (size_type);
|
||||
|
@ -3231,7 +3231,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
|
|||
msymbol);
|
||||
|
||||
type = value_type (mval);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ERROR)
|
||||
if (type->code () == TYPE_CODE_ERROR)
|
||||
error_unknown_type (msymbol->print_name ());
|
||||
|
||||
return value_from_longest (size_type, TYPE_LENGTH (type));
|
||||
|
@ -3249,10 +3249,10 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
|
|||
|
||||
val = evaluate_subexp (NULL_TYPE, exp, &npc, EVAL_AVOID_SIDE_EFFECTS);
|
||||
type = check_typedef (value_type (val));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
type = TYPE_INDEX_TYPE (type);
|
||||
/* Only re-evaluate the right hand side if the resulting type
|
||||
|
@ -3364,14 +3364,14 @@ calc_f77_array_dims (struct type *array_type)
|
|||
int ndimen = 1;
|
||||
struct type *tmp_type;
|
||||
|
||||
if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
|
||||
if ((array_type->code () != TYPE_CODE_ARRAY))
|
||||
error (_("Can't get dimensions for a non-array type"));
|
||||
|
||||
tmp_type = array_type;
|
||||
|
||||
while ((tmp_type = TYPE_TARGET_TYPE (tmp_type)))
|
||||
{
|
||||
if (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY)
|
||||
if (tmp_type->code () == TYPE_CODE_ARRAY)
|
||||
++ndimen;
|
||||
}
|
||||
return ndimen;
|
||||
|
|
|
@ -448,7 +448,7 @@ print_subexp_standard (struct expression *exp, int *pos,
|
|||
(*pos) += 2;
|
||||
if ((int) prec > (int) PREC_PREFIX)
|
||||
fputs_filtered ("(", stream);
|
||||
if (TYPE_CODE (exp->elts[pc + 1].type) == TYPE_CODE_FUNC
|
||||
if (exp->elts[pc + 1].type->code () == TYPE_CODE_FUNC
|
||||
&& exp->elts[pc + 3].opcode == OP_LONG)
|
||||
{
|
||||
struct value_print_options opts;
|
||||
|
|
28
gdb/f-lang.c
28
gdb/f-lang.c
|
@ -268,7 +268,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
if (noside == EVAL_SKIP)
|
||||
return eval_skip_value (exp);
|
||||
type = value_type (arg1);
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
{
|
||||
|
@ -292,9 +292,9 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
if (noside == EVAL_SKIP)
|
||||
return eval_skip_value (exp);
|
||||
type = value_type (arg1);
|
||||
if (TYPE_CODE (type) != TYPE_CODE (value_type (arg2)))
|
||||
if (type->code () != value_type (arg2)->code ())
|
||||
error (_("non-matching types for parameters to MOD ()"));
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
{
|
||||
|
@ -325,7 +325,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
if (noside == EVAL_SKIP)
|
||||
return eval_skip_value (exp);
|
||||
type = value_type (arg1);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_FLT)
|
||||
if (type->code () != TYPE_CODE_FLT)
|
||||
error (_("argument to CEILING must be of type float"));
|
||||
double val
|
||||
= target_float_to_host_double (value_contents (arg1),
|
||||
|
@ -340,7 +340,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
if (noside == EVAL_SKIP)
|
||||
return eval_skip_value (exp);
|
||||
type = value_type (arg1);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_FLT)
|
||||
if (type->code () != TYPE_CODE_FLT)
|
||||
error (_("argument to FLOOR must be of type float"));
|
||||
double val
|
||||
= target_float_to_host_double (value_contents (arg1),
|
||||
|
@ -356,10 +356,10 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
if (noside == EVAL_SKIP)
|
||||
return eval_skip_value (exp);
|
||||
type = value_type (arg1);
|
||||
if (TYPE_CODE (type) != TYPE_CODE (value_type (arg2)))
|
||||
if (type->code () != value_type (arg2)->code ())
|
||||
error (_("non-matching types for parameters to MODULO ()"));
|
||||
/* MODULO(A, P) = A - FLOOR (A / P) * P */
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
{
|
||||
|
@ -399,7 +399,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
arg1 = evaluate_subexp (NULL, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
|
||||
type = value_type (arg1);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
|
@ -412,7 +412,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp,
|
|||
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int,
|
||||
TYPE_LENGTH (type));
|
||||
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int,
|
||||
TYPE_LENGTH (TYPE_TARGET_TYPE(type)));
|
||||
TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
|
||||
}
|
||||
|
||||
/* Should be unreachable. */
|
||||
|
@ -425,9 +425,9 @@ static bool
|
|||
f_is_string_type_p (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
return (TYPE_CODE (type) == TYPE_CODE_STRING
|
||||
|| (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CHAR));
|
||||
return (type->code () == TYPE_CODE_STRING
|
||||
|| (type->code () == TYPE_CODE_ARRAY
|
||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR));
|
||||
}
|
||||
|
||||
/* Special expression lengths for Fortran. */
|
||||
|
@ -745,7 +745,7 @@ build_fortran_types (struct gdbarch *gdbarch)
|
|||
builtin_f_type->builtin_complex_s16
|
||||
= init_complex_type ("complex*16", builtin_f_type->builtin_real_s8);
|
||||
|
||||
if (TYPE_CODE (builtin_f_type->builtin_real_s16) == TYPE_CODE_ERROR)
|
||||
if (builtin_f_type->builtin_real_s16->code () == TYPE_CODE_ERROR)
|
||||
builtin_f_type->builtin_complex_s32
|
||||
= arch_type (gdbarch, TYPE_CODE_ERROR, 256, "complex*32");
|
||||
else
|
||||
|
@ -802,7 +802,7 @@ fortran_argument_convert (struct value *value, bool is_artificial)
|
|||
struct type *
|
||||
fortran_preserve_arg_pointer (struct value *arg, struct type *type)
|
||||
{
|
||||
if (TYPE_CODE (value_type (arg)) == TYPE_CODE_PTR)
|
||||
if (value_type (arg)->code () == TYPE_CODE_PTR)
|
||||
return value_type (arg);
|
||||
return type;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream,
|
|||
enum type_code code;
|
||||
|
||||
f_type_print_base (type, stream, show, level);
|
||||
code = TYPE_CODE (type);
|
||||
code = type->code ();
|
||||
if ((varstring != NULL && *varstring != '\0')
|
||||
/* Need a space if going to print stars or brackets; but not if we
|
||||
will print just a type name. */
|
||||
|
@ -76,10 +76,10 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream,
|
|||
|| code == TYPE_CODE_ARRAY
|
||||
|| ((code == TYPE_CODE_PTR
|
||||
|| code == TYPE_CODE_REF)
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
|
||||
|| (TYPE_CODE (TYPE_TARGET_TYPE (type))
|
||||
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC
|
||||
|| (TYPE_TARGET_TYPE (type)->code ()
|
||||
== TYPE_CODE_METHOD)
|
||||
|| (TYPE_CODE (TYPE_TARGET_TYPE (type))
|
||||
|| (TYPE_TARGET_TYPE (type)->code ()
|
||||
== TYPE_CODE_ARRAY))))))
|
||||
fputs_filtered (" ", stream);
|
||||
f_type_print_varspec_prefix (type, stream, show, 0);
|
||||
|
@ -119,7 +119,7 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
|
|||
|
||||
QUIT;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
f_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
|
||||
|
@ -183,7 +183,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
|||
|
||||
QUIT;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
arrayprint_recurse_level++;
|
||||
|
@ -207,7 +207,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
|||
print_rank_only = true;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
|
||||
if (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ARRAY)
|
||||
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
||||
0, 0, arrayprint_recurse_level,
|
||||
print_rank_only);
|
||||
|
@ -233,7 +233,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
|||
}
|
||||
}
|
||||
|
||||
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
|
||||
if (TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_ARRAY)
|
||||
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
||||
0, 0, arrayprint_recurse_level,
|
||||
print_rank_only);
|
||||
|
@ -335,18 +335,18 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
if ((show <= 0) && (TYPE_NAME (type) != NULL))
|
||||
{
|
||||
const char *prefix = "";
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_UNION)
|
||||
prefix = "Type, C_Union :: ";
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
else if (type->code () == TYPE_CODE_STRUCT)
|
||||
prefix = "Type ";
|
||||
fprintfi_filtered (level, stream, "%s%s", prefix, TYPE_NAME (type));
|
||||
return;
|
||||
}
|
||||
|
||||
if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF)
|
||||
if (type->code () != TYPE_CODE_TYPEDEF)
|
||||
type = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_TYPEDEF:
|
||||
f_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
|
||||
|
@ -420,7 +420,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_UNION)
|
||||
fprintfi_filtered (level, stream, "Type, C_Union :: ");
|
||||
else
|
||||
fprintfi_filtered (level, stream, "Type ");
|
||||
|
@ -459,7 +459,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
if (TYPE_NAME (type) != NULL)
|
||||
fprintfi_filtered (level, stream, "%s", TYPE_NAME (type));
|
||||
else
|
||||
error (_("Invalid type code (%d) in symbol table."), TYPE_CODE (type));
|
||||
error (_("Invalid type code (%d) in symbol table."), type->code ());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,8 +85,8 @@ f77_get_dynamic_length_of_aggregate (struct type *type)
|
|||
This function also works for strings which behave very
|
||||
similarly to arrays. */
|
||||
|
||||
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRING)
|
||||
if (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ARRAY
|
||||
|| TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_STRING)
|
||||
f77_get_dynamic_length_of_aggregate (TYPE_TARGET_TYPE (type));
|
||||
|
||||
/* Recursion ends here, start setting up lengths. */
|
||||
|
@ -223,7 +223,7 @@ f_value_print_innner (struct value *val, struct ui_file *stream, int recurse,
|
|||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
||||
const CORE_ADDR address = value_address (val);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRING:
|
||||
f77_get_dynamic_length_of_aggregate (type);
|
||||
|
@ -232,7 +232,7 @@ f_value_print_innner (struct value *val, struct ui_file *stream, int recurse,
|
|||
break;
|
||||
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_CHAR)
|
||||
if (TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_CHAR)
|
||||
{
|
||||
fprintf_filtered (stream, "(");
|
||||
f77_print_array (type, valaddr, 0,
|
||||
|
@ -263,7 +263,7 @@ f_value_print_innner (struct value *val, struct ui_file *stream, int recurse,
|
|||
addr = unpack_pointer (type, valaddr);
|
||||
elttype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
|
||||
if (elttype->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* Try to print what function it points to. */
|
||||
print_function_pointer_address (options, gdbarch, addr, stream);
|
||||
|
@ -282,7 +282,7 @@ f_value_print_innner (struct value *val, struct ui_file *stream, int recurse,
|
|||
/* For a pointer to char or unsigned char, also print the string
|
||||
pointed to, unless pointer is null. */
|
||||
if (TYPE_LENGTH (elttype) == 1
|
||||
&& TYPE_CODE (elttype) == TYPE_CODE_INT
|
||||
&& elttype->code () == TYPE_CODE_INT
|
||||
&& (options->format == 0 || options->format == 's')
|
||||
&& addr != 0)
|
||||
{
|
||||
|
@ -320,7 +320,7 @@ f_value_print_innner (struct value *val, struct ui_file *stream, int recurse,
|
|||
struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, index));
|
||||
|
||||
|
||||
if (TYPE_CODE (field_type) != TYPE_CODE_FUNC)
|
||||
if (field_type->code () != TYPE_CODE_FUNC)
|
||||
{
|
||||
const char *field_name;
|
||||
|
||||
|
|
|
@ -1983,9 +1983,9 @@ fbsd_fetch_rtld_offsets (struct gdbarch *gdbarch, struct fbsd_pspace_data *data)
|
|||
language_c, NULL).symbol;
|
||||
if (obj_entry_sym == NULL)
|
||||
error (_("Unable to find Struct_Obj_Entry symbol"));
|
||||
data->off_linkmap = lookup_struct_elt (SYMBOL_TYPE(obj_entry_sym),
|
||||
data->off_linkmap = lookup_struct_elt (SYMBOL_TYPE (obj_entry_sym),
|
||||
"linkmap", 0).offset / 8;
|
||||
data->off_tlsindex = lookup_struct_elt (SYMBOL_TYPE(obj_entry_sym),
|
||||
data->off_tlsindex = lookup_struct_elt (SYMBOL_TYPE (obj_entry_sym),
|
||||
"tlsindex", 0).offset / 8;
|
||||
data->rtld_offsets_valid = true;
|
||||
return;
|
||||
|
|
|
@ -153,7 +153,7 @@ extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
|
|||
CORE_ADDR
|
||||
extract_typed_address (const gdb_byte *buf, struct type *type)
|
||||
{
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
|
||||
if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("extract_typed_address: "
|
||||
"type is not a pointer or reference"));
|
||||
|
@ -206,7 +206,7 @@ template void store_integer (gdb_byte *addr, int len,
|
|||
void
|
||||
store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
|
||||
{
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
|
||||
if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("store_typed_address: "
|
||||
"type is not a pointer or reference"));
|
||||
|
@ -257,7 +257,7 @@ copy_integer_to_size (gdb_byte *dest, int dest_size, const gdb_byte *source,
|
|||
|
||||
/* Return a `value' with the contents of (virtual or cooked) register
|
||||
REGNUM as found in the specified FRAME. The register's type is
|
||||
determined by register_type(). */
|
||||
determined by register_type (). */
|
||||
|
||||
struct value *
|
||||
value_of_register (int regnum, struct frame_info *frame)
|
||||
|
@ -277,7 +277,7 @@ value_of_register (int regnum, struct frame_info *frame)
|
|||
|
||||
/* Return a `value' with the contents of (virtual or cooked) register
|
||||
REGNUM as found in the specified FRAME. The register's type is
|
||||
determined by register_type(). The value is not fetched. */
|
||||
determined by register_type (). The value is not fetched. */
|
||||
|
||||
struct value *
|
||||
value_of_register_lazy (struct frame_info *frame, int regnum)
|
||||
|
|
|
@ -1240,7 +1240,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
arg = args[argnum];
|
||||
arg_type = check_typedef (value_type (arg));
|
||||
len = TYPE_LENGTH (arg_type);
|
||||
typecode = TYPE_CODE (arg_type);
|
||||
typecode = arg_type->code ();
|
||||
|
||||
if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
|
||||
{
|
||||
|
@ -1253,7 +1253,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
else if (abi == FRV_ABI_FDPIC
|
||||
&& len == 4
|
||||
&& typecode == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (arg_type)) == TYPE_CODE_FUNC)
|
||||
&& TYPE_TARGET_TYPE (arg_type)->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* The FDPIC ABI requires function descriptors to be passed instead
|
||||
of entry points. */
|
||||
|
@ -1345,9 +1345,9 @@ frv_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *valtype, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
int struct_return = TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY;
|
||||
int struct_return = valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION
|
||||
|| valtype->code () == TYPE_CODE_ARRAY;
|
||||
|
||||
if (writebuf != NULL)
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ register_to_value_test (struct gdbarch *gdbarch)
|
|||
{
|
||||
std::vector<gdb_byte> expected (TYPE_LENGTH (type), 0);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
/* Generate valid float format. */
|
||||
target_float_from_string (expected.data (), type, "1.25");
|
||||
|
|
206
gdb/gdbtypes.c
206
gdb/gdbtypes.c
|
@ -550,7 +550,7 @@ lookup_function_type_with_arguments (struct type *type,
|
|||
--nparams;
|
||||
TYPE_VARARGS (fn) = 1;
|
||||
}
|
||||
else if (TYPE_CODE (check_typedef (param_types[nparams - 1]))
|
||||
else if (check_typedef (param_types[nparams - 1])->code ()
|
||||
== TYPE_CODE_VOID)
|
||||
{
|
||||
--nparams;
|
||||
|
@ -923,7 +923,7 @@ create_range_type (struct type *result_type, struct type *index_type,
|
|||
{
|
||||
/* The INDEX_TYPE should be a type capable of holding the upper and lower
|
||||
bounds, as such a zero sized, or void type makes no sense. */
|
||||
gdb_assert (TYPE_CODE (index_type) != TYPE_CODE_VOID);
|
||||
gdb_assert (index_type->code () != TYPE_CODE_VOID);
|
||||
gdb_assert (TYPE_LENGTH (index_type) > 0);
|
||||
|
||||
if (result_type == NULL)
|
||||
|
@ -1033,7 +1033,7 @@ int
|
|||
get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_RANGE:
|
||||
*lowp = TYPE_LOW_BOUND (type);
|
||||
|
@ -1155,7 +1155,7 @@ get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound)
|
|||
int
|
||||
discrete_position (struct type *type, LONGEST val, LONGEST *pos)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
if (type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1184,7 +1184,7 @@ discrete_position (struct type *type, LONGEST val, LONGEST *pos)
|
|||
static bool
|
||||
update_static_array_size (struct type *type)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY);
|
||||
gdb_assert (type->code () == TYPE_CODE_ARRAY);
|
||||
|
||||
struct type *range_type = TYPE_INDEX_TYPE (type);
|
||||
|
||||
|
@ -1413,11 +1413,11 @@ make_vector_type (struct type *array_type)
|
|||
/* Find the innermost array type, in case the array is
|
||||
multi-dimensional. */
|
||||
inner_array = array_type;
|
||||
while (TYPE_CODE (TYPE_TARGET_TYPE (inner_array)) == TYPE_CODE_ARRAY)
|
||||
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
||||
inner_array = TYPE_TARGET_TYPE (inner_array);
|
||||
|
||||
elt_type = TYPE_TARGET_TYPE (inner_array);
|
||||
if (TYPE_CODE (elt_type) == TYPE_CODE_INT)
|
||||
if (elt_type->code () == TYPE_CODE_INT)
|
||||
{
|
||||
flags = TYPE_INSTANCE_FLAGS (elt_type) | TYPE_INSTANCE_FLAG_NOTTEXT;
|
||||
elt_type = make_qualified_type (elt_type, flags, NULL);
|
||||
|
@ -1446,7 +1446,7 @@ init_vector_type (struct type *elt_type, int n)
|
|||
struct type *
|
||||
internal_type_self_type (struct type *type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_METHODPTR:
|
||||
case TYPE_CODE_MEMBERPTR:
|
||||
|
@ -1472,7 +1472,7 @@ internal_type_self_type (struct type *type)
|
|||
void
|
||||
set_type_self_type (struct type *type, struct type *self_type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_METHODPTR:
|
||||
case TYPE_CODE_MEMBERPTR:
|
||||
|
@ -1644,7 +1644,7 @@ lookup_struct (const char *name, const struct block *block)
|
|||
{
|
||||
error (_("No struct type named %s."), name);
|
||||
}
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
|
||||
if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_STRUCT)
|
||||
{
|
||||
error (_("This context has class, union or enum %s, not a struct."),
|
||||
name);
|
||||
|
@ -1668,7 +1668,7 @@ lookup_union (const char *name, const struct block *block)
|
|||
|
||||
t = SYMBOL_TYPE (sym);
|
||||
|
||||
if (TYPE_CODE (t) == TYPE_CODE_UNION)
|
||||
if (t->code () == TYPE_CODE_UNION)
|
||||
return t;
|
||||
|
||||
/* If we get here, it's not a union. */
|
||||
|
@ -1689,7 +1689,7 @@ lookup_enum (const char *name, const struct block *block)
|
|||
{
|
||||
error (_("No enum type named %s."), name);
|
||||
}
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_ENUM)
|
||||
if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_ENUM)
|
||||
{
|
||||
error (_("This context has class, struct or union %s, not an enum."),
|
||||
name);
|
||||
|
@ -1719,7 +1719,7 @@ lookup_template_type (const char *name, struct type *type,
|
|||
{
|
||||
error (_("No template type named %s."), name);
|
||||
}
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
|
||||
if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_STRUCT)
|
||||
{
|
||||
error (_("This context has class, union or enum %s, not a struct."),
|
||||
name);
|
||||
|
@ -1737,14 +1737,14 @@ lookup_struct_elt (struct type *type, const char *name, int noerr)
|
|||
for (;;)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR
|
||||
&& TYPE_CODE (type) != TYPE_CODE_REF)
|
||||
if (type->code () != TYPE_CODE_PTR
|
||||
&& type->code () != TYPE_CODE_REF)
|
||||
break;
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
}
|
||||
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
{
|
||||
std::string type_name = type_to_string (type);
|
||||
error (_("Type %s is not a structure or union type."),
|
||||
|
@ -1807,7 +1807,7 @@ get_unsigned_type_max (struct type *type, ULONGEST *max)
|
|||
unsigned int n;
|
||||
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_INT && TYPE_UNSIGNED (type));
|
||||
gdb_assert (type->code () == TYPE_CODE_INT && TYPE_UNSIGNED (type));
|
||||
gdb_assert (TYPE_LENGTH (type) <= sizeof (ULONGEST));
|
||||
|
||||
/* Written this way to avoid overflow. */
|
||||
|
@ -1824,7 +1824,7 @@ get_signed_type_minmax (struct type *type, LONGEST *min, LONGEST *max)
|
|||
unsigned int n;
|
||||
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_INT && !TYPE_UNSIGNED (type));
|
||||
gdb_assert (type->code () == TYPE_CODE_INT && !TYPE_UNSIGNED (type));
|
||||
gdb_assert (TYPE_LENGTH (type) <= sizeof (LONGEST));
|
||||
|
||||
n = TYPE_LENGTH (type) * TARGET_CHAR_BIT;
|
||||
|
@ -1843,8 +1843,8 @@ int
|
|||
internal_type_vptr_fieldno (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
if (!HAVE_CPLUS_STRUCT (type))
|
||||
return -1;
|
||||
return TYPE_RAW_CPLUS_SPECIFIC (type)->vptr_fieldno;
|
||||
|
@ -1856,8 +1856,8 @@ void
|
|||
set_type_vptr_fieldno (struct type *type, int fieldno)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
if (!HAVE_CPLUS_STRUCT (type))
|
||||
ALLOCATE_CPLUS_STRUCT_TYPE (type);
|
||||
TYPE_RAW_CPLUS_SPECIFIC (type)->vptr_fieldno = fieldno;
|
||||
|
@ -1870,8 +1870,8 @@ struct type *
|
|||
internal_type_vptr_basetype (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_CPLUS_STUFF);
|
||||
return TYPE_RAW_CPLUS_SPECIFIC (type)->vptr_basetype;
|
||||
}
|
||||
|
@ -1882,8 +1882,8 @@ void
|
|||
set_type_vptr_basetype (struct type *type, struct type *basetype)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
if (!HAVE_CPLUS_STRUCT (type))
|
||||
ALLOCATE_CPLUS_STRUCT_TYPE (type);
|
||||
TYPE_RAW_CPLUS_SPECIFIC (type)->vptr_basetype = basetype;
|
||||
|
@ -1970,7 +1970,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
|
|||
type = check_typedef (type);
|
||||
|
||||
/* We only want to recognize references at the outermost level. */
|
||||
if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
if (top_level && type->code () == TYPE_CODE_REF)
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
/* Types that have a dynamic TYPE_DATA_LOCATION are considered
|
||||
|
@ -1997,7 +1997,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
|
|||
if (TYPE_HAS_DYNAMIC_LENGTH (type))
|
||||
return 1;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_RANGE:
|
||||
{
|
||||
|
@ -2086,7 +2086,7 @@ resolve_dynamic_range (struct type *dyn_range_type,
|
|||
const struct dynamic_prop *prop;
|
||||
struct dynamic_prop low_bound, high_bound, stride;
|
||||
|
||||
gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE);
|
||||
gdb_assert (dyn_range_type->code () == TYPE_CODE_RANGE);
|
||||
|
||||
prop = &TYPE_RANGE_DATA (dyn_range_type)->low;
|
||||
if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
|
||||
|
@ -2168,8 +2168,8 @@ resolve_dynamic_array_or_string (struct type *type,
|
|||
|
||||
/* For dynamic type resolution strings can be treated like arrays of
|
||||
characters. */
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (type) == TYPE_CODE_STRING);
|
||||
gdb_assert (type->code () == TYPE_CODE_ARRAY
|
||||
|| type->code () == TYPE_CODE_STRING);
|
||||
|
||||
type = copy_type (type);
|
||||
|
||||
|
@ -2194,7 +2194,7 @@ resolve_dynamic_array_or_string (struct type *type,
|
|||
|
||||
ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
|
||||
|
||||
if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY)
|
||||
if (ary_dim != NULL && ary_dim->code () == TYPE_CODE_ARRAY)
|
||||
elt_type = resolve_dynamic_array_or_string (ary_dim, addr_stack);
|
||||
else
|
||||
elt_type = TYPE_TARGET_TYPE (type);
|
||||
|
@ -2235,7 +2235,7 @@ resolve_dynamic_union (struct type *type,
|
|||
int i;
|
||||
unsigned int max_len = 0;
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_UNION);
|
||||
|
||||
resolved_type = copy_type (type);
|
||||
TYPE_FIELDS (resolved_type)
|
||||
|
@ -2431,7 +2431,7 @@ resolve_dynamic_struct (struct type *type,
|
|||
int i;
|
||||
unsigned resolved_type_bit_length = 0;
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT);
|
||||
gdb_assert (TYPE_NFIELDS (type) > 0);
|
||||
|
||||
resolved_type = copy_type (type);
|
||||
|
@ -2560,7 +2560,7 @@ resolve_dynamic_type_internal (struct type *type,
|
|||
&& dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
|
||||
type_length = value;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
|
||||
if (type->code () == TYPE_CODE_TYPEDEF)
|
||||
{
|
||||
resolved_type = copy_type (type);
|
||||
TYPE_TARGET_TYPE (resolved_type)
|
||||
|
@ -2572,7 +2572,7 @@ resolve_dynamic_type_internal (struct type *type,
|
|||
/* Before trying to resolve TYPE, make sure it is not a stub. */
|
||||
type = real_type;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_REF:
|
||||
{
|
||||
|
@ -2752,7 +2752,7 @@ check_typedef (struct type *type)
|
|||
|
||||
gdb_assert (type);
|
||||
|
||||
while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
|
||||
while (type->code () == TYPE_CODE_TYPEDEF)
|
||||
{
|
||||
if (!TYPE_TARGET_TYPE (type))
|
||||
{
|
||||
|
@ -2867,7 +2867,7 @@ check_typedef (struct type *type)
|
|||
/* Same as above for opaque types, we can replace the stub
|
||||
with the complete type only if they are in the same
|
||||
objfile. */
|
||||
if (TYPE_OBJFILE (SYMBOL_TYPE(sym)) == TYPE_OBJFILE (type))
|
||||
if (TYPE_OBJFILE (SYMBOL_TYPE (sym)) == TYPE_OBJFILE (type))
|
||||
type = make_qualified_type (SYMBOL_TYPE (sym),
|
||||
TYPE_INSTANCE_FLAGS (type),
|
||||
type);
|
||||
|
@ -2884,12 +2884,12 @@ check_typedef (struct type *type)
|
|||
{
|
||||
/* Nothing we can do. */
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
|
||||
else if (type->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
TYPE_LENGTH (type) = TYPE_LENGTH (target_type);
|
||||
TYPE_TARGET_STUB (type) = 0;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
else if (type->code () == TYPE_CODE_ARRAY
|
||||
&& update_static_array_size (type))
|
||||
TYPE_TARGET_STUB (type) = 0;
|
||||
}
|
||||
|
@ -3153,7 +3153,7 @@ verify_floatformat (int bit, const struct floatformat *floatformat)
|
|||
const struct floatformat *
|
||||
floatformat_from_type (const struct type *type)
|
||||
{
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
|
||||
gdb_assert (type->code () == TYPE_CODE_FLT);
|
||||
gdb_assert (TYPE_FLOATFORMAT (type));
|
||||
return TYPE_FLOATFORMAT (type);
|
||||
}
|
||||
|
@ -3288,8 +3288,8 @@ init_complex_type (const char *name, struct type *target_type)
|
|||
{
|
||||
struct type *t;
|
||||
|
||||
gdb_assert (TYPE_CODE (target_type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (target_type) == TYPE_CODE_FLT);
|
||||
gdb_assert (target_type->code () == TYPE_CODE_INT
|
||||
|| target_type->code () == TYPE_CODE_FLT);
|
||||
|
||||
if (TYPE_MAIN_TYPE (target_type)->flds_bnds.complex_type == nullptr)
|
||||
{
|
||||
|
@ -3359,7 +3359,7 @@ type_align (struct type *type)
|
|||
if (align != 0)
|
||||
return align;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_FUNC:
|
||||
|
@ -3469,8 +3469,8 @@ can_dereference (struct type *t)
|
|||
t = check_typedef (t);
|
||||
return
|
||||
(t != NULL
|
||||
&& TYPE_CODE (t) == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (t)) != TYPE_CODE_VOID);
|
||||
&& t->code () == TYPE_CODE_PTR
|
||||
&& TYPE_TARGET_TYPE (t)->code () != TYPE_CODE_VOID);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -3479,12 +3479,12 @@ is_integral_type (struct type *t)
|
|||
t = check_typedef (t);
|
||||
return
|
||||
((t != NULL)
|
||||
&& ((TYPE_CODE (t) == TYPE_CODE_INT)
|
||||
|| (TYPE_CODE (t) == TYPE_CODE_ENUM)
|
||||
|| (TYPE_CODE (t) == TYPE_CODE_FLAGS)
|
||||
|| (TYPE_CODE (t) == TYPE_CODE_CHAR)
|
||||
|| (TYPE_CODE (t) == TYPE_CODE_RANGE)
|
||||
|| (TYPE_CODE (t) == TYPE_CODE_BOOL)));
|
||||
&& ((t->code () == TYPE_CODE_INT)
|
||||
|| (t->code () == TYPE_CODE_ENUM)
|
||||
|| (t->code () == TYPE_CODE_FLAGS)
|
||||
|| (t->code () == TYPE_CODE_CHAR)
|
||||
|| (t->code () == TYPE_CODE_RANGE)
|
||||
|| (t->code () == TYPE_CODE_BOOL)));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -3493,8 +3493,8 @@ is_floating_type (struct type *t)
|
|||
t = check_typedef (t);
|
||||
return
|
||||
((t != NULL)
|
||||
&& ((TYPE_CODE (t) == TYPE_CODE_FLT)
|
||||
|| (TYPE_CODE (t) == TYPE_CODE_DECFLOAT)));
|
||||
&& ((t->code () == TYPE_CODE_FLT)
|
||||
|| (t->code () == TYPE_CODE_DECFLOAT)));
|
||||
}
|
||||
|
||||
/* Return true if TYPE is scalar. */
|
||||
|
@ -3504,7 +3504,7 @@ is_scalar_type (struct type *type)
|
|||
{
|
||||
type = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
case TYPE_CODE_STRUCT:
|
||||
|
@ -3529,9 +3529,9 @@ is_scalar_type_recursive (struct type *t)
|
|||
if (is_scalar_type (t))
|
||||
return 1;
|
||||
/* Are we dealing with an array or string of known dimensions? */
|
||||
else if ((TYPE_CODE (t) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (t) == TYPE_CODE_STRING) && TYPE_NFIELDS (t) == 1
|
||||
&& TYPE_CODE (TYPE_INDEX_TYPE (t)) == TYPE_CODE_RANGE)
|
||||
else if ((t->code () == TYPE_CODE_ARRAY
|
||||
|| t->code () == TYPE_CODE_STRING) && TYPE_NFIELDS (t) == 1
|
||||
&& TYPE_INDEX_TYPE(t)->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
LONGEST low_bound, high_bound;
|
||||
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (t));
|
||||
|
@ -3541,9 +3541,9 @@ is_scalar_type_recursive (struct type *t)
|
|||
return high_bound == low_bound && is_scalar_type_recursive (elt_type);
|
||||
}
|
||||
/* Are we dealing with a struct with one element? */
|
||||
else if (TYPE_CODE (t) == TYPE_CODE_STRUCT && TYPE_NFIELDS (t) == 1)
|
||||
else if (t->code () == TYPE_CODE_STRUCT && TYPE_NFIELDS (t) == 1)
|
||||
return is_scalar_type_recursive (TYPE_FIELD_TYPE (t, 0));
|
||||
else if (TYPE_CODE (t) == TYPE_CODE_UNION)
|
||||
else if (t->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
int i, n = TYPE_NFIELDS (t);
|
||||
|
||||
|
@ -3563,8 +3563,8 @@ is_scalar_type_recursive (struct type *t)
|
|||
int
|
||||
class_or_union_p (const struct type *t)
|
||||
{
|
||||
return (TYPE_CODE (t) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (t) == TYPE_CODE_UNION);
|
||||
return (t->code () == TYPE_CODE_STRUCT
|
||||
|| t->code () == TYPE_CODE_UNION);
|
||||
}
|
||||
|
||||
/* A helper function which returns true if types A and B represent the
|
||||
|
@ -3906,21 +3906,21 @@ types_equal (struct type *a, struct type *b)
|
|||
return true;
|
||||
|
||||
/* Resolve typedefs */
|
||||
if (TYPE_CODE (a) == TYPE_CODE_TYPEDEF)
|
||||
if (a->code () == TYPE_CODE_TYPEDEF)
|
||||
a = check_typedef (a);
|
||||
if (TYPE_CODE (b) == TYPE_CODE_TYPEDEF)
|
||||
if (b->code () == TYPE_CODE_TYPEDEF)
|
||||
b = check_typedef (b);
|
||||
|
||||
/* If after resolving typedefs a and b are not of the same type
|
||||
code then they are not equal. */
|
||||
if (TYPE_CODE (a) != TYPE_CODE (b))
|
||||
if (a->code () != b->code ())
|
||||
return false;
|
||||
|
||||
/* If a and b are both pointers types or both reference types then
|
||||
they are equal of the same type iff the objects they refer to are
|
||||
of the same type. */
|
||||
if (TYPE_CODE (a) == TYPE_CODE_PTR
|
||||
|| TYPE_CODE (a) == TYPE_CODE_REF)
|
||||
if (a->code () == TYPE_CODE_PTR
|
||||
|| a->code () == TYPE_CODE_REF)
|
||||
return types_equal (TYPE_TARGET_TYPE (a),
|
||||
TYPE_TARGET_TYPE (b));
|
||||
|
||||
|
@ -3939,7 +3939,7 @@ types_equal (struct type *a, struct type *b)
|
|||
|
||||
/* Two function types are equal if their argument and return types
|
||||
are equal. */
|
||||
if (TYPE_CODE (a) == TYPE_CODE_FUNC)
|
||||
if (a->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -3999,7 +3999,7 @@ check_types_equal (struct type *type1, struct type *type2,
|
|||
if (type1 == type2)
|
||||
return true;
|
||||
|
||||
if (TYPE_CODE (type1) != TYPE_CODE (type2)
|
||||
if (type1->code () != type2->code ()
|
||||
|| TYPE_LENGTH (type1) != TYPE_LENGTH (type2)
|
||||
|| TYPE_UNSIGNED (type1) != TYPE_UNSIGNED (type2)
|
||||
|| TYPE_NOSIGN (type1) != TYPE_NOSIGN (type2)
|
||||
|
@ -4016,7 +4016,7 @@ check_types_equal (struct type *type1, struct type *type2,
|
|||
if (!compare_maybe_null_strings (TYPE_NAME (type1), TYPE_NAME (type2)))
|
||||
return false;
|
||||
|
||||
if (TYPE_CODE (type1) == TYPE_CODE_RANGE)
|
||||
if (type1->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
if (*TYPE_RANGE_DATA (type1) != *TYPE_RANGE_DATA (type2))
|
||||
return false;
|
||||
|
@ -4170,13 +4170,13 @@ rank_one_type_parm_ptr (struct type *parm, struct type *arg, struct value *value
|
|||
{
|
||||
struct rank rank = {0,0};
|
||||
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
|
||||
/* Allowed pointer conversions are:
|
||||
(a) pointer to void-pointer conversion. */
|
||||
if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID)
|
||||
if (TYPE_TARGET_TYPE (parm)->code () == TYPE_CODE_VOID)
|
||||
return VOID_PTR_CONVERSION_BADNESS;
|
||||
|
||||
/* (b) pointer to ancestor-pointer conversion. */
|
||||
|
@ -4208,7 +4208,7 @@ rank_one_type_parm_ptr (struct type *parm, struct type *arg, struct value *value
|
|||
case TYPE_CODE_FUNC:
|
||||
return rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL);
|
||||
case TYPE_CODE_INT:
|
||||
if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT)
|
||||
if (value != NULL && value_type (value)->code () == TYPE_CODE_INT)
|
||||
{
|
||||
if (value_as_long (value) == 0)
|
||||
{
|
||||
|
@ -4239,7 +4239,7 @@ rank_one_type_parm_ptr (struct type *parm, struct type *arg, struct value *value
|
|||
static struct rank
|
||||
rank_one_type_parm_array (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_ARRAY:
|
||||
|
@ -4255,7 +4255,7 @@ rank_one_type_parm_array (struct type *parm, struct type *arg, struct value *val
|
|||
static struct rank
|
||||
rank_one_type_parm_func (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR: /* funcptr -> func */
|
||||
return rank_one_type (parm, TYPE_TARGET_TYPE (arg), NULL);
|
||||
|
@ -4269,7 +4269,7 @@ rank_one_type_parm_func (struct type *parm, struct type *arg, struct value *valu
|
|||
static struct rank
|
||||
rank_one_type_parm_int (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
|
||||
|
@ -4358,7 +4358,7 @@ rank_one_type_parm_int (struct type *parm, struct type *arg, struct value *value
|
|||
static struct rank
|
||||
rank_one_type_parm_enum (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_CHAR:
|
||||
|
@ -4380,7 +4380,7 @@ rank_one_type_parm_enum (struct type *parm, struct type *arg, struct value *valu
|
|||
static struct rank
|
||||
rank_one_type_parm_char (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_RANGE:
|
||||
case TYPE_CODE_BOOL:
|
||||
|
@ -4427,7 +4427,7 @@ rank_one_type_parm_char (struct type *parm, struct type *arg, struct value *valu
|
|||
static struct rank
|
||||
rank_one_type_parm_range (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_CHAR:
|
||||
|
@ -4447,7 +4447,7 @@ rank_one_type_parm_range (struct type *parm, struct type *arg, struct value *val
|
|||
static struct rank
|
||||
rank_one_type_parm_bool (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
/* n3290 draft, section 4.12.1 (conv.bool):
|
||||
|
||||
|
@ -4478,7 +4478,7 @@ rank_one_type_parm_bool (struct type *parm, struct type *arg, struct value *valu
|
|||
static struct rank
|
||||
rank_one_type_parm_float (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
|
||||
|
@ -4503,7 +4503,7 @@ rank_one_type_parm_float (struct type *parm, struct type *arg, struct value *val
|
|||
static struct rank
|
||||
rank_one_type_parm_complex (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{ /* Strictly not needed for C++, but... */
|
||||
case TYPE_CODE_FLT:
|
||||
return FLOAT_PROMOTION_BADNESS;
|
||||
|
@ -4521,7 +4521,7 @@ rank_one_type_parm_struct (struct type *parm, struct type *arg, struct value *va
|
|||
{
|
||||
struct rank rank = {0, 0};
|
||||
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
/* Check for derivation */
|
||||
|
@ -4539,7 +4539,7 @@ rank_one_type_parm_struct (struct type *parm, struct type *arg, struct value *va
|
|||
static struct rank
|
||||
rank_one_type_parm_set (struct type *parm, struct type *arg, struct value *value)
|
||||
{
|
||||
switch (TYPE_CODE (arg))
|
||||
switch (arg->code ())
|
||||
{
|
||||
/* Not in C++ */
|
||||
case TYPE_CODE_SET:
|
||||
|
@ -4567,9 +4567,9 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
|
|||
struct rank rank = {0,0};
|
||||
|
||||
/* Resolve typedefs */
|
||||
if (TYPE_CODE (parm) == TYPE_CODE_TYPEDEF)
|
||||
if (parm->code () == TYPE_CODE_TYPEDEF)
|
||||
parm = check_typedef (parm);
|
||||
if (TYPE_CODE (arg) == TYPE_CODE_TYPEDEF)
|
||||
if (arg->code () == TYPE_CODE_TYPEDEF)
|
||||
arg = check_typedef (arg);
|
||||
|
||||
if (TYPE_IS_REFERENCE (parm) && value != NULL)
|
||||
|
@ -4578,7 +4578,7 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
|
|||
{
|
||||
/* Rvalues should preferably bind to rvalue references or const
|
||||
lvalue references. */
|
||||
if (TYPE_CODE (parm) == TYPE_CODE_RVALUE_REF)
|
||||
if (parm->code () == TYPE_CODE_RVALUE_REF)
|
||||
rank.subrank = REFERENCE_CONVERSION_RVALUE;
|
||||
else if (TYPE_CONST (TYPE_TARGET_TYPE (parm)))
|
||||
rank.subrank = REFERENCE_CONVERSION_CONST_LVALUE;
|
||||
|
@ -4589,7 +4589,7 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
|
|||
else
|
||||
{
|
||||
/* It's illegal to pass an lvalue as an rvalue. */
|
||||
if (TYPE_CODE (parm) == TYPE_CODE_RVALUE_REF)
|
||||
if (parm->code () == TYPE_CODE_RVALUE_REF)
|
||||
return INCOMPATIBLE_TYPE_BADNESS;
|
||||
}
|
||||
}
|
||||
|
@ -4600,7 +4600,7 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
|
|||
struct type *t2 = arg;
|
||||
|
||||
/* For pointers and references, compare target type. */
|
||||
if (TYPE_CODE (parm) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (parm))
|
||||
if (parm->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (parm))
|
||||
{
|
||||
t1 = TYPE_TARGET_TYPE (parm);
|
||||
t2 = TYPE_TARGET_TYPE (arg);
|
||||
|
@ -4627,14 +4627,14 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
|
|||
REFERENCE_SEE_THROUGH_BADNESS));
|
||||
if (overload_debug)
|
||||
/* Debugging only. */
|
||||
fprintf_filtered (gdb_stderr,
|
||||
fprintf_filtered (gdb_stderr,
|
||||
"------ Arg is %s [%d], parm is %s [%d]\n",
|
||||
TYPE_NAME (arg), TYPE_CODE (arg),
|
||||
TYPE_NAME (parm), TYPE_CODE (parm));
|
||||
TYPE_NAME (arg), arg->code (),
|
||||
TYPE_NAME (parm), parm->code ());
|
||||
|
||||
/* x -> y means arg of type x being supplied for parameter of type y. */
|
||||
|
||||
switch (TYPE_CODE (parm))
|
||||
switch (parm->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
return rank_one_type_parm_ptr (parm, arg, value);
|
||||
|
@ -4662,7 +4662,7 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
|
|||
return rank_one_type_parm_set (parm, arg, value);
|
||||
default:
|
||||
return INCOMPATIBLE_TYPE_BADNESS;
|
||||
} /* switch (TYPE_CODE (arg)) */
|
||||
} /* switch (arg->code ()) */
|
||||
}
|
||||
|
||||
/* End of functions for overload resolution. */
|
||||
|
@ -4908,8 +4908,8 @@ recursive_dump_type (struct type *type, int spaces)
|
|||
TYPE_NAME (type) ? TYPE_NAME (type) : "<NULL>");
|
||||
gdb_print_host_address (TYPE_NAME (type), gdb_stdout);
|
||||
printf_filtered (")\n");
|
||||
printfi_filtered (spaces, "code 0x%x ", TYPE_CODE (type));
|
||||
switch (TYPE_CODE (type))
|
||||
printfi_filtered (spaces, "code 0x%x ", type->code ());
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_UNDEF:
|
||||
printf_filtered ("(TYPE_CODE_UNDEF)");
|
||||
|
@ -5106,7 +5106,7 @@ recursive_dump_type (struct type *type, int spaces)
|
|||
puts_filtered ("\n");
|
||||
for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
if (type->code () == TYPE_CODE_ENUM)
|
||||
printfi_filtered (spaces + 2,
|
||||
"[%d] enumval %s type ",
|
||||
idx, plongest (TYPE_FIELD_ENUMVAL (type, idx)));
|
||||
|
@ -5127,7 +5127,7 @@ recursive_dump_type (struct type *type, int spaces)
|
|||
recursive_dump_type (TYPE_FIELD_TYPE (type, idx), spaces + 4);
|
||||
}
|
||||
}
|
||||
if (TYPE_CODE (type) == TYPE_CODE_RANGE)
|
||||
if (type->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
printfi_filtered (spaces, "low %s%s high %s%s\n",
|
||||
plongest (TYPE_LOW_BOUND (type)),
|
||||
|
@ -5343,7 +5343,7 @@ copy_type_recursive (struct objfile *objfile,
|
|||
}
|
||||
|
||||
/* For range types, copy the bounds information. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_RANGE)
|
||||
if (type->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
TYPE_RANGE_DATA (new_type) = (struct range_bounds *)
|
||||
TYPE_ALLOC (new_type, sizeof (struct range_bounds));
|
||||
|
@ -5577,7 +5577,7 @@ append_flags_type_field (struct type *type, int start_bitpos, int nr_bits,
|
|||
int type_bitsize = TYPE_LENGTH (type) * TARGET_CHAR_BIT;
|
||||
int field_nr = TYPE_NFIELDS (type);
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLAGS);
|
||||
gdb_assert (type->code () == TYPE_CODE_FLAGS);
|
||||
gdb_assert (TYPE_NFIELDS (type) + 1 <= type_bitsize);
|
||||
gdb_assert (start_bitpos >= 0 && start_bitpos < type_bitsize);
|
||||
gdb_assert (nr_bits >= 1 && nr_bits <= type_bitsize);
|
||||
|
@ -5649,12 +5649,12 @@ append_composite_type_field_aligned (struct type *t, const char *name,
|
|||
{
|
||||
struct field *f = append_composite_type_field_raw (t, name, field);
|
||||
|
||||
if (TYPE_CODE (t) == TYPE_CODE_UNION)
|
||||
if (t->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
if (TYPE_LENGTH (t) < TYPE_LENGTH (field))
|
||||
TYPE_LENGTH (t) = TYPE_LENGTH (field);
|
||||
}
|
||||
else if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
|
||||
else if (t->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
TYPE_LENGTH (t) = TYPE_LENGTH (t) + TYPE_LENGTH (field);
|
||||
if (TYPE_NFIELDS (t) > 1)
|
||||
|
|
|
@ -335,7 +335,7 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags);
|
|||
/* * True if this type represents either an lvalue or lvalue reference type. */
|
||||
|
||||
#define TYPE_IS_REFERENCE(t) \
|
||||
(TYPE_CODE (t) == TYPE_CODE_REF || TYPE_CODE (t) == TYPE_CODE_RVALUE_REF)
|
||||
((t)->code () == TYPE_CODE_REF || (t)->code () == TYPE_CODE_RVALUE_REF)
|
||||
|
||||
/* * True if this type is allocatable. */
|
||||
#define TYPE_IS_ALLOCATABLE(t) \
|
||||
|
@ -1435,7 +1435,6 @@ extern unsigned type_align (struct type *);
|
|||
space in struct type. */
|
||||
extern bool set_type_align (struct type *, ULONGEST);
|
||||
|
||||
#define TYPE_CODE(thistype) ((thistype)->code ())
|
||||
#define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
|
||||
#define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields
|
||||
|
||||
|
@ -1681,8 +1680,8 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
|||
TYPE_NESTED_TYPES_FIELD (thistype, n).is_private
|
||||
|
||||
#define TYPE_IS_OPAQUE(thistype) \
|
||||
(((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) \
|
||||
|| (TYPE_CODE (thistype) == TYPE_CODE_UNION)) \
|
||||
((((thistype)->code () == TYPE_CODE_STRUCT) \
|
||||
|| ((thistype)->code () == TYPE_CODE_UNION)) \
|
||||
&& (TYPE_NFIELDS (thistype) == 0) \
|
||||
&& (!HAVE_CPLUS_STRUCT (thistype) \
|
||||
|| TYPE_NFN_FIELDS (thistype) == 0) \
|
||||
|
|
|
@ -132,8 +132,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
|||
|
||||
/* With older versions of g++, the vtbl field pointed to an array
|
||||
of structures. Nowadays it points directly to the structure. */
|
||||
if (TYPE_CODE (value_type (vtbl)) == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (value_type (vtbl))) == TYPE_CODE_ARRAY)
|
||||
if (value_type (vtbl)->code () == TYPE_CODE_PTR
|
||||
&& TYPE_TARGET_TYPE (value_type (vtbl))->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
/* Handle the case where the vtbl field points to an
|
||||
array of structures. */
|
||||
|
@ -155,7 +155,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
|||
|
||||
entry_type = check_typedef (value_type (entry));
|
||||
|
||||
if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
|
||||
if (entry_type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
/* Move the `this' pointer according to the virtual function table. */
|
||||
set_value_offset (arg1, value_offset (arg1)
|
||||
|
@ -169,7 +169,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
|||
|
||||
vfn = value_field (entry, 2);
|
||||
}
|
||||
else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
|
||||
else if (entry_type->code () == TYPE_CODE_PTR)
|
||||
vfn = entry;
|
||||
else
|
||||
error (_("I'm confused: virtual function table has bad type"));
|
||||
|
@ -206,7 +206,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, int *using_enc)
|
|||
known_type = value_type (v);
|
||||
known_type = check_typedef (known_type);
|
||||
/* RTTI works only or class objects. */
|
||||
if (TYPE_CODE (known_type) != TYPE_CODE_STRUCT)
|
||||
if (known_type->code () != TYPE_CODE_STRUCT)
|
||||
return NULL;
|
||||
|
||||
/* Plan on this changing in the future as i get around to setting
|
||||
|
@ -314,7 +314,7 @@ vb_match (struct type *type, int index, struct type *basetype)
|
|||
it is for this baseclass. */
|
||||
fieldtype = TYPE_FIELD_TYPE (type, index);
|
||||
if (fieldtype == NULL
|
||||
|| TYPE_CODE (fieldtype) != TYPE_CODE_PTR)
|
||||
|| fieldtype->code () != TYPE_CODE_PTR)
|
||||
/* "Can't happen". */
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -208,10 +208,10 @@ gnuv3_dynamic_class (struct type *type)
|
|||
int fieldnum, fieldelem;
|
||||
|
||||
type = check_typedef (type);
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_UNION)
|
||||
return 0;
|
||||
|
||||
if (TYPE_CPLUS_DYNAMIC (type))
|
||||
|
@ -259,7 +259,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch,
|
|||
CORE_ADDR vtable_address;
|
||||
|
||||
container_type = check_typedef (container_type);
|
||||
gdb_assert (TYPE_CODE (container_type) == TYPE_CODE_STRUCT);
|
||||
gdb_assert (container_type->code () == TYPE_CODE_STRUCT);
|
||||
|
||||
/* If this type does not have a virtual table, don't read the first
|
||||
field. */
|
||||
|
@ -303,7 +303,7 @@ gnuv3_rtti_type (struct value *value,
|
|||
const char *atsign;
|
||||
|
||||
/* We only have RTTI for dynamic class objects. */
|
||||
if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT
|
||||
if (values_type->code () != TYPE_CODE_STRUCT
|
||||
|| !gnuv3_dynamic_class (values_type))
|
||||
return NULL;
|
||||
|
||||
|
@ -418,7 +418,7 @@ gnuv3_virtual_fn_field (struct value **value_p,
|
|||
struct gdbarch *gdbarch;
|
||||
|
||||
/* Some simple sanity checks. */
|
||||
if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT)
|
||||
if (values_type->code () != TYPE_CODE_STRUCT)
|
||||
error (_("Only classes can have virtual functions."));
|
||||
|
||||
/* Determine architecture. */
|
||||
|
@ -849,7 +849,7 @@ compute_vtable_size (htab_t offset_hash,
|
|||
void **slot;
|
||||
struct value_and_voffset search_vo, *current_vo;
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT);
|
||||
gdb_assert (type->code () == TYPE_CODE_STRUCT);
|
||||
|
||||
/* If the object is not dynamic, then we are done; as it cannot have
|
||||
dynamic base types either. */
|
||||
|
@ -964,7 +964,7 @@ gnuv3_print_vtable (struct value *value)
|
|||
|
||||
value = coerce_ref (value);
|
||||
type = check_typedef (value_type (value));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
value = value_ind (value);
|
||||
type = check_typedef (value_type (value));
|
||||
|
@ -982,7 +982,7 @@ gnuv3_print_vtable (struct value *value)
|
|||
gdbarch = get_type_arch (type);
|
||||
|
||||
vtable = NULL;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
vtable = gnuv3_get_vtable (gdbarch, type,
|
||||
value_as_address (value_addr (value)));
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ gnuv3_get_typeid (struct value *value)
|
|||
|
||||
/* In the non_lvalue case, a reference might have slipped through
|
||||
here. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
if (type->code () == TYPE_CODE_REF)
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
/* Ignore top-level cv-qualifiers. */
|
||||
|
@ -1127,7 +1127,7 @@ gnuv3_get_typeid (struct value *value)
|
|||
|
||||
/* We check for lval_memory because in the "typeid (type-id)" case,
|
||||
the type is passed via a not_lval value object. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
&& value_lval_const (value) == lval_memory
|
||||
&& gnuv3_dynamic_class (type))
|
||||
{
|
||||
|
@ -1333,7 +1333,7 @@ is_copy_or_move_constructor_type (struct type *class_type,
|
|||
type, with the expected type code... */
|
||||
struct type *arg_type = TYPE_FIELD_TYPE (method_type, 1);
|
||||
|
||||
if (TYPE_CODE (arg_type) != expected)
|
||||
if (arg_type->code () != expected)
|
||||
return false;
|
||||
|
||||
struct type *target = check_typedef (TYPE_TARGET_TYPE (arg_type));
|
||||
|
@ -1417,8 +1417,8 @@ gnuv3_pass_by_reference (struct type *type)
|
|||
definition_style mctor_def = DOES_NOT_EXIST_IN_SOURCE;
|
||||
|
||||
/* We're only interested in things that can have methods. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
return info;
|
||||
|
||||
/* The compiler may have emitted the calling convention attribute.
|
||||
|
@ -1533,7 +1533,7 @@ gnuv3_pass_by_reference (struct type *type)
|
|||
struct type *field_type = TYPE_FIELD_TYPE (type, fieldnum);
|
||||
|
||||
/* For arrays, make the decision based on the element type. */
|
||||
if (TYPE_CODE (field_type) == TYPE_CODE_ARRAY)
|
||||
if (field_type->code () == TYPE_CODE_ARRAY)
|
||||
field_type = check_typedef (TYPE_TARGET_TYPE (field_type));
|
||||
|
||||
struct language_pass_by_ref_info field_info
|
||||
|
|
|
@ -1333,7 +1333,7 @@ package_name_p (const char *name, const struct block *block)
|
|||
|
||||
if (sym
|
||||
&& SYMBOL_CLASS (sym) == LOC_TYPEDEF
|
||||
&& TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_MODULE)
|
||||
&& SYMBOL_TYPE (sym)->code () == TYPE_CODE_MODULE)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -81,16 +81,16 @@ gccgo_string_p (struct type *type)
|
|||
type0 = check_typedef (type0);
|
||||
type1 = check_typedef (type1);
|
||||
|
||||
if (TYPE_CODE (type0) == TYPE_CODE_PTR
|
||||
if (type0->code () == TYPE_CODE_PTR
|
||||
&& strcmp (TYPE_FIELD_NAME (type, 0), "__data") == 0
|
||||
&& TYPE_CODE (type1) == TYPE_CODE_INT
|
||||
&& type1->code () == TYPE_CODE_INT
|
||||
&& strcmp (TYPE_FIELD_NAME (type, 1), "__length") == 0)
|
||||
{
|
||||
struct type *target_type = TYPE_TARGET_TYPE (type0);
|
||||
|
||||
target_type = check_typedef (target_type);
|
||||
|
||||
if (TYPE_CODE (target_type) == TYPE_CODE_INT
|
||||
if (target_type->code () == TYPE_CODE_INT
|
||||
&& TYPE_LENGTH (target_type) == 1
|
||||
&& strcmp (TYPE_NAME (target_type), "uint8") == 0)
|
||||
return 1;
|
||||
|
@ -137,7 +137,7 @@ static bool
|
|||
go_is_string_type_p (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
return (type->code () == TYPE_CODE_STRUCT
|
||||
&& go_classify_struct_type (type) == GO_TYPE_STRING);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ go_print_type (struct type *type, const char *varstring,
|
|||
type = check_typedef (type);
|
||||
|
||||
/* Print the type of "abc" as "string", not char[4]. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CHAR)
|
||||
if (type->code () == TYPE_CODE_ARRAY
|
||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR)
|
||||
{
|
||||
fputs_filtered ("string", stream);
|
||||
return;
|
||||
|
|
|
@ -92,7 +92,7 @@ go_value_print_inner (struct value *val, struct ui_file *stream,
|
|||
{
|
||||
struct type *type = check_typedef (value_type (val));
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
{
|
||||
|
|
|
@ -201,7 +201,7 @@ lsscm_elt_type (lazy_string_smob *ls_smob)
|
|||
|
||||
realtype = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (realtype))
|
||||
switch (realtype->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_ARRAY:
|
||||
|
@ -314,7 +314,7 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
|
|||
struct type *type = tyscm_scm_to_type (ls_smob->type);
|
||||
struct type *realtype = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (realtype))
|
||||
switch (realtype->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
/* If a length is specified we need to convert this to an array
|
||||
|
|
|
@ -65,7 +65,7 @@ enum valscm_binary_opcode
|
|||
|
||||
/* If TYPE is a reference, return the target; otherwise return TYPE. */
|
||||
#define STRIP_REFERENCE(TYPE) \
|
||||
((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
|
||||
((TYPE->code () == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
|
||||
|
||||
/* Helper for vlscm_unop. Contains all the code that may throw a GDB
|
||||
exception. */
|
||||
|
@ -168,10 +168,10 @@ vlscm_binop_gdbthrow (enum valscm_binary_opcode opcode, SCM x, SCM y,
|
|||
rtype = check_typedef (rtype);
|
||||
rtype = STRIP_REFERENCE (rtype);
|
||||
|
||||
if (TYPE_CODE (ltype) == TYPE_CODE_PTR
|
||||
if (ltype->code () == TYPE_CODE_PTR
|
||||
&& is_integral_type (rtype))
|
||||
res_val = value_ptradd (arg1, value_as_long (arg2));
|
||||
else if (TYPE_CODE (rtype) == TYPE_CODE_PTR
|
||||
else if (rtype->code () == TYPE_CODE_PTR
|
||||
&& is_integral_type (ltype))
|
||||
res_val = value_ptradd (arg2, value_as_long (arg1));
|
||||
else
|
||||
|
@ -188,15 +188,15 @@ vlscm_binop_gdbthrow (enum valscm_binary_opcode opcode, SCM x, SCM y,
|
|||
rtype = check_typedef (rtype);
|
||||
rtype = STRIP_REFERENCE (rtype);
|
||||
|
||||
if (TYPE_CODE (ltype) == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (rtype) == TYPE_CODE_PTR)
|
||||
if (ltype->code () == TYPE_CODE_PTR
|
||||
&& rtype->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
/* A ptrdiff_t for the target would be preferable here. */
|
||||
res_val
|
||||
= value_from_longest (builtin_type (gdbarch)->builtin_long,
|
||||
value_ptrdiff (arg1, arg2));
|
||||
}
|
||||
else if (TYPE_CODE (ltype) == TYPE_CODE_PTR
|
||||
else if (ltype->code () == TYPE_CODE_PTR
|
||||
&& is_integral_type (rtype))
|
||||
res_val = value_ptradd (arg1, - value_as_long (arg2));
|
||||
else
|
||||
|
@ -525,7 +525,7 @@ vlscm_convert_typed_number (const char *func_name, int obj_arg_pos, SCM obj,
|
|||
struct gdbarch *gdbarch, SCM *except_scmp)
|
||||
{
|
||||
if (is_integral_type (type)
|
||||
|| TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
|| type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
if (TYPE_UNSIGNED (type))
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ vlscm_convert_typed_number (const char *func_name, int obj_arg_pos, SCM obj,
|
|||
return value_from_longest (type, gdbscm_scm_to_longest (obj));
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
else if (type->code () == TYPE_CODE_FLT)
|
||||
return value_from_host_double (type, scm_to_double (obj));
|
||||
else
|
||||
{
|
||||
|
|
|
@ -529,7 +529,7 @@ gdbscm_type_code (SCM self)
|
|||
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
|
||||
struct type *type = t_smob->type;
|
||||
|
||||
return scm_from_int (TYPE_CODE (type));
|
||||
return scm_from_int (type->code ());
|
||||
}
|
||||
|
||||
/* (type-fields <gdb:type>) -> list
|
||||
|
@ -577,9 +577,9 @@ gdbscm_type_tag (SCM self)
|
|||
struct type *type = t_smob->type;
|
||||
const char *tagname = nullptr;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_ENUM)
|
||||
tagname = TYPE_NAME (type);
|
||||
|
||||
if (tagname == nullptr)
|
||||
|
@ -685,17 +685,17 @@ tyscm_get_composite (struct type *type)
|
|||
}
|
||||
|
||||
GDBSCM_HANDLE_GDB_EXCEPTION (exc);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_PTR
|
||||
&& TYPE_CODE (type) != TYPE_CODE_REF)
|
||||
if (type->code () != TYPE_CODE_PTR
|
||||
&& type->code () != TYPE_CODE_REF)
|
||||
break;
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
}
|
||||
|
||||
/* If this is not a struct, union, or enum type, raise TypeError
|
||||
exception. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION
|
||||
&& TYPE_CODE (type) != TYPE_CODE_ENUM)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION
|
||||
&& type->code () != TYPE_CODE_ENUM)
|
||||
return NULL;
|
||||
|
||||
return type;
|
||||
|
@ -817,12 +817,12 @@ gdbscm_type_range (SCM self)
|
|||
/* Initialize these to appease GCC warnings. */
|
||||
LONGEST low = 0, high = 0;
|
||||
|
||||
SCM_ASSERT_TYPE (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (type) == TYPE_CODE_STRING
|
||||
|| TYPE_CODE (type) == TYPE_CODE_RANGE,
|
||||
SCM_ASSERT_TYPE (type->code () == TYPE_CODE_ARRAY
|
||||
|| type->code () == TYPE_CODE_STRING
|
||||
|| type->code () == TYPE_CODE_RANGE,
|
||||
self, SCM_ARG1, FUNC_NAME, _("ranged type"));
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
case TYPE_CODE_STRING:
|
||||
|
@ -1163,7 +1163,7 @@ gdbscm_field_enumval (SCM self)
|
|||
struct field *field = tyscm_field_smob_to_field (f_smob);
|
||||
struct type *type = tyscm_field_smob_containing_type (f_smob);
|
||||
|
||||
SCM_ASSERT_TYPE (TYPE_CODE (type) == TYPE_CODE_ENUM,
|
||||
SCM_ASSERT_TYPE (type->code () == TYPE_CODE_ENUM,
|
||||
self, SCM_ARG1, FUNC_NAME, _("enum type"));
|
||||
|
||||
return scm_from_long (FIELD_ENUMVAL (*field));
|
||||
|
@ -1180,7 +1180,7 @@ gdbscm_field_bitpos (SCM self)
|
|||
struct field *field = tyscm_field_smob_to_field (f_smob);
|
||||
struct type *type = tyscm_field_smob_containing_type (f_smob);
|
||||
|
||||
SCM_ASSERT_TYPE (TYPE_CODE (type) != TYPE_CODE_ENUM,
|
||||
SCM_ASSERT_TYPE (type->code () != TYPE_CODE_ENUM,
|
||||
self, SCM_ARG1, FUNC_NAME, _("non-enum type"));
|
||||
|
||||
return scm_from_long (FIELD_BITPOS (*field));
|
||||
|
@ -1222,7 +1222,7 @@ gdbscm_field_baseclass_p (SCM self)
|
|||
= tyscm_get_field_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
|
||||
struct type *type = tyscm_field_smob_containing_type (f_smob);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
return scm_from_bool (f_smob->field_num < TYPE_N_BASECLASSES (type));
|
||||
return SCM_BOOL_F;
|
||||
}
|
||||
|
|
|
@ -470,7 +470,7 @@ gdbscm_value_referenced_value (SCM self)
|
|||
|
||||
struct value *res_val;
|
||||
|
||||
switch (TYPE_CODE (check_typedef (value_type (value))))
|
||||
switch (check_typedef (value_type (value))->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
res_val = value_ind (value);
|
||||
|
@ -523,12 +523,12 @@ gdbscm_value_dynamic_type (SCM self)
|
|||
type = value_type (value);
|
||||
type = check_typedef (type);
|
||||
|
||||
if (((TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
|| (TYPE_CODE (type) == TYPE_CODE_REF))
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
|
||||
if (((type->code () == TYPE_CODE_PTR)
|
||||
|| (type->code () == TYPE_CODE_REF))
|
||||
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_STRUCT))
|
||||
{
|
||||
struct value *target;
|
||||
int was_pointer = TYPE_CODE (type) == TYPE_CODE_PTR;
|
||||
int was_pointer = type->code () == TYPE_CODE_PTR;
|
||||
|
||||
if (was_pointer)
|
||||
target = value_ind (value);
|
||||
|
@ -544,7 +544,7 @@ gdbscm_value_dynamic_type (SCM self)
|
|||
type = lookup_lvalue_reference_type (type);
|
||||
}
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
else if (type->code () == TYPE_CODE_STRUCT)
|
||||
type = value_rtti_type (value, NULL, NULL, NULL);
|
||||
else
|
||||
{
|
||||
|
@ -682,8 +682,8 @@ gdbscm_value_subscript (SCM self, SCM index_scm)
|
|||
a subscript. */
|
||||
struct value *tmp = coerce_ref (value);
|
||||
struct type *tmp_type = check_typedef (value_type (tmp));
|
||||
if (TYPE_CODE (tmp_type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (tmp_type) != TYPE_CODE_PTR)
|
||||
if (tmp_type->code () != TYPE_CODE_ARRAY
|
||||
&& tmp_type->code () != TYPE_CODE_PTR)
|
||||
error (_("Cannot subscript requested type"));
|
||||
|
||||
struct value *res_val = value_subscript (tmp, value_as_long (index));
|
||||
|
@ -715,7 +715,7 @@ gdbscm_value_call (SCM self, SCM args)
|
|||
}
|
||||
|
||||
GDBSCM_HANDLE_GDB_EXCEPTION (exc);
|
||||
SCM_ASSERT_TYPE (TYPE_CODE (ftype) == TYPE_CODE_FUNC, self,
|
||||
SCM_ASSERT_TYPE (ftype->code () == TYPE_CODE_FUNC, self,
|
||||
SCM_ARG1, FUNC_NAME,
|
||||
_("function (value of TYPE_CODE_FUNC)"));
|
||||
|
||||
|
@ -796,11 +796,11 @@ gdbscm_value_to_bytevector (SCM self)
|
|||
static int
|
||||
is_intlike (struct type *type, int ptr_ok)
|
||||
{
|
||||
return (TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM
|
||||
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|
||||
|| TYPE_CODE (type) == TYPE_CODE_CHAR
|
||||
|| (ptr_ok && TYPE_CODE (type) == TYPE_CODE_PTR));
|
||||
return (type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_ENUM
|
||||
|| type->code () == TYPE_CODE_BOOL
|
||||
|| type->code () == TYPE_CODE_CHAR
|
||||
|| (ptr_ok && type->code () == TYPE_CODE_PTR));
|
||||
}
|
||||
|
||||
/* (value->bool <gdb:value>) -> boolean
|
||||
|
@ -833,7 +833,7 @@ gdbscm_value_to_bool (SCM self)
|
|||
|
||||
try
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
l = value_as_address (value);
|
||||
else
|
||||
l = value_as_long (value);
|
||||
|
@ -877,7 +877,7 @@ gdbscm_value_to_integer (SCM self)
|
|||
|
||||
try
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
l = value_as_address (value);
|
||||
else
|
||||
l = value_as_long (value);
|
||||
|
@ -920,7 +920,7 @@ gdbscm_value_to_real (SCM self)
|
|||
}
|
||||
|
||||
GDBSCM_HANDLE_GDB_EXCEPTION (exc);
|
||||
SCM_ASSERT_TYPE (is_intlike (type, 0) || TYPE_CODE (type) == TYPE_CODE_FLT,
|
||||
SCM_ASSERT_TYPE (is_intlike (type, 0) || type->code () == TYPE_CODE_FLT,
|
||||
self, SCM_ARG1, FUNC_NAME, _("number"));
|
||||
|
||||
try
|
||||
|
@ -1113,7 +1113,7 @@ gdbscm_value_to_lazy_string (SCM self, SCM rest)
|
|||
type = value_type (value);
|
||||
realtype = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (realtype))
|
||||
switch (realtype->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
{
|
||||
|
|
|
@ -740,7 +740,7 @@ h8300_extract_return_value (struct type *type, struct regcache *regcache,
|
|||
store_unsigned_integer (valbuf + 2, 2, byte_order, c);
|
||||
break;
|
||||
case 8: /* long long is now 8 bytes. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
if (type->code () == TYPE_CODE_INT)
|
||||
{
|
||||
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &addr);
|
||||
c = read_memory_unsigned_integer ((CORE_ADDR) addr, len, byte_order);
|
||||
|
@ -771,7 +771,7 @@ h8300h_extract_return_value (struct type *type, struct regcache *regcache,
|
|||
store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
|
||||
break;
|
||||
case 8: /* long long is now 8 bytes. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
if (type->code () == TYPE_CODE_INT)
|
||||
{
|
||||
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
|
||||
store_unsigned_integer (valbuf, 4, byte_order, c);
|
||||
|
@ -792,8 +792,8 @@ h8300_use_struct_convention (struct type *value_type)
|
|||
/* Types of 1, 2 or 4 bytes are returned in R0/R1, everything else on the
|
||||
stack. */
|
||||
|
||||
if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (value_type) == TYPE_CODE_UNION)
|
||||
if (value_type->code () == TYPE_CODE_STRUCT
|
||||
|| value_type->code () == TYPE_CODE_UNION)
|
||||
return 1;
|
||||
return !(TYPE_LENGTH (value_type) == 1
|
||||
|| TYPE_LENGTH (value_type) == 2
|
||||
|
@ -805,14 +805,14 @@ h8300h_use_struct_convention (struct type *value_type)
|
|||
{
|
||||
/* Types of 1, 2 or 4 bytes are returned in R0, INT types of 8 bytes are
|
||||
returned in R0/R1, everything else on the stack. */
|
||||
if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (value_type) == TYPE_CODE_UNION)
|
||||
if (value_type->code () == TYPE_CODE_STRUCT
|
||||
|| value_type->code () == TYPE_CODE_UNION)
|
||||
return 1;
|
||||
return !(TYPE_LENGTH (value_type) == 1
|
||||
|| TYPE_LENGTH (value_type) == 2
|
||||
|| TYPE_LENGTH (value_type) == 4
|
||||
|| (TYPE_LENGTH (value_type) == 8
|
||||
&& TYPE_CODE (value_type) == TYPE_CODE_INT));
|
||||
&& value_type->code () == TYPE_CODE_INT));
|
||||
}
|
||||
|
||||
/* Function: store_return_value
|
||||
|
|
|
@ -763,8 +763,8 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
store_unsigned_integer (param_val, 4, byte_order,
|
||||
struct_end - struct_ptr);
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
|
||||
else if (type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
/* Integer value store, right aligned. "unpack_long"
|
||||
takes care of any sign-extension problems. */
|
||||
|
@ -773,7 +773,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
unpack_long (type,
|
||||
value_contents (arg)));
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
else if (type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
/* Floating point value store, right aligned. */
|
||||
param_len = align_up (TYPE_LENGTH (type), 4);
|
||||
|
@ -876,7 +876,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
static int
|
||||
hppa64_integral_or_pointer_p (const struct type *type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_BOOL:
|
||||
|
@ -903,7 +903,7 @@ hppa64_integral_or_pointer_p (const struct type *type)
|
|||
static int
|
||||
hppa64_floating_p (const struct type *type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
{
|
||||
|
@ -1064,8 +1064,8 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
|
||||
/* If we are passing a function pointer, make sure we pass a function
|
||||
descriptor instead of the function entry address. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)
|
||||
if (type->code () == TYPE_CODE_PTR
|
||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
ULONGEST codeptr, fptr;
|
||||
|
||||
|
@ -1144,7 +1144,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
/* The value always lives in the right hand end of the register
|
||||
(or register pair)? */
|
||||
int b;
|
||||
int reg = TYPE_CODE (type) == TYPE_CODE_FLT ? HPPA_FP4_REGNUM : 28;
|
||||
int reg = type->code () == TYPE_CODE_FLT ? HPPA_FP4_REGNUM : 28;
|
||||
int part = TYPE_LENGTH (type) % 4;
|
||||
/* The left hand register contains only part of the value,
|
||||
transfer that first so that the rest can be xfered as entire
|
||||
|
|
|
@ -109,7 +109,7 @@ darwin_dwarf_signal_frame_p (struct gdbarch *gdbarch,
|
|||
static int
|
||||
i386_m128_p (struct type *type)
|
||||
{
|
||||
return (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
||||
return (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
||||
&& TYPE_LENGTH (type) == 16);
|
||||
}
|
||||
|
||||
|
@ -124,15 +124,15 @@ 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) == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
|
||||
if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
|
||||
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
|
||||
aligned.
|
||||
5. The caller places structures with vector elements on the stack,
|
||||
16-byte aligned. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
int i;
|
||||
int res = 4;
|
||||
|
|
|
@ -2633,14 +2633,14 @@ static int
|
|||
i386_16_byte_align_p (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
if ((TYPE_CODE (type) == TYPE_CODE_DECFLOAT
|
||||
|| (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)))
|
||||
if ((type->code () == TYPE_CODE_DECFLOAT
|
||||
|| (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)))
|
||||
&& TYPE_LENGTH (type) == 16)
|
||||
return 1;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
return i386_16_byte_align_p (TYPE_TARGET_TYPE (type));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < TYPE_NFIELDS (type); i++)
|
||||
|
@ -2811,7 +2811,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
|
|||
int len = TYPE_LENGTH (type);
|
||||
gdb_byte buf[I386_MAX_REGISTER_SIZE];
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
if (tdep->st0_regnum < 0)
|
||||
{
|
||||
|
@ -2861,7 +2861,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
|
|||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
ULONGEST fstat;
|
||||
gdb_byte buf[I386_MAX_REGISTER_SIZE];
|
||||
|
@ -2938,7 +2938,7 @@ static int
|
|||
i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
||||
gdb_assert (code == TYPE_CODE_STRUCT
|
||||
|
@ -2955,7 +2955,7 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
|
|||
if (code == TYPE_CODE_STRUCT && TYPE_NFIELDS (type) == 1)
|
||||
{
|
||||
type = check_typedef (TYPE_FIELD_TYPE (type, 0));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (type->code () == TYPE_CODE_FLT)
|
||||
return (len == 4 || len == 8 || len == 12);
|
||||
}
|
||||
|
||||
|
@ -2973,7 +2973,7 @@ i386_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *type, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
|
||||
if (((code == TYPE_CODE_STRUCT
|
||||
|| code == TYPE_CODE_UNION
|
||||
|
@ -8398,13 +8398,13 @@ i386_type_align (struct gdbarch *gdbarch, struct type *type)
|
|||
|
||||
if (gdbarch_ptr_bit (gdbarch) == 32)
|
||||
{
|
||||
if ((TYPE_CODE (type) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if ((type->code () == TYPE_CODE_INT
|
||||
|| type->code () == TYPE_CODE_FLT)
|
||||
&& TYPE_LENGTH (type) > 4)
|
||||
return 4;
|
||||
|
||||
/* Handle x86's funny long double. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
if (type->code () == TYPE_CODE_FLT
|
||||
&& gdbarch_long_double_bit (gdbarch) == TYPE_LENGTH (type) * 8)
|
||||
return 4;
|
||||
}
|
||||
|
|
|
@ -214,15 +214,15 @@ i386_windows_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
bool thiscall = false;
|
||||
|
||||
struct type *type = check_typedef (value_type (function));
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
/* read_subroutine_type sets for non-static member functions the
|
||||
artificial flag of the first parameter ('this' pointer). */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_METHOD
|
||||
if (type->code () == TYPE_CODE_METHOD
|
||||
&& TYPE_NFIELDS (type) > 0
|
||||
&& TYPE_FIELD_ARTIFICIAL (type, 0)
|
||||
&& TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_PTR)
|
||||
&& TYPE_FIELD_TYPE (type, 0)->code () == TYPE_CODE_PTR)
|
||||
thiscall = 1;
|
||||
|
||||
return i386_thiscall_push_dummy_call (gdbarch, function, regcache, bp_addr,
|
||||
|
|
|
@ -332,7 +332,7 @@ i387_convert_register_p (struct gdbarch *gdbarch, int regnum,
|
|||
/* Floating point registers must be converted unless we are
|
||||
accessing them in their hardware type or TYPE is not float. */
|
||||
if (type == i387_ext_type (gdbarch)
|
||||
|| TYPE_CODE (type) != TYPE_CODE_FLT)
|
||||
|| type->code () != TYPE_CODE_FLT)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
@ -355,7 +355,7 @@ i387_register_to_value (struct frame_info *frame, int regnum,
|
|||
gdb_assert (i386_fp_regnum_p (gdbarch, regnum));
|
||||
|
||||
/* We only support floating-point values. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_FLT)
|
||||
if (type->code () != TYPE_CODE_FLT)
|
||||
{
|
||||
warning (_("Cannot convert floating-point register value "
|
||||
"to non-floating-point type."));
|
||||
|
@ -387,7 +387,7 @@ i387_value_to_register (struct frame_info *frame, int regnum,
|
|||
gdb_assert (i386_fp_regnum_p (gdbarch, regnum));
|
||||
|
||||
/* We only support floating-point values. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_FLT)
|
||||
if (type->code () != TYPE_CODE_FLT)
|
||||
{
|
||||
warning (_("Cannot convert non-floating-point type "
|
||||
"to floating-point register value."));
|
||||
|
|
|
@ -330,7 +330,7 @@ ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|
|||
if (group == all_reggroup)
|
||||
return 1;
|
||||
vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
|
||||
float_p = TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT;
|
||||
float_p = register_type (gdbarch, regnum)->code () == TYPE_CODE_FLT;
|
||||
raw_p = regnum < NUM_IA64_RAW_REGS;
|
||||
if (group == float_reggroup)
|
||||
return float_p;
|
||||
|
@ -1212,7 +1212,7 @@ static int
|
|||
ia64_convert_register_p (struct gdbarch *gdbarch, int regno, struct type *type)
|
||||
{
|
||||
return (regno >= IA64_FR0_REGNUM && regno <= IA64_FR127_REGNUM
|
||||
&& TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
&& type->code () == TYPE_CODE_FLT
|
||||
&& type != ia64_ext_type (gdbarch));
|
||||
}
|
||||
|
||||
|
@ -3149,9 +3149,9 @@ ia64_use_struct_convention (struct type *type)
|
|||
|
||||
/* Don't use the struct convention for anything but structure,
|
||||
union, or array types. */
|
||||
if (!(TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY))
|
||||
if (!(type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_ARRAY))
|
||||
return 0;
|
||||
|
||||
/* HFAs are structures (or arrays) consisting entirely of floating
|
||||
|
@ -3173,8 +3173,8 @@ ia64_use_struct_convention (struct type *type)
|
|||
static int
|
||||
ia64_struct_type_p (const struct type *type)
|
||||
{
|
||||
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION);
|
||||
return (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3320,7 +3320,7 @@ ia64_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
static int
|
||||
is_float_or_hfa_type_recurse (struct type *t, struct type **etp)
|
||||
{
|
||||
switch (TYPE_CODE (t))
|
||||
switch (t->code ())
|
||||
{
|
||||
case TYPE_CODE_FLT:
|
||||
if (*etp)
|
||||
|
@ -3374,7 +3374,7 @@ is_float_or_hfa_type (struct type *t)
|
|||
static int
|
||||
slot_alignment_is_next_even (struct type *t)
|
||||
{
|
||||
switch (TYPE_CODE (t))
|
||||
switch (t->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_FLT:
|
||||
|
@ -3699,7 +3699,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
if ((nslots & 1) && slot_alignment_is_next_even (type))
|
||||
nslots++;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FUNC)
|
||||
if (type->code () == TYPE_CODE_FUNC)
|
||||
nfuncargs++;
|
||||
|
||||
nslots += (len + 7) / 8;
|
||||
|
@ -3740,9 +3740,9 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
len = TYPE_LENGTH (type);
|
||||
|
||||
/* Special handling for function parameters. */
|
||||
if (len == 8
|
||||
&& TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)
|
||||
if (len == 8
|
||||
&& type->code () == TYPE_CODE_PTR
|
||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
gdb_byte val_buf[8];
|
||||
ULONGEST faddr = extract_unsigned_integer (value_contents (arg),
|
||||
|
|
|
@ -169,7 +169,7 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg,
|
|||
saved by the called function. */
|
||||
arg = value_coerce_to_target (arg);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_REF:
|
||||
case TYPE_CODE_RVALUE_REF:
|
||||
|
@ -184,7 +184,7 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg,
|
|||
if the value was not previously in memory - in some cases
|
||||
we should clearly be allowing this, but how? */
|
||||
new_value = value_cast (TYPE_TARGET_TYPE (type), arg);
|
||||
new_value = value_ref (new_value, TYPE_CODE (type));
|
||||
new_value = value_ref (new_value, type->code ());
|
||||
return new_value;
|
||||
}
|
||||
case TYPE_CODE_INT:
|
||||
|
@ -260,20 +260,20 @@ find_function_addr (struct value *function,
|
|||
part of it. */
|
||||
|
||||
/* Determine address to call. */
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
|
||||
if (ftype->code () == TYPE_CODE_FUNC
|
||||
|| ftype->code () == TYPE_CODE_METHOD)
|
||||
funaddr = value_address (function);
|
||||
else if (TYPE_CODE (ftype) == TYPE_CODE_PTR)
|
||||
else if (ftype->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
funaddr = value_as_address (function);
|
||||
ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
|
||||
if (ftype->code () == TYPE_CODE_FUNC
|
||||
|| ftype->code () == TYPE_CODE_METHOD)
|
||||
funaddr = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
|
||||
current_top_target ());
|
||||
}
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
|
||||
if (ftype->code () == TYPE_CODE_FUNC
|
||||
|| ftype->code () == TYPE_CODE_METHOD)
|
||||
{
|
||||
if (TYPE_GNU_IFUNC (ftype))
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ find_function_addr (struct value *function,
|
|||
else
|
||||
value_type = TYPE_TARGET_TYPE (ftype);
|
||||
}
|
||||
else if (TYPE_CODE (ftype) == TYPE_CODE_INT)
|
||||
else if (ftype->code () == TYPE_CODE_INT)
|
||||
{
|
||||
/* Handle the case of functions lacking debugging info.
|
||||
Their values are characters since their addresses are char. */
|
||||
|
@ -438,7 +438,7 @@ get_call_return_value (struct call_return_meta_info *ri)
|
|||
thread_info *thr = inferior_thread ();
|
||||
bool stack_temporaries = thread_stack_temporaries_enabled_p (thr);
|
||||
|
||||
if (TYPE_CODE (ri->value_type) == TYPE_CODE_VOID)
|
||||
if (ri->value_type->code () == TYPE_CODE_VOID)
|
||||
retval = allocate_value (ri->value_type);
|
||||
else if (ri->struct_return_p)
|
||||
{
|
||||
|
@ -1025,7 +1025,7 @@ call_function_by_hand_dummy (struct value *function,
|
|||
|
||||
/* FIXME drow/2002-05-31: Should just always mark methods as
|
||||
prototyped. Can we respect TYPE_VARARGS? Probably not. */
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
|
||||
if (ftype->code () == TYPE_CODE_METHOD)
|
||||
prototyped = 1;
|
||||
if (TYPE_TARGET_TYPE (ftype) == NULL && TYPE_NFIELDS (ftype) == 0
|
||||
&& default_return_type != NULL)
|
||||
|
|
10
gdb/infcmd.c
10
gdb/infcmd.c
|
@ -1589,7 +1589,7 @@ get_return_value (struct value *function, struct type *value_type)
|
|||
struct value *value;
|
||||
|
||||
value_type = check_typedef (value_type);
|
||||
gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
|
||||
gdb_assert (value_type->code () != TYPE_CODE_VOID);
|
||||
|
||||
/* FIXME: 2003-09-27: When returning from a nested inferior function
|
||||
call, it's possible (with no help from the architecture vector)
|
||||
|
@ -1680,7 +1680,7 @@ void
|
|||
print_return_value (struct ui_out *uiout, struct return_value_info *rv)
|
||||
{
|
||||
if (rv->type == NULL
|
||||
|| TYPE_CODE (check_typedef (rv->type)) == TYPE_CODE_VOID)
|
||||
|| check_typedef (rv->type)->code () == TYPE_CODE_VOID)
|
||||
return;
|
||||
|
||||
try
|
||||
|
@ -1744,7 +1744,7 @@ finish_command_fsm::should_stop (struct thread_info *tp)
|
|||
internal_error (__FILE__, __LINE__,
|
||||
_("finish_command: function has no target type"));
|
||||
|
||||
if (TYPE_CODE (check_typedef (rv->type)) != TYPE_CODE_VOID)
|
||||
if (check_typedef (rv->type)->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
struct value *func;
|
||||
|
||||
|
@ -2250,8 +2250,8 @@ default_print_one_register_info (struct ui_file *file,
|
|||
|
||||
/* If virtual format is floating, print it that way, and in raw
|
||||
hex. */
|
||||
if (TYPE_CODE (regtype) == TYPE_CODE_FLT
|
||||
|| TYPE_CODE (regtype) == TYPE_CODE_DECFLOAT)
|
||||
if (regtype->code () == TYPE_CODE_FLT
|
||||
|| regtype->code () == TYPE_CODE_DECFLOAT)
|
||||
{
|
||||
struct value_print_options opts;
|
||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
||||
|
|
|
@ -89,7 +89,7 @@ iq2000_pointer_to_address (struct gdbarch *gdbarch,
|
|||
struct type * type, const gdb_byte * buf)
|
||||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
|
||||
enum type_code target = TYPE_TARGET_TYPE (type)->code ();
|
||||
CORE_ADDR addr
|
||||
= extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
|
||||
|
||||
|
@ -109,7 +109,7 @@ iq2000_address_to_pointer (struct gdbarch *gdbarch,
|
|||
struct type *type, gdb_byte *buf, CORE_ADDR addr)
|
||||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
|
||||
enum type_code target = TYPE_TARGET_TYPE (type)->code ();
|
||||
|
||||
if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
|
||||
addr = insn_ptr_from_addr (addr);
|
||||
|
@ -504,8 +504,8 @@ iq2000_store_return_value (struct type *type, struct regcache *regcache,
|
|||
static int
|
||||
iq2000_use_struct_convention (struct type *type)
|
||||
{
|
||||
return ((TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
|| (TYPE_CODE (type) == TYPE_CODE_UNION))
|
||||
return ((type->code () == TYPE_CODE_STRUCT)
|
||||
|| (type->code () == TYPE_CODE_UNION))
|
||||
&& TYPE_LENGTH (type) > 8;
|
||||
}
|
||||
|
||||
|
@ -597,11 +597,11 @@ iq2000_pass_8bytetype_by_address (struct type *type)
|
|||
struct type *ftype;
|
||||
|
||||
/* Skip typedefs. */
|
||||
while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
|
||||
while (type->code () == TYPE_CODE_TYPEDEF)
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
/* Non-struct and non-union types are always passed by value. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
return 0;
|
||||
/* Structs with more than 1 field are always passed by address. */
|
||||
if (TYPE_NFIELDS (type) != 1)
|
||||
|
@ -612,11 +612,11 @@ iq2000_pass_8bytetype_by_address (struct type *type)
|
|||
if (TYPE_LENGTH (ftype) != 8)
|
||||
return 1;
|
||||
/* Skip typedefs of field type. */
|
||||
while (TYPE_CODE (ftype) == TYPE_CODE_TYPEDEF)
|
||||
while (ftype->code () == TYPE_CODE_TYPEDEF)
|
||||
ftype = TYPE_TARGET_TYPE (ftype);
|
||||
/* If field is int or float, pass by value. */
|
||||
if (TYPE_CODE (ftype) == TYPE_CODE_FLT
|
||||
|| TYPE_CODE (ftype) == TYPE_CODE_INT)
|
||||
if (ftype->code () == TYPE_CODE_FLT
|
||||
|| ftype->code () == TYPE_CODE_INT)
|
||||
return 0;
|
||||
/* Everything else, pass by address. */
|
||||
return 1;
|
||||
|
|
|
@ -410,7 +410,7 @@ language_info (int quietly)
|
|||
int
|
||||
pointer_type (struct type *type)
|
||||
{
|
||||
return TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type);
|
||||
return type->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type);
|
||||
}
|
||||
|
||||
|
||||
|
@ -710,12 +710,12 @@ bool
|
|||
default_is_string_type_p (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
while (TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
while (type->code () == TYPE_CODE_REF)
|
||||
{
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
type = check_typedef (type);
|
||||
}
|
||||
return (TYPE_CODE (type) == TYPE_CODE_STRING);
|
||||
return (type->code () == TYPE_CODE_STRING);
|
||||
}
|
||||
|
||||
/* See language.h. */
|
||||
|
@ -981,7 +981,7 @@ language_bool_type (const struct language_defn *la,
|
|||
{
|
||||
struct type *type = SYMBOL_TYPE (sym);
|
||||
|
||||
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
|
||||
if (type && type->code () == TYPE_CODE_BOOL)
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3491,9 +3491,9 @@ decode_compound_collector::operator () (block_symbol *bsym)
|
|||
|
||||
t = SYMBOL_TYPE (sym);
|
||||
t = check_typedef (t);
|
||||
if (TYPE_CODE (t) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (t) != TYPE_CODE_UNION
|
||||
&& TYPE_CODE (t) != TYPE_CODE_NAMESPACE)
|
||||
if (t->code () != TYPE_CODE_STRUCT
|
||||
&& t->code () != TYPE_CODE_UNION
|
||||
&& t->code () != TYPE_CODE_NAMESPACE)
|
||||
return true; /* Continue iterating. */
|
||||
|
||||
slot = htab_find_slot (m_unique_syms, sym, INSERT);
|
||||
|
@ -4164,7 +4164,7 @@ linespec_parse_variable (struct linespec_state *self, const char *variable)
|
|||
sscanf ((variable[1] == '$') ? variable + 2 : variable + 1, "%d", &index);
|
||||
val_history
|
||||
= access_value_history ((variable[1] == '$') ? -index : index);
|
||||
if (TYPE_CODE (value_type (val_history)) != TYPE_CODE_INT)
|
||||
if (value_type (val_history)->code () != TYPE_CODE_INT)
|
||||
error (_("History values used in line "
|
||||
"specs must have integer values."));
|
||||
offset.offset = value_as_long (val_history);
|
||||
|
|
|
@ -258,7 +258,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
ULONGEST val;
|
||||
|
||||
/* Promote small integer types to int. */
|
||||
switch (TYPE_CODE (arg_type))
|
||||
switch (arg_type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_BOOL:
|
||||
|
@ -309,15 +309,15 @@ lm32_extract_return_value (struct type *type, struct regcache *regcache,
|
|||
ULONGEST l;
|
||||
CORE_ADDR return_buffer;
|
||||
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION
|
||||
&& TYPE_CODE (type) != TYPE_CODE_ARRAY && TYPE_LENGTH (type) <= 4)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION
|
||||
&& type->code () != TYPE_CODE_ARRAY && TYPE_LENGTH (type) <= 4)
|
||||
{
|
||||
/* Return value is returned in a single register. */
|
||||
regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
|
||||
store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, l);
|
||||
}
|
||||
else if ((TYPE_CODE (type) == TYPE_CODE_INT) && (TYPE_LENGTH (type) == 8))
|
||||
else if ((type->code () == TYPE_CODE_INT) && (TYPE_LENGTH (type) == 8))
|
||||
{
|
||||
/* 64-bit values are returned in a register pair. */
|
||||
regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
|
||||
|
@ -368,7 +368,7 @@ lm32_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *valtype, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (valtype);
|
||||
enum type_code code = valtype->code ();
|
||||
|
||||
if (code == TYPE_CODE_STRUCT
|
||||
|| code == TYPE_CODE_UNION
|
||||
|
|
|
@ -181,15 +181,15 @@ static bool
|
|||
m2_is_string_type_p (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
if (type->code () == TYPE_CODE_ARRAY
|
||||
&& TYPE_LENGTH (type) > 0
|
||||
&& TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
|
||||
{
|
||||
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
if (TYPE_LENGTH (elttype) == 1
|
||||
&& (TYPE_CODE (elttype) == TYPE_CODE_INT
|
||||
|| TYPE_CODE (elttype) == TYPE_CODE_CHAR))
|
||||
&& (elttype->code () == TYPE_CODE_INT
|
||||
|| elttype->code () == TYPE_CODE_CHAR))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
|
|||
{
|
||||
struct value *temp = arg1;
|
||||
type = TYPE_FIELD_TYPE (type, 0);
|
||||
if (type == NULL || (TYPE_CODE (type) != TYPE_CODE_PTR))
|
||||
if (type == NULL || (type->code () != TYPE_CODE_PTR))
|
||||
{
|
||||
warning (_("internal error: unbounded "
|
||||
"array structure is unknown"));
|
||||
|
@ -269,7 +269,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
|
|||
return value_ind (value_ptradd (arg1, value_as_long (arg2)));
|
||||
}
|
||||
else
|
||||
if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
|
||||
if (type->code () != TYPE_CODE_ARRAY)
|
||||
{
|
||||
if (TYPE_NAME (type))
|
||||
error (_("cannot subscript something of type `%s'"),
|
||||
|
|
|
@ -86,7 +86,7 @@ m2_print_type (struct type *type, const char *varstring,
|
|||
return;
|
||||
}
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_SET:
|
||||
m2_short_set(type, stream, show, level);
|
||||
|
@ -282,7 +282,7 @@ m2_procedure (struct type *type, struct ui_file *stream,
|
|||
fprintf_filtered (stream, "PROCEDURE ");
|
||||
m2_type_name (type, stream);
|
||||
if (TYPE_TARGET_TYPE (type) == NULL
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
|
||||
|| TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
int i, len = TYPE_NFIELDS (type);
|
||||
|
||||
|
@ -341,7 +341,7 @@ m2_is_long_set (struct type *type)
|
|||
int len, i;
|
||||
struct type *range;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
|
||||
/* check if all fields of the RECORD are consecutive sets. */
|
||||
|
@ -351,7 +351,7 @@ m2_is_long_set (struct type *type)
|
|||
{
|
||||
if (TYPE_FIELD_TYPE (type, i) == NULL)
|
||||
return 0;
|
||||
if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) != TYPE_CODE_SET)
|
||||
if (TYPE_FIELD_TYPE (type, i)->code () != TYPE_CODE_SET)
|
||||
return 0;
|
||||
if (TYPE_FIELD_NAME (type, i) != NULL
|
||||
&& (strcmp (TYPE_FIELD_NAME (type, i), "") != 0))
|
||||
|
@ -376,7 +376,7 @@ static int
|
|||
m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_CHAR:
|
||||
if (TYPE_LENGTH (type) < sizeof (LONGEST))
|
||||
|
@ -407,7 +407,7 @@ m2_is_long_set_of_type (struct type *type, struct type **of_type)
|
|||
LONGEST l1, l2;
|
||||
LONGEST h1, h2;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
len = TYPE_NFIELDS (type);
|
||||
i = TYPE_N_BASECLASSES (type);
|
||||
|
@ -482,7 +482,7 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level,
|
|||
int
|
||||
m2_is_unbounded_array (struct type *type)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
/*
|
||||
* check if we have a structure with exactly two fields named
|
||||
|
@ -496,7 +496,7 @@ m2_is_unbounded_array (struct type *type)
|
|||
return 0;
|
||||
if (strcmp (TYPE_FIELD_NAME (type, 1), "_m2_high") != 0)
|
||||
return 0;
|
||||
if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) != TYPE_CODE_PTR)
|
||||
if (TYPE_FIELD_TYPE (type, 0)->code () != TYPE_CODE_PTR)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -542,9 +542,9 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
|
|||
wrap_here (" ");
|
||||
if (show < 0)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
fprintf_filtered (stream, "RECORD ... END ");
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
else if (type->code () == TYPE_CODE_UNION)
|
||||
fprintf_filtered (stream, "CASE ... END ");
|
||||
}
|
||||
else if (show > 0)
|
||||
|
@ -552,9 +552,9 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
|
|||
int i;
|
||||
int len = TYPE_NFIELDS (type);
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
fprintf_filtered (stream, "RECORD\n");
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
else if (type->code () == TYPE_CODE_UNION)
|
||||
/* i18n: Do not translate "CASE" and "OF". */
|
||||
fprintf_filtered (stream, _("CASE <variant> OF\n"));
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high)
|
|||
{
|
||||
int len, i;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
len = TYPE_NFIELDS (type);
|
||||
i = TYPE_N_BASECLASSES (type);
|
||||
|
@ -191,7 +191,7 @@ print_unpacked_pointer (struct type *type,
|
|||
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
int want_space = 0;
|
||||
|
||||
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
|
||||
if (elttype->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* Try to print what function it points to. */
|
||||
print_function_pointer_address (options, gdbarch, addr, stream);
|
||||
|
@ -209,7 +209,7 @@ print_unpacked_pointer (struct type *type,
|
|||
pointed to, unless pointer is null. */
|
||||
|
||||
if (TYPE_LENGTH (elttype) == 1
|
||||
&& TYPE_CODE (elttype) == TYPE_CODE_INT
|
||||
&& elttype->code () == TYPE_CODE_INT
|
||||
&& (options->format == 0 || options->format == 's')
|
||||
&& addr != 0)
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ print_variable_at_address (struct type *type,
|
|||
fputs_filtered (paddress (gdbarch, addr), stream);
|
||||
fprintf_filtered (stream, "] : ");
|
||||
|
||||
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
|
||||
if (elttype->code () != TYPE_CODE_UNDEF)
|
||||
{
|
||||
struct value *deref_val =
|
||||
value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr));
|
||||
|
@ -267,9 +267,9 @@ m2_print_array_contents (struct value *val,
|
|||
{
|
||||
/* For an array of chars, print with string syntax. */
|
||||
if (TYPE_LENGTH (type) == 1 &&
|
||||
((TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
((type->code () == TYPE_CODE_INT)
|
||||
|| ((current_language->la_language == language_m2)
|
||||
&& (TYPE_CODE (type) == TYPE_CODE_CHAR)))
|
||||
&& (type->code () == TYPE_CODE_CHAR)))
|
||||
&& (options->format == 0 || options->format == 's'))
|
||||
val_print_string (type, NULL, value_address (val), len+1, stream,
|
||||
options);
|
||||
|
@ -309,7 +309,7 @@ m2_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
|
|||
const CORE_ADDR address = value_address (val);
|
||||
|
||||
struct type *type = check_typedef (value_type (val));
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
|
||||
|
@ -318,9 +318,9 @@ m2_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
|
|||
len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype);
|
||||
/* For an array of chars, print with string syntax. */
|
||||
if (TYPE_LENGTH (elttype) == 1 &&
|
||||
((TYPE_CODE (elttype) == TYPE_CODE_INT)
|
||||
((elttype->code () == TYPE_CODE_INT)
|
||||
|| ((current_language->la_language == language_m2)
|
||||
&& (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
|
||||
&& (elttype->code () == TYPE_CODE_CHAR)))
|
||||
&& (options->format == 0 || options->format == 's'))
|
||||
{
|
||||
/* If requested, look for the first null char and only print
|
||||
|
|
|
@ -1986,7 +1986,7 @@ static const struct frame_unwind m32c_unwind = {
|
|||
static int
|
||||
m32c_reg_arg_type (struct type *type)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
|
||||
return (code == TYPE_CODE_INT
|
||||
|| code == TYPE_CODE_ENUM
|
||||
|
@ -2021,11 +2021,11 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *func_type = value_type (function);
|
||||
|
||||
/* Dereference function pointer types. */
|
||||
if (TYPE_CODE (func_type) == TYPE_CODE_PTR)
|
||||
if (func_type->code () == TYPE_CODE_PTR)
|
||||
func_type = TYPE_TARGET_TYPE (func_type);
|
||||
|
||||
gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC ||
|
||||
TYPE_CODE (func_type) == TYPE_CODE_METHOD);
|
||||
gdb_assert (func_type->code () == TYPE_CODE_FUNC ||
|
||||
func_type->code () == TYPE_CODE_METHOD);
|
||||
|
||||
#if 0
|
||||
/* The ABI description in gcc/config/m32c/m32c.abi says that
|
||||
|
@ -2153,7 +2153,7 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
static int
|
||||
m32c_return_by_passed_buf (struct type *type)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
|
||||
return (code == TYPE_CODE_STRUCT
|
||||
|| code == TYPE_CODE_UNION);
|
||||
|
@ -2399,9 +2399,9 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
|
|||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
enum type_code target_code;
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type));
|
||||
gdb_assert (type->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type));
|
||||
|
||||
target_code = TYPE_CODE (TYPE_TARGET_TYPE (type));
|
||||
target_code = TYPE_TARGET_TYPE (type)->code ();
|
||||
|
||||
if (target_code == TYPE_CODE_FUNC || target_code == TYPE_CODE_METHOD)
|
||||
{
|
||||
|
@ -2478,11 +2478,11 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
|
|||
CORE_ADDR ptr;
|
||||
enum type_code target_code;
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type));
|
||||
gdb_assert (type->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type));
|
||||
|
||||
ptr = extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
|
||||
|
||||
target_code = TYPE_CODE (TYPE_TARGET_TYPE (type));
|
||||
target_code = TYPE_TARGET_TYPE (type)->code ();
|
||||
|
||||
if (target_code == TYPE_CODE_FUNC || target_code == TYPE_CODE_METHOD)
|
||||
{
|
||||
|
|
|
@ -690,7 +690,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
|
||||
{
|
||||
type = value_type (args[argnum]);
|
||||
typecode = TYPE_CODE (type);
|
||||
typecode = type->code ();
|
||||
len = TYPE_LENGTH (type);
|
||||
|
||||
memset (valbuf, 0, sizeof (valbuf));
|
||||
|
|
|
@ -1290,9 +1290,9 @@ m68hc11_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *valtype, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY
|
||||
if (valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION
|
||||
|| valtype->code () == TYPE_CODE_ARRAY
|
||||
|| TYPE_LENGTH (valtype) > 4)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
else
|
||||
|
|
|
@ -191,7 +191,7 @@ m68k_convert_register_p (struct gdbarch *gdbarch,
|
|||
return 0;
|
||||
return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7
|
||||
/* We only support floating-point values. */
|
||||
&& TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
&& type->code () == TYPE_CODE_FLT
|
||||
&& type != register_type (gdbarch, M68K_FP0_REGNUM));
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ m68k_register_to_value (struct frame_info *frame, int regnum,
|
|||
gdb_byte from[M68K_MAX_REGISTER_SIZE];
|
||||
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
|
||||
|
||||
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
|
||||
gdb_assert (type->code () == TYPE_CODE_FLT);
|
||||
|
||||
/* Convert to TYPE. */
|
||||
if (!get_frame_register_bytes (frame, regnum, 0,
|
||||
|
@ -232,7 +232,7 @@ m68k_value_to_register (struct frame_info *frame, int regnum,
|
|||
M68K_FP0_REGNUM);
|
||||
|
||||
/* We only support floating-point values. */
|
||||
if (TYPE_CODE (type) != TYPE_CODE_FLT)
|
||||
if (type->code () != TYPE_CODE_FLT)
|
||||
{
|
||||
warning (_("Cannot convert non-floating-point type "
|
||||
"to floating-point register value."));
|
||||
|
@ -308,13 +308,13 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache,
|
|||
struct gdbarch *gdbarch = regcache->arch ();
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (tdep->float_return && type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
|
||||
regcache->raw_read (M68K_FP0_REGNUM, buf);
|
||||
target_float_convert (buf, fpreg_type, valbuf, type);
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
|
||||
else if (type->code () == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
|
||||
regcache->raw_read (M68K_A0_REGNUM, valbuf);
|
||||
else
|
||||
m68k_extract_return_value (type, regcache, valbuf);
|
||||
|
@ -347,14 +347,14 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
|
|||
struct gdbarch *gdbarch = regcache->arch ();
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (tdep->float_return && type->code () == TYPE_CODE_FLT)
|
||||
{
|
||||
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
|
||||
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
|
||||
target_float_convert (valbuf, type, buf, fpreg_type);
|
||||
regcache->raw_write (M68K_FP0_REGNUM, buf);
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
|
||||
else if (type->code () == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
|
||||
{
|
||||
regcache->raw_write (M68K_A0_REGNUM, valbuf);
|
||||
regcache->raw_write (M68K_D0_REGNUM, valbuf);
|
||||
|
@ -371,7 +371,7 @@ static int
|
|||
m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
||||
gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
|
||||
|
@ -394,7 +394,7 @@ m68k_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *type, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
|
||||
/* GCC returns a `long double' in memory too. */
|
||||
if (((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
|
||||
|
@ -430,7 +430,7 @@ m68k_svr4_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *type, struct regcache *regcache,
|
||||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
enum type_code code = TYPE_CODE (type);
|
||||
enum type_code code = type->code ();
|
||||
|
||||
if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
|
||||
|| code == TYPE_CODE_COMPLEX)
|
||||
|
@ -511,9 +511,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
|
||||
/* Non-scalars bigger than 4 bytes are left aligned, others are
|
||||
right aligned. */
|
||||
if ((TYPE_CODE (value_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (value_type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (value_type) == TYPE_CODE_ARRAY)
|
||||
if ((value_type->code () == TYPE_CODE_STRUCT
|
||||
|| value_type->code () == TYPE_CODE_UNION
|
||||
|| value_type->code () == TYPE_CODE_ARRAY)
|
||||
&& len > 4)
|
||||
offset = 0;
|
||||
else
|
||||
|
|
|
@ -747,7 +747,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
|||
{
|
||||
t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
|
||||
if (strcmp (name, "malloc") == 0
|
||||
&& TYPE_CODE (t) == TYPE_CODE_VOID)
|
||||
&& t->code () == TYPE_CODE_VOID)
|
||||
{
|
||||
/* I don't know why, but, at least under Alpha GNU/Linux,
|
||||
when linking against a malloc without debugging
|
||||
|
@ -1298,11 +1298,11 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
|||
/* Incomplete definitions of structs should not get a name. */
|
||||
if (TYPE_NAME (SYMBOL_TYPE (s)) == NULL
|
||||
&& (TYPE_NFIELDS (SYMBOL_TYPE (s)) != 0
|
||||
|| (TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_UNION)))
|
||||
|| (SYMBOL_TYPE (s)->code () != TYPE_CODE_STRUCT
|
||||
&& SYMBOL_TYPE (s)->code () != TYPE_CODE_UNION)))
|
||||
{
|
||||
if (TYPE_CODE (SYMBOL_TYPE (s)) == TYPE_CODE_PTR
|
||||
|| TYPE_CODE (SYMBOL_TYPE (s)) == TYPE_CODE_FUNC)
|
||||
if (SYMBOL_TYPE (s)->code () == TYPE_CODE_PTR
|
||||
|| SYMBOL_TYPE (s)->code () == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* If we are giving a name to a type such as "pointer to
|
||||
foo" or "function returning foo", we better not set
|
||||
|
@ -1639,16 +1639,16 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
|||
|
||||
/* DEC c89 produces cross references to qualified aggregate types,
|
||||
dereference them. */
|
||||
while (TYPE_CODE (tp) == TYPE_CODE_PTR
|
||||
|| TYPE_CODE (tp) == TYPE_CODE_ARRAY)
|
||||
while (tp->code () == TYPE_CODE_PTR
|
||||
|| tp->code () == TYPE_CODE_ARRAY)
|
||||
tp = TYPE_TARGET_TYPE (tp);
|
||||
|
||||
/* Make sure that TYPE_CODE(tp) has an expected type code.
|
||||
Any type may be returned from cross_ref if file indirect entries
|
||||
are corrupted. */
|
||||
if (TYPE_CODE (tp) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (tp) != TYPE_CODE_UNION
|
||||
&& TYPE_CODE (tp) != TYPE_CODE_ENUM)
|
||||
if (tp->code () != TYPE_CODE_STRUCT
|
||||
&& tp->code () != TYPE_CODE_UNION
|
||||
&& tp->code () != TYPE_CODE_ENUM)
|
||||
{
|
||||
unexpected_type_code_complaint (sym_name);
|
||||
}
|
||||
|
@ -1658,15 +1658,15 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
|||
exception is if we guessed wrong re struct/union/enum.
|
||||
But for struct vs. union a wrong guess is harmless, so
|
||||
don't complain(). */
|
||||
if ((TYPE_CODE (tp) == TYPE_CODE_ENUM
|
||||
if ((tp->code () == TYPE_CODE_ENUM
|
||||
&& type_code != TYPE_CODE_ENUM)
|
||||
|| (TYPE_CODE (tp) != TYPE_CODE_ENUM
|
||||
|| (tp->code () != TYPE_CODE_ENUM
|
||||
&& type_code == TYPE_CODE_ENUM))
|
||||
{
|
||||
bad_tag_guess_complaint (sym_name);
|
||||
}
|
||||
|
||||
if (TYPE_CODE (tp) != type_code)
|
||||
if (tp->code () != type_code)
|
||||
{
|
||||
tp->set_code (type_code);
|
||||
}
|
||||
|
@ -1698,7 +1698,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
|||
/* Make sure that TYPE_CODE(tp) has an expected type code.
|
||||
Any type may be returned from cross_ref if file indirect entries
|
||||
are corrupted. */
|
||||
if (TYPE_CODE (tp) != TYPE_CODE_RANGE)
|
||||
if (tp->code () != TYPE_CODE_RANGE)
|
||||
{
|
||||
unexpected_type_code_complaint (sym_name);
|
||||
}
|
||||
|
@ -1706,7 +1706,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
|||
{
|
||||
/* Usually, TYPE_CODE(tp) is already type_code. The main
|
||||
exception is if we guessed wrong re struct/union/enum. */
|
||||
if (TYPE_CODE (tp) != type_code)
|
||||
if (tp->code () != type_code)
|
||||
{
|
||||
bad_tag_guess_complaint (sym_name);
|
||||
tp->set_code (type_code);
|
||||
|
@ -1831,7 +1831,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
|
|||
|
||||
/* The bounds type should be an integer type, but might be anything
|
||||
else due to corrupt aux entries. */
|
||||
if (TYPE_CODE (indx) != TYPE_CODE_INT)
|
||||
if (indx->code () != TYPE_CODE_INT)
|
||||
{
|
||||
complaint (_("illegal array index type for %s, assuming int"),
|
||||
sym_name);
|
||||
|
@ -2038,7 +2038,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
|
|||
|
||||
if (processing_gcc_compilation == 0
|
||||
&& found_ecoff_debugging_info == 0
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (s))) == TYPE_CODE_VOID)
|
||||
&& TYPE_TARGET_TYPE (SYMBOL_TYPE (s))->code () == TYPE_CODE_VOID)
|
||||
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->nodebug_text_symbol;
|
||||
}
|
||||
|
||||
|
|
|
@ -650,9 +650,9 @@ list_args_or_locals (const frame_print_options &fp_opts,
|
|||
{
|
||||
case PRINT_SIMPLE_VALUES:
|
||||
type = check_typedef (sym2->type);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_ARRAY
|
||||
&& type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
{
|
||||
case PRINT_ALL_VALUES:
|
||||
if (SYMBOL_IS_ARGUMENT (sym))
|
||||
|
|
|
@ -340,9 +340,9 @@ mi_print_value_p (struct varobj *var, enum print_values print_values)
|
|||
|
||||
/* For PRINT_SIMPLE_VALUES, only print the value if it has a type
|
||||
and that type is not a compound type. */
|
||||
return (TYPE_CODE (type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION);
|
||||
return (type->code () != TYPE_CODE_ARRAY
|
||||
&& type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2458,9 +2458,9 @@ print_variable_or_computed (const char *expression, enum print_values values)
|
|||
type = check_typedef (value_type (val));
|
||||
type_print (value_type (val), "", &stb, -1);
|
||||
uiout->field_stream ("type", stb);
|
||||
if (TYPE_CODE (type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_ARRAY
|
||||
&& type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
{
|
||||
struct value_print_options opts;
|
||||
|
||||
|
|
|
@ -687,7 +687,7 @@ mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|
|||
if (reggroup == all_reggroup)
|
||||
return pseudo;
|
||||
vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
|
||||
float_p = TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT;
|
||||
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. */
|
||||
raw_p = rawnum < gdbarch_num_regs (gdbarch);
|
||||
|
@ -889,7 +889,7 @@ mips_convert_register_float_case_p (struct gdbarch *gdbarch, int regnum,
|
|||
return (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
|
||||
&& register_size (gdbarch, regnum) == 4
|
||||
&& mips_float_register_p (gdbarch, regnum)
|
||||
&& TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8);
|
||||
&& type->code () == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8);
|
||||
}
|
||||
|
||||
/* This predicate tests for the case of a value of less than 8
|
||||
|
@ -4408,7 +4408,7 @@ fp_register_arg_p (struct gdbarch *gdbarch, enum type_code typecode,
|
|||
&& (typecode == TYPE_CODE_STRUCT
|
||||
|| typecode == TYPE_CODE_UNION)
|
||||
&& TYPE_NFIELDS (arg_type) == 1
|
||||
&& TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (arg_type, 0)))
|
||||
&& check_typedef (TYPE_FIELD_TYPE (arg_type, 0))->code ()
|
||||
== TYPE_CODE_FLT))
|
||||
&& MIPS_FPU_TYPE(gdbarch) != MIPS_FPU_NONE);
|
||||
}
|
||||
|
@ -4419,7 +4419,7 @@ fp_register_arg_p (struct gdbarch *gdbarch, enum type_code typecode,
|
|||
static int
|
||||
mips_type_needs_double_align (struct type *type)
|
||||
{
|
||||
enum type_code typecode = TYPE_CODE (type);
|
||||
enum type_code typecode = type->code ();
|
||||
|
||||
if (typecode == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8)
|
||||
return 1;
|
||||
|
@ -4562,7 +4562,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
|
@ -4782,17 +4782,17 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
/* Floating point type? */
|
||||
if (tdep->mips_fpu_type != MIPS_FPU_NONE)
|
||||
{
|
||||
if (TYPE_CODE (type) == TYPE_CODE_FLT)
|
||||
if (type->code () == TYPE_CODE_FLT)
|
||||
fp_return_type = 1;
|
||||
/* Structs with a single field of float type
|
||||
are returned in a floating point register. */
|
||||
if ((TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
if ((type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
&& TYPE_NFIELDS (type) == 1)
|
||||
{
|
||||
struct type *fieldtype = TYPE_FIELD_TYPE (type, 0);
|
||||
|
||||
if (TYPE_CODE (check_typedef (fieldtype)) == TYPE_CODE_FLT)
|
||||
if (check_typedef (fieldtype)->code () == TYPE_CODE_FLT)
|
||||
fp_return_type = 1;
|
||||
}
|
||||
}
|
||||
|
@ -4841,7 +4841,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
|
|||
{
|
||||
int i;
|
||||
|
||||
if (TYPE_CODE (arg_type) != TYPE_CODE_STRUCT)
|
||||
if (arg_type->code () != TYPE_CODE_STRUCT)
|
||||
return 0;
|
||||
|
||||
if (MIPS_FPU_TYPE (gdbarch) != MIPS_FPU_DOUBLE)
|
||||
|
@ -4873,7 +4873,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
|
|||
continue;
|
||||
|
||||
/* If this is our special aligned double, we can stop. */
|
||||
if (TYPE_CODE (field_type) == TYPE_CODE_FLT
|
||||
if (field_type->code () == TYPE_CODE_FLT
|
||||
&& TYPE_LENGTH (field_type) == MIPS64_REGSIZE)
|
||||
return 1;
|
||||
|
||||
|
@ -4952,7 +4952,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
|
@ -5189,7 +5189,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
|
||||
if (TYPE_LENGTH (type) > 2 * MIPS64_REGSIZE)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
else if (type->code () == TYPE_CODE_FLT
|
||||
&& TYPE_LENGTH (type) == 16
|
||||
&& tdep->mips_fpu_type != MIPS_FPU_NONE)
|
||||
{
|
||||
|
@ -5211,7 +5211,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
writebuf ? writebuf + 8 : writebuf, 0);
|
||||
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
else if (type->code () == TYPE_CODE_FLT
|
||||
&& tdep->mips_fpu_type != MIPS_FPU_NONE)
|
||||
{
|
||||
/* A single or double floating-point value that fits in FP0. */
|
||||
|
@ -5225,16 +5225,16 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
readbuf, writebuf, 0);
|
||||
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
else if (type->code () == TYPE_CODE_STRUCT
|
||||
&& TYPE_NFIELDS (type) <= 2
|
||||
&& TYPE_NFIELDS (type) >= 1
|
||||
&& ((TYPE_NFIELDS (type) == 1
|
||||
&& (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0)))
|
||||
&& (check_typedef (TYPE_FIELD_TYPE (type, 0))->code ()
|
||||
== TYPE_CODE_FLT))
|
||||
|| (TYPE_NFIELDS (type) == 2
|
||||
&& (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0)))
|
||||
&& (check_typedef (TYPE_FIELD_TYPE (type, 0))->code ()
|
||||
== TYPE_CODE_FLT)
|
||||
&& (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 1)))
|
||||
&& (check_typedef (TYPE_FIELD_TYPE (type, 1))->code ()
|
||||
== TYPE_CODE_FLT))))
|
||||
{
|
||||
/* A struct that contains one or two floats. Each value is part
|
||||
|
@ -5276,9 +5276,9 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
}
|
||||
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
else if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
/* A composite type. Extract the left justified value,
|
||||
regardless of the byte order. I.e. DO NOT USE
|
||||
|
@ -5419,7 +5419,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
|
@ -5663,11 +5663,11 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
enum mips_fval_reg fval_reg;
|
||||
|
||||
fval_reg = readbuf ? mips16 ? mips_fval_gpr : mips_fval_fpr : mips_fval_both;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_ARRAY)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
else if (type->code () == TYPE_CODE_FLT
|
||||
&& TYPE_LENGTH (type) == 4 && tdep->mips_fpu_type != MIPS_FPU_NONE)
|
||||
{
|
||||
/* A single-precision floating-point value. If reading in or copying,
|
||||
|
@ -5704,7 +5704,7 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
readbuf, writebuf, 0);
|
||||
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_FLT
|
||||
else if (type->code () == TYPE_CODE_FLT
|
||||
&& TYPE_LENGTH (type) == 8 && tdep->mips_fpu_type != MIPS_FPU_NONE)
|
||||
{
|
||||
/* A double-precision floating-point value. If reading in or copying,
|
||||
|
@ -5778,7 +5778,7 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
}
|
||||
#if 0
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
else if (type->code () == TYPE_CODE_STRUCT
|
||||
&& TYPE_NFIELDS (type) <= 2
|
||||
&& TYPE_NFIELDS (type) >= 1
|
||||
&& ((TYPE_NFIELDS (type) == 1
|
||||
|
@ -5814,8 +5814,8 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
}
|
||||
#endif
|
||||
#if 0
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
else if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
/* A structure or union. Extract the left justified value,
|
||||
regardless of the byte order. I.e. DO NOT USE
|
||||
|
@ -5941,7 +5941,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
|
@ -6109,11 +6109,11 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct value *function,
|
|||
enum mips_fval_reg fval_reg;
|
||||
|
||||
fval_reg = readbuf ? mips16 ? mips_fval_gpr : mips_fval_fpr : mips_fval_both;
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (type) == TYPE_CODE_UNION
|
||||
|| TYPE_CODE (type) == TYPE_CODE_ARRAY)
|
||||
if (type->code () == TYPE_CODE_STRUCT
|
||||
|| type->code () == TYPE_CODE_UNION
|
||||
|| type->code () == TYPE_CODE_ARRAY)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
else if (fp_register_arg_p (gdbarch, TYPE_CODE (type), type))
|
||||
else if (fp_register_arg_p (gdbarch, type->code (), type))
|
||||
{
|
||||
/* A floating-point value. If reading in or copying, then we get it
|
||||
from/put it to FP0 for standard MIPS code or GPR2 for MIPS16 code.
|
||||
|
|
|
@ -88,7 +88,7 @@ mn10300_type_align (struct type *type)
|
|||
{
|
||||
int i, align = 1;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
case TYPE_CODE_ENUM:
|
||||
|
@ -137,7 +137,7 @@ mn10300_use_struct_convention (struct type *type)
|
|||
if (TYPE_LENGTH (type) > 8)
|
||||
return 1;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
|
@ -174,7 +174,7 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
|
|||
int len = TYPE_LENGTH (type);
|
||||
int reg, regsz;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
reg = 4;
|
||||
else
|
||||
reg = 0;
|
||||
|
@ -202,7 +202,7 @@ mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
|
|||
int len = TYPE_LENGTH (type);
|
||||
int reg, regsz;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
reg = 4;
|
||||
else
|
||||
reg = 0;
|
||||
|
@ -1208,7 +1208,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
|
|||
for (argnum = 0; argnum < nargs; argnum++)
|
||||
{
|
||||
/* FIXME what about structs? Unions? */
|
||||
if (TYPE_CODE (value_type (*args)) == TYPE_CODE_STRUCT
|
||||
if (value_type (*args)->code () == TYPE_CODE_STRUCT
|
||||
&& TYPE_LENGTH (value_type (*args)) > 8)
|
||||
{
|
||||
/* Change to pointer-to-type. */
|
||||
|
|
|
@ -570,8 +570,8 @@ msp430_return_value (struct gdbarch *gdbarch,
|
|||
int code_model = gdbarch_tdep (gdbarch)->code_model;
|
||||
|
||||
if (TYPE_LENGTH (valtype) > 8
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (valtype) == TYPE_CODE_UNION)
|
||||
|| valtype->code () == TYPE_CODE_STRUCT
|
||||
|| valtype->code () == TYPE_CODE_UNION)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
|
||||
if (readbuf)
|
||||
|
@ -585,7 +585,7 @@ msp430_return_value (struct gdbarch *gdbarch,
|
|||
int size = 2;
|
||||
|
||||
if (code_model == MSP_LARGE_CODE_MODEL
|
||||
&& TYPE_CODE (valtype) == TYPE_CODE_PTR)
|
||||
&& valtype->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
size = 4;
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ msp430_return_value (struct gdbarch *gdbarch,
|
|||
int size = 2;
|
||||
|
||||
if (code_model == MSP_LARGE_CODE_MODEL
|
||||
&& TYPE_CODE (valtype) == TYPE_CODE_PTR)
|
||||
&& valtype->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
size = 4;
|
||||
}
|
||||
|
@ -652,12 +652,12 @@ msp430_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct type *func_type = value_type (function);
|
||||
|
||||
/* Dereference function pointer types. */
|
||||
while (TYPE_CODE (func_type) == TYPE_CODE_PTR)
|
||||
while (func_type->code () == TYPE_CODE_PTR)
|
||||
func_type = TYPE_TARGET_TYPE (func_type);
|
||||
|
||||
/* The end result had better be a function or a method. */
|
||||
gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC
|
||||
|| TYPE_CODE (func_type) == TYPE_CODE_METHOD);
|
||||
gdb_assert (func_type->code () == TYPE_CODE_FUNC
|
||||
|| func_type->code () == TYPE_CODE_METHOD);
|
||||
|
||||
/* We make two passes; the first does the stack allocation,
|
||||
the second actually stores the arguments. */
|
||||
|
@ -691,8 +691,8 @@ msp430_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
|
||||
current_arg_on_stack = 0;
|
||||
|
||||
if (TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (arg_type) == TYPE_CODE_UNION)
|
||||
if (arg_type->code () == TYPE_CODE_STRUCT
|
||||
|| arg_type->code () == TYPE_CODE_UNION)
|
||||
{
|
||||
/* Aggregates of any size are passed by reference. */
|
||||
store_unsigned_integer (struct_addr_buf, 4, byte_order,
|
||||
|
@ -723,10 +723,10 @@ msp430_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
int size = 2;
|
||||
|
||||
if (code_model == MSP_LARGE_CODE_MODEL
|
||||
&& (TYPE_CODE (arg_type) == TYPE_CODE_PTR
|
||||
&& (arg_type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (arg_type)
|
||||
|| TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (arg_type) == TYPE_CODE_UNION))
|
||||
|| arg_type->code () == TYPE_CODE_STRUCT
|
||||
|| arg_type->code () == TYPE_CODE_UNION))
|
||||
{
|
||||
/* When using the large memory model, pointer,
|
||||
reference, struct, and union arguments are
|
||||
|
|
|
@ -1402,7 +1402,7 @@ nds32_check_calling_use_fpr (struct type *type)
|
|||
while (1)
|
||||
{
|
||||
t = check_typedef (t);
|
||||
typecode = TYPE_CODE (t);
|
||||
typecode = t->code ();
|
||||
if (typecode != TYPE_CODE_STRUCT)
|
||||
break;
|
||||
else if (TYPE_NFIELDS (t) != 1)
|
||||
|
|
|
@ -2236,7 +2236,7 @@ nios2_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
|
|||
static ULONGEST
|
||||
nios2_type_align (struct gdbarch *gdbarch, struct type *type)
|
||||
{
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_FUNC:
|
||||
|
|
|
@ -95,7 +95,7 @@ lookup_struct_typedef (const char *name, const struct block *block, int noerr)
|
|||
else
|
||||
error (_("No struct type named %s."), name);
|
||||
}
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
|
||||
if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_STRUCT)
|
||||
{
|
||||
if (noerr)
|
||||
return 0;
|
||||
|
|
|
@ -96,9 +96,9 @@ lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
|
|||
{
|
||||
LONGEST lowb, highb;
|
||||
|
||||
if (TYPE_CODE (types[i]) == TYPE_CODE_ARRAY && TYPE_VECTOR (types[i])
|
||||
if (types[i]->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (types[i])
|
||||
&& get_array_bounds (types[i], &lowb, &highb)
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (types[i])) == code
|
||||
&& TYPE_TARGET_TYPE (types[i])->code () == code
|
||||
&& TYPE_UNSIGNED (TYPE_TARGET_TYPE (types[i])) == flag_unsigned
|
||||
&& TYPE_LENGTH (TYPE_TARGET_TYPE (types[i])) == el_length
|
||||
&& TYPE_LENGTH (types[i]) == length
|
||||
|
@ -177,7 +177,7 @@ lval_func_read (struct value *v)
|
|||
LONGEST lowb = 0;
|
||||
LONGEST highb = 0;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
if (type->code () == TYPE_CODE_ARRAY
|
||||
&& !get_array_bounds (type, &lowb, &highb))
|
||||
error (_("Could not determine the vector bounds"));
|
||||
|
||||
|
@ -206,7 +206,7 @@ lval_func_write (struct value *v, struct value *fromval)
|
|||
LONGEST lowb = 0;
|
||||
LONGEST highb = 0;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||
if (type->code () == TYPE_CODE_ARRAY
|
||||
&& !get_array_bounds (type, &lowb, &highb))
|
||||
error (_("Could not determine the vector bounds"));
|
||||
|
||||
|
@ -336,7 +336,7 @@ create_value (struct gdbarch *gdbarch, struct value *val, enum noside noside,
|
|||
/* Multiple components of the vector are requested which means the
|
||||
resulting type is a vector as well. */
|
||||
struct type *dst_type =
|
||||
lookup_opencl_vector_type (gdbarch, TYPE_CODE (elm_type),
|
||||
lookup_opencl_vector_type (gdbarch, elm_type->code (),
|
||||
TYPE_LENGTH (elm_type),
|
||||
TYPE_UNSIGNED (elm_type), n);
|
||||
|
||||
|
@ -497,7 +497,7 @@ opencl_logical_not (struct expression *exp, struct value *arg)
|
|||
struct type *rettype;
|
||||
struct value *ret;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
|
||||
if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))
|
||||
{
|
||||
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 = (TYPE_CODE (type1) == TYPE_CODE_ARRAY && TYPE_VECTOR (type1));
|
||||
t2_is_vec = (TYPE_CODE (type2) == TYPE_CODE_ARRAY && TYPE_VECTOR (type2));
|
||||
t1_is_vec = (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1));
|
||||
t2_is_vec = (type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2));
|
||||
|
||||
if (!t1_is_vec || !t2_is_vec)
|
||||
error (_("Vector operations are not supported on scalar types"));
|
||||
|
@ -600,7 +600,7 @@ vector_relop (struct expression *exp, struct value *val1, struct value *val2,
|
|||
error (_("Could not determine the vector bounds"));
|
||||
|
||||
/* Check whether the vector types are compatible. */
|
||||
if (TYPE_CODE (eltype1) != TYPE_CODE (eltype2)
|
||||
if (eltype1->code () != eltype2->code ()
|
||||
|| TYPE_LENGTH (eltype1) != TYPE_LENGTH (eltype2)
|
||||
|| TYPE_UNSIGNED (eltype1) != TYPE_UNSIGNED (eltype2)
|
||||
|| lowb1 != lowb2 || highb1 != highb2)
|
||||
|
@ -647,11 +647,11 @@ opencl_value_cast (struct type *type, struct value *arg)
|
|||
|
||||
to_type = check_typedef (type);
|
||||
|
||||
code1 = TYPE_CODE (to_type);
|
||||
code2 = TYPE_CODE (check_typedef (value_type (arg)));
|
||||
code1 = to_type->code ();
|
||||
code2 = check_typedef (value_type (arg))->code ();
|
||||
|
||||
if (code2 == TYPE_CODE_REF)
|
||||
code2 = TYPE_CODE (check_typedef (value_type (coerce_ref (arg))));
|
||||
code2 = check_typedef (value_type (coerce_ref(arg)))->code ();
|
||||
|
||||
scalar = (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL
|
||||
|| code2 == TYPE_CODE_CHAR || code2 == TYPE_CODE_FLT
|
||||
|
@ -687,9 +687,9 @@ opencl_relop (struct expression *exp, struct value *arg1, struct value *arg2,
|
|||
struct value *val;
|
||||
struct type *type1 = check_typedef (value_type (arg1));
|
||||
struct type *type2 = check_typedef (value_type (arg2));
|
||||
int t1_is_vec = (TYPE_CODE (type1) == TYPE_CODE_ARRAY
|
||||
int t1_is_vec = (type1->code () == TYPE_CODE_ARRAY
|
||||
&& TYPE_VECTOR (type1));
|
||||
int t2_is_vec = (TYPE_CODE (type2) == TYPE_CODE_ARRAY
|
||||
int t2_is_vec = (type2->code () == TYPE_CODE_ARRAY
|
||||
&& TYPE_VECTOR (type2));
|
||||
|
||||
if (!t1_is_vec && !t2_is_vec)
|
||||
|
@ -710,7 +710,7 @@ opencl_relop (struct expression *exp, struct value *arg1, struct value *arg2,
|
|||
struct value **v = t1_is_vec ? &arg2 : &arg1;
|
||||
struct type *t = t1_is_vec ? type2 : type1;
|
||||
|
||||
if (TYPE_CODE (t) != TYPE_CODE_FLT && !is_integral_type (t))
|
||||
if (t->code () != TYPE_CODE_FLT && !is_integral_type (t))
|
||||
error (_("Argument to operation not a number or boolean."));
|
||||
|
||||
*v = opencl_value_cast (t1_is_vec ? type1 : type2, *v);
|
||||
|
@ -832,8 +832,8 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp,
|
|||
type1 = check_typedef (value_type (arg1));
|
||||
type2 = check_typedef (value_type (arg2));
|
||||
|
||||
if ((TYPE_CODE (type1) == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
|
||||
|| (TYPE_CODE (type2) == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)))
|
||||
if ((type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
|
||||
|| (type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)))
|
||||
{
|
||||
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
|
||||
|
@ -868,7 +868,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp,
|
|||
(*pos)++;
|
||||
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
type1 = check_typedef (value_type (arg1));
|
||||
if (TYPE_CODE (type1) == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
|
||||
if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
|
||||
{
|
||||
struct value *arg3, *tmp, *ret;
|
||||
struct type *eltype2, *type3, *eltype3;
|
||||
|
@ -880,9 +880,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
|
||||
= TYPE_CODE (type2) == TYPE_CODE_ARRAY && TYPE_VECTOR (type2);
|
||||
= type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2);
|
||||
t3_is_vec
|
||||
= TYPE_CODE (type3) == TYPE_CODE_ARRAY && TYPE_VECTOR (type3);
|
||||
= type3->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type3);
|
||||
|
||||
/* Widen the scalar operand to a vector if necessary. */
|
||||
if (t2_is_vec || !t3_is_vec)
|
||||
|
@ -911,7 +911,7 @@ Cannot perform conditional operation on incompatible types"));
|
|||
error (_("Could not determine the vector bounds"));
|
||||
|
||||
/* Throw an error if the types of arg2 or arg3 are incompatible. */
|
||||
if (TYPE_CODE (eltype2) != TYPE_CODE (eltype3)
|
||||
if (eltype2->code () != eltype3->code ()
|
||||
|| TYPE_LENGTH (eltype2) != TYPE_LENGTH (eltype3)
|
||||
|| TYPE_UNSIGNED (eltype2) != TYPE_UNSIGNED (eltype3)
|
||||
|| lowb2 != lowb3 || highb2 != highb3)
|
||||
|
@ -971,7 +971,7 @@ Cannot perform conditional operation on vectors with different sizes"));
|
|||
return value_from_longest (builtin_type (exp->gdbarch)->
|
||||
builtin_int, 1);
|
||||
}
|
||||
else if (TYPE_CODE (type1) == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
|
||||
else if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
|
||||
{
|
||||
return opencl_component_ref (exp, arg1, &exp->elts[pc + 2].string,
|
||||
noside);
|
||||
|
@ -1007,7 +1007,7 @@ opencl_print_type (struct type *type, const char *varstring,
|
|||
if (show > 0)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
||||
if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
|
||||
&& TYPE_NAME (type) != NULL)
|
||||
show = 0;
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ or1k_return_value (struct gdbarch *gdbarch, struct value *functype,
|
|||
gdb_byte *readbuf, const gdb_byte *writebuf)
|
||||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
enum type_code rv_type = TYPE_CODE (valtype);
|
||||
enum type_code rv_type = valtype->code ();
|
||||
unsigned int rv_size = TYPE_LENGTH (valtype);
|
||||
int bpw = (gdbarch_tdep (gdbarch))->bytes_per_word;
|
||||
|
||||
|
@ -633,7 +633,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
|
||||
if (TYPE_VARARGS (func_type) && argnum >= TYPE_NFIELDS (func_type))
|
||||
break; /* end or regular args, varargs go to stack. */
|
||||
|
@ -723,7 +723,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
|
||||
if ((TYPE_CODE_STRUCT == typecode) || (TYPE_CODE_UNION == typecode)
|
||||
|| (len > bpw * 2))
|
||||
|
@ -755,7 +755,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
struct value *arg = args[argnum];
|
||||
struct type *arg_type = check_typedef (value_type (arg));
|
||||
int len = TYPE_LENGTH (arg_type);
|
||||
enum type_code typecode = TYPE_CODE (arg_type);
|
||||
enum type_code typecode = arg_type->code ();
|
||||
/* The EABI passes structures that do not fit in a register by
|
||||
reference. In all other cases, pass the structure by value. */
|
||||
if ((TYPE_CODE_STRUCT == typecode) || (TYPE_CODE_UNION == typecode)
|
||||
|
|
16
gdb/p-exp.y
16
gdb/p-exp.y
|
@ -257,7 +257,7 @@ exp : field_exp FIELDNAME
|
|||
search_field = 0;
|
||||
if (current_type)
|
||||
{
|
||||
while (TYPE_CODE (current_type)
|
||||
while (current_type->code ()
|
||||
== TYPE_CODE_PTR)
|
||||
current_type =
|
||||
TYPE_TARGET_TYPE (current_type);
|
||||
|
@ -275,7 +275,7 @@ exp : field_exp name
|
|||
search_field = 0;
|
||||
if (current_type)
|
||||
{
|
||||
while (TYPE_CODE (current_type)
|
||||
while (current_type->code ()
|
||||
== TYPE_CODE_PTR)
|
||||
current_type =
|
||||
TYPE_TARGET_TYPE (current_type);
|
||||
|
@ -357,9 +357,9 @@ exp : type '(' exp ')' %prec UNARY
|
|||
{ if (current_type)
|
||||
{
|
||||
/* Allow automatic dereference of classes. */
|
||||
if ((TYPE_CODE (current_type) == TYPE_CODE_PTR)
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (current_type)) == TYPE_CODE_STRUCT)
|
||||
&& (TYPE_CODE ($1) == TYPE_CODE_STRUCT))
|
||||
if ((current_type->code () == TYPE_CODE_PTR)
|
||||
&& (TYPE_TARGET_TYPE (current_type)->code () == TYPE_CODE_STRUCT)
|
||||
&& (($1)->code () == TYPE_CODE_STRUCT))
|
||||
write_exp_elt_opcode (pstate, UNOP_IND);
|
||||
}
|
||||
write_exp_elt_opcode (pstate, UNOP_CAST);
|
||||
|
@ -601,7 +601,7 @@ exp : THIS
|
|||
this_type = NULL;
|
||||
if (this_type)
|
||||
{
|
||||
if (TYPE_CODE (this_type) == TYPE_CODE_PTR)
|
||||
if (this_type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
this_type = TYPE_TARGET_TYPE (this_type);
|
||||
write_exp_elt_opcode (pstate, UNOP_IND);
|
||||
|
@ -666,8 +666,8 @@ qualified_name: typebase COLONCOLON name
|
|||
{
|
||||
struct type *type = $1;
|
||||
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|
||||
&& TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
if (type->code () != TYPE_CODE_STRUCT
|
||||
&& type->code () != TYPE_CODE_UNION)
|
||||
error (_("`%s' is not defined as an aggregate type."),
|
||||
TYPE_NAME (type));
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ is_pascal_string_type (struct type *type,int *length_pos,
|
|||
struct type **char_type,
|
||||
const char **arrayname)
|
||||
{
|
||||
if (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
if (type != NULL && type->code () == TYPE_CODE_STRUCT)
|
||||
{
|
||||
/* Old Borland type pascal strings from Free Pascal Compiler. */
|
||||
/* Two fields: length and st. */
|
||||
|
@ -141,7 +141,7 @@ is_pascal_string_type (struct type *type,int *length_pos,
|
|||
{
|
||||
*char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 2));
|
||||
|
||||
if (TYPE_CODE (*char_type) == TYPE_CODE_ARRAY)
|
||||
if ((*char_type)->code () == TYPE_CODE_ARRAY)
|
||||
*char_type = TYPE_TARGET_TYPE (*char_type);
|
||||
}
|
||||
if (arrayname)
|
||||
|
|
|
@ -53,7 +53,7 @@ pascal_print_type (struct type *type, const char *varstring,
|
|||
enum type_code code;
|
||||
int demangled_args;
|
||||
|
||||
code = TYPE_CODE (type);
|
||||
code = type->code ();
|
||||
|
||||
if (show > 0)
|
||||
type = check_typedef (type);
|
||||
|
@ -216,7 +216,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
|
|||
|
||||
QUIT;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_PTR:
|
||||
fprintf_filtered (stream, "^");
|
||||
|
@ -229,7 +229,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
|
|||
if (passed_a_ptr)
|
||||
fprintf_filtered (stream, "(");
|
||||
if (TYPE_TARGET_TYPE (type) != NULL
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
|
||||
&& TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
fprintf_filtered (stream, "function ");
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
|
|||
fprintf_filtered (stream, "(");
|
||||
|
||||
if (TYPE_TARGET_TYPE (type) != NULL
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
|
||||
&& TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
fprintf_filtered (stream, "function ");
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ pascal_type_print_func_varspec_suffix (struct type *type, struct ui_file *strea
|
|||
const struct type_print_options *flags)
|
||||
{
|
||||
if (TYPE_TARGET_TYPE (type) == NULL
|
||||
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
|
||||
|| TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
fprintf_filtered (stream, " : ");
|
||||
pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
|
||||
|
@ -382,7 +382,7 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
|||
|
||||
QUIT;
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
if (passed_a_ptr)
|
||||
|
@ -476,8 +476,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
}
|
||||
|
||||
/* void pointer */
|
||||
if ((TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID))
|
||||
if ((type->code () == TYPE_CODE_PTR)
|
||||
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID))
|
||||
{
|
||||
fputs_filtered (TYPE_NAME (type) ? TYPE_NAME (type) : "pointer",
|
||||
stream);
|
||||
|
@ -495,7 +495,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
|
||||
type = check_typedef (type);
|
||||
|
||||
switch (TYPE_CODE (type))
|
||||
switch (type->code ())
|
||||
{
|
||||
case TYPE_CODE_TYPEDEF:
|
||||
case TYPE_CODE_PTR:
|
||||
|
@ -707,8 +707,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
fprintf_filtered (stream, "destructor ");
|
||||
}
|
||||
else if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (
|
||||
TYPE_FN_FIELD_TYPE (f, j))) != TYPE_CODE_VOID)
|
||||
&& TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE(f, j))->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
fprintf_filtered (stream, "function ");
|
||||
}
|
||||
|
@ -723,8 +722,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
stream);
|
||||
|
||||
if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (
|
||||
TYPE_FN_FIELD_TYPE (f, j))) != TYPE_CODE_VOID)
|
||||
&& TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE(f, j))->code () != TYPE_CODE_VOID)
|
||||
{
|
||||
fputs_filtered (" : ", stream);
|
||||
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
|
||||
|
@ -830,7 +828,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||
an error (). */
|
||||
fprintf_styled (stream, metadata_style.style (),
|
||||
"<invalid unnamed pascal type code %d>",
|
||||
TYPE_CODE (type));
|
||||
type->code ());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue