int array_bitsize =
(hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
- TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
+ array_type->set_length ((array_bitsize + 7) / 8);
}
}
}
|| !get_discrete_bounds (index_type, &low_bound, &high_bound))
low_bound = high_bound = 0;
if (high_bound < low_bound)
- *elt_bits = TYPE_LENGTH (new_type) = 0;
+ {
+ *elt_bits = 0;
+ new_type->set_length (0);
+ }
else
{
*elt_bits *= (high_bound - low_bound + 1);
- TYPE_LENGTH (new_type) =
- (*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+ new_type->set_length ((*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT);
}
new_type->set_is_fixed_instance (true);
LONGEST elt_bitsize = elt_len * TYPE_FIELD_BITSIZE (elt_type, 0);
TYPE_FIELD_BITSIZE (type, 0) = elt_bitsize;
- TYPE_LENGTH (type) = ((our_len * elt_bitsize + HOST_CHAR_BIT - 1)
- / HOST_CHAR_BIT);
+ type->set_length (((our_len * elt_bitsize + HOST_CHAR_BIT - 1)
+ / HOST_CHAR_BIT));
}
return our_len;
type->set_code (TYPE_CODE_STRUCT);
INIT_NONE_SPECIFIC (type);
type->set_name ("<empty>");
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
return type;
}
if (off + fld_bit_len > bit_len)
bit_len = off + fld_bit_len;
off += fld_bit_len;
- TYPE_LENGTH (rtype) =
- align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT;
+ rtype->set_length (align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT);
}
/* We handle the variant part, if any, at the end because of certain
TARGET_CHAR_BIT;
if (off + fld_bit_len > bit_len)
bit_len = off + fld_bit_len;
- TYPE_LENGTH (rtype) =
- align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT;
+
+ rtype->set_length
+ (align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT);
}
}
pulongest (TYPE_LENGTH (type)));
}
else
- {
- TYPE_LENGTH (rtype) = align_up (TYPE_LENGTH (rtype),
- TYPE_LENGTH (type));
- }
+ rtype->set_length (align_up (TYPE_LENGTH (rtype), TYPE_LENGTH (type)));
value_free_to_mark (mark);
return rtype;
type->set_name (ada_type_name (type0));
type->set_is_fixed_instance (true);
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
}
type->field (f).set_type (new_type);
type->field (f).set_name (type0->field (f).name ());
rtype->set_name (ada_type_name (type));
rtype->set_is_fixed_instance (true);
- TYPE_LENGTH (rtype) = TYPE_LENGTH (type);
+ rtype->set_length (TYPE_LENGTH (type));
branch_type = to_fixed_variant_branch_type
(type->field (variant_field).type (),
rtype->field (variant_field).set_type (branch_type);
rtype->field (variant_field).set_name ("S");
TYPE_FIELD_BITSIZE (rtype, variant_field) = 0;
- TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type);
+ rtype->set_length (TYPE_LENGTH (rtype) + TYPE_LENGTH (branch_type));
}
- TYPE_LENGTH (rtype) -= TYPE_LENGTH (type->field (variant_field).type ());
+
+ rtype->set_length (TYPE_LENGTH (rtype)
+ - TYPE_LENGTH (type->field (variant_field).type ()));
value_free_to_mark (mark);
return rtype;
int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
- TYPE_LENGTH (result) = len * elt_bitsize / HOST_CHAR_BIT;
+ result->set_length (len * elt_bitsize / HOST_CHAR_BIT);
if (TYPE_LENGTH (result) * HOST_CHAR_BIT < len * elt_bitsize)
- TYPE_LENGTH (result)++;
+ result->set_length (TYPE_LENGTH (result) + 1);
}
result->set_is_fixed_instance (true);
if (xvz_found && TYPE_LENGTH (fixed_record_type) != size)
{
fixed_record_type = copy_type (fixed_record_type);
- TYPE_LENGTH (fixed_record_type) = size;
+ fixed_record_type->set_length (size);
/* The FIXED_RECORD_TYPE may have be a stub. We have
observed this when the debugging info is STABS, and
/* create_static_range_type alters the resulting type's length
to match the size of the base_type, which is not what we want.
Set it back to the original range type's length. */
- TYPE_LENGTH (type) = TYPE_LENGTH (raw_type);
+ type->set_length (TYPE_LENGTH (raw_type));
type->set_name (name);
return type;
}
struct type *real_target = real_type->target_type ();
int field_size = real_target->num_fields () * sizeof (struct field);
- TYPE_LENGTH (target) = TYPE_LENGTH (real_target);
+ target->set_length (real_target->length ());
target->set_num_fields (real_target->num_fields ());
field *fields = (struct field *) TYPE_ALLOC (target, field_size);
type->set_code (TYPE_CODE_STRUCT);
type->set_name (NULL);
INIT_CPLUS_SPECIFIC (type);
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
type->set_fields (nullptr);
type->set_num_fields (0);
}
type = coff_alloc_type (cs->c_symnum);
type->set_name (NULL);
INIT_CPLUS_SPECIFIC (type);
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
type->set_fields (nullptr);
type->set_num_fields (0);
}
type = coff_alloc_type (cs->c_symnum);
type->set_code (TYPE_CODE_ENUM);
type->set_name (NULL);
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
type->set_fields (nullptr);
type->set_num_fields (0);
}
type = coff_alloc_type (index);
type->set_code (TYPE_CODE_STRUCT);
INIT_CPLUS_SPECIFIC (type);
- TYPE_LENGTH (type) = length;
+ type->set_length (length);
while (!done && symnum < lastsym && symnum < nlist_nsyms_global)
{
/* Now fill in the fields of the type-structure. */
if (length > 0)
- TYPE_LENGTH (type) = length;
+ type->set_length (length);
else /* Assume ints. */
- TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
+ type->set_length (gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT);
type->set_code (TYPE_CODE_ENUM);
type->set_num_fields (nsyms);
type->set_fields
type *uint8_type = builtin_type (arch)->builtin_uint8;
type *bool_type = builtin_type (arch)->builtin_bool;
type *the_struct = arch_composite_type (arch, NULL, TYPE_CODE_STRUCT);
- TYPE_LENGTH (the_struct) = 4;
+ the_struct->set_length (4);
/* Value: 1110 1001
Fields: C-BB B-A- */
else
type->set_code (TYPE_CODE_STRUCT);
- TYPE_LENGTH (type) = ctf_type_size (fp, tid);
+ type->set_length (ctf_type_size (fp, tid));
set_type_align (type, ctf_type_align (fp, tid));
return set_tid_type (ccp->of, tid, type);
type->set_name (name);
type->set_code (TYPE_CODE_ENUM);
- TYPE_LENGTH (type) = ctf_type_size (fp, tid);
+ type->set_length (ctf_type_size (fp, tid));
/* Set the underlying type based on its ctf_type_size bits. */
type->set_target_type (objfile_int_type (of, TYPE_LENGTH (type), false));
set_type_align (type, ctf_type_align (fp, tid));
if (ar.ctr_nelems <= 1) /* Check if undefined upper bound. */
{
range_type->bounds ()->high.set_undefined ();
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
type->set_target_is_stub (true);
}
else
- TYPE_LENGTH (type) = ctf_type_size (fp, tid);
+ type->set_length (ctf_type_size (fp, tid));
set_type_align (type, ctf_type_align (fp, tid));
else
type->set_code (TYPE_CODE_STRUCT);
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
type->set_is_stub (true);
return set_tid_type (of, tid, type);
/* In Rust, each element should have the size of the
enclosing enum. */
- TYPE_LENGTH (type->field (i).type ()) = TYPE_LENGTH (type);
+ type->field (i).type ()->set_length (TYPE_LENGTH (type));
/* Remove the discriminant field, if it exists. */
struct type *sub_type = type->field (i).type ();
if (attr != nullptr)
{
if (attr->form_is_constant ())
- TYPE_LENGTH (type) = attr->constant_value (0);
+ type->set_length (attr->constant_value (0));
else
{
struct dynamic_prop prop;
if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type ()))
type->add_dyn_prop (DYN_PROP_BYTE_SIZE, prop);
- TYPE_LENGTH (type) = 0;
+
+ type->set_length (0);
}
}
else
- {
- TYPE_LENGTH (type) = 0;
- }
+ type->set_length (0);
maybe_set_alignment (cu, die, type);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr != nullptr)
- {
- TYPE_LENGTH (type) = attr->constant_value (0);
- }
+ type->set_length (attr->constant_value (0));
else
- {
- TYPE_LENGTH (type) = 0;
- }
+ type->set_length (0);
maybe_set_alignment (cu, die, type);
type->set_is_unsigned (underlying_type->is_unsigned ());
if (TYPE_LENGTH (type) == 0)
- TYPE_LENGTH (type) = TYPE_LENGTH (underlying_type);
+ type->set_length (TYPE_LENGTH (underlying_type));
if (TYPE_RAW_ALIGN (type) == 0
&& TYPE_RAW_ALIGN (underlying_type) != 0)
int last_fieldno = range_fields.size () - 1;
int bounds_size = (bounds->field (last_fieldno).loc_bitpos () / 8
+ TYPE_LENGTH (bounds->field (last_fieldno).type ()));
- TYPE_LENGTH (bounds) = align_up (bounds_size, max_align);
+ bounds->set_length (align_up (bounds_size, max_align));
/* Rewrite the existing array type in place. Specifically, we
remove any dynamic properties we might have read, and we replace
result->field (1).set_loc_bitpos (8 * bounds_offset);
result->set_name (type->name ());
- TYPE_LENGTH (result) = (TYPE_LENGTH (result->field (0).type ())
- + TYPE_LENGTH (result->field (1).type ()));
+ result->set_length (TYPE_LENGTH (result->field (0).type ())
+ + TYPE_LENGTH (result->field (1).type ()));
return result;
}
if (attr != nullptr && attr->form_is_unsigned ())
{
if (attr->as_unsigned () >= TYPE_LENGTH (type))
- TYPE_LENGTH (type) = attr->as_unsigned ();
+ type->set_length (attr->as_unsigned ());
else
complaint (_("DW_AT_byte_size for array type smaller "
"than the total size of elements"));
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr != nullptr && attr->form_is_unsigned ())
- TYPE_LENGTH (set_type) = attr->as_unsigned ();
+ set_type->set_length (attr->as_unsigned ());
maybe_set_alignment (cu, die, set_type);
}
}
- TYPE_LENGTH (type) = byte_size;
+ type->set_length (byte_size);
set_type_align (type, alignment);
return set_die_type (die, type, cu);
}
type = lookup_reference_type (target_type, refcode);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr != nullptr)
- {
- TYPE_LENGTH (type) = attr->constant_value (cu_header->addr_size);
- }
+ type->set_length (attr->constant_value (cu_header->addr_size));
else
- {
- TYPE_LENGTH (type) = cu_header->addr_size;
- }
+ type->set_length (cu_header->addr_size);
+
maybe_set_alignment (cu, die, type);
return set_die_type (die, type, cu);
}
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr != nullptr)
- TYPE_LENGTH (range_type) = attr->constant_value (0);
+ range_type->set_length (attr->constant_value (0));
maybe_set_alignment (cu, die, range_type);
struct type *type = &m_type;
TYPE_MAIN_TYPE (type) = &m_main_type;
- TYPE_LENGTH (type) = 1;
+ type->set_length (1);
type->set_code (TYPE_CODE_METHOD);
TYPE_CHAIN (type) = type;
type->set_instance_flags (flags);
upper_bound = f77_get_upperbound (type);
/* Patch in a valid length value. */
-
- TYPE_LENGTH (type) =
- (upper_bound - lower_bound + 1)
- * TYPE_LENGTH (check_typedef (type->target_type ()));
+ type->set_length ((upper_bound - lower_bound + 1)
+ * TYPE_LENGTH (check_typedef (type->target_type ())));
}
/* Per-dimension statistics. */
/* FIXME! Assumes the machine has only one representation for pointers! */
- TYPE_LENGTH (ntype) = gdbarch_ptr_bit (type->arch ()) / TARGET_CHAR_BIT;
+ ntype->set_length (gdbarch_ptr_bit (type->arch ()) / TARGET_CHAR_BIT);
ntype->set_code (TYPE_CODE_PTR);
/* Mark pointers as unsigned. The target converts between pointers
chain = TYPE_CHAIN (ntype);
while (chain != ntype)
{
- TYPE_LENGTH (chain) = TYPE_LENGTH (ntype);
+ chain->set_length (TYPE_LENGTH (ntype));
chain = TYPE_CHAIN (chain);
}
references, and that it matches the (only) representation for
pointers! */
- TYPE_LENGTH (ntype) = gdbarch_ptr_bit (type->arch ()) / TARGET_CHAR_BIT;
+ ntype->set_length (gdbarch_ptr_bit (type->arch ()) / TARGET_CHAR_BIT);
ntype->set_code (refcode);
*reftype = ntype;
chain = TYPE_CHAIN (ntype);
while (chain != ntype)
{
- TYPE_LENGTH (chain) = TYPE_LENGTH (ntype);
+ chain->set_length (TYPE_LENGTH (ntype));
chain = TYPE_CHAIN (chain);
}
ntype->set_target_type (type);
- TYPE_LENGTH (ntype) = 1;
+ ntype->set_length (1);
ntype->set_code (TYPE_CODE_FUNC);
INIT_FUNC_SPECIFIC (ntype);
ntype->set_instance_flags (new_flags);
/* Set length of new type to that of the original type. */
- TYPE_LENGTH (ntype) = TYPE_LENGTH (type);
+ ntype->set_length (TYPE_LENGTH (type));
return ntype;
}
call replace_type(). */
gdb_assert (TYPE_ADDRESS_CLASS_ALL (chain) == 0);
- TYPE_LENGTH (chain) = TYPE_LENGTH (type);
+ chain->set_length (TYPE_LENGTH (type));
chain = TYPE_CHAIN (chain);
}
while (ntype != chain);
mtype = alloc_type_copy (type);
mtype->set_code (TYPE_CODE_METHOD);
- TYPE_LENGTH (mtype) = 1;
+ mtype->set_length (1);
mtype->set_is_stub (true);
mtype->set_target_type (type);
/* TYPE_SELF_TYPE (mtype) = unknown yet */
if (index_type->is_stub ())
result_type->set_target_is_stub (true);
else
- TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type));
+ result_type->set_length (TYPE_LENGTH (check_typedef (index_type)));
range_bounds *bounds
= (struct range_bounds *) TYPE_ZALLOC (result_type, sizeof (range_bounds));
empty arrays with the high_bound being smaller than the low_bound.
In such cases, the array length should be zero. */
if (high_bound < low_bound)
- TYPE_LENGTH (type) = 0;
+ type->set_length (0);
else if (stride != 0)
{
/* Ensure that the type length is always positive, even in the
special, it's still just a single element array) so do
consider that case when touching this code. */
LONGEST element_count = std::abs (high_bound - low_bound + 1);
- TYPE_LENGTH (type)
- = ((std::abs (stride) * element_count) + 7) / 8;
+ type->set_length (((std::abs (stride) * element_count) + 7) / 8);
}
else
- TYPE_LENGTH (type) =
- TYPE_LENGTH (element_type) * (high_bound - low_bound + 1);
+ type->set_length (TYPE_LENGTH (element_type)
+ * (high_bound - low_bound + 1));
/* If this array's element is itself an array with a bit stride,
then we want to update this array's bit stride to reflect the
to trust TYPE_LENGTH in this case, setting the size to zero
allows us to avoid allocating objects of random sizes in case
we accidently do. */
- TYPE_LENGTH (result_type) = 0;
+ result_type->set_length (0);
}
/* TYPE_TARGET_STUB will take care of zero length arrays. */
low_bound = high_bound = 0;
bit_length = high_bound - low_bound + 1;
- TYPE_LENGTH (result_type)
- = (bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
+ result_type->set_length ((bit_length + TARGET_CHAR_BIT - 1)
+ / TARGET_CHAR_BIT);
if (low_bound >= 0)
result_type->set_is_unsigned (true);
}
set_type_self_type (type, self_type);
/* Assume that a data member pointer is the same size as a normal
pointer. */
- TYPE_LENGTH (type) = gdbarch_ptr_bit (to_type->arch ()) / TARGET_CHAR_BIT;
+ type->set_length (gdbarch_ptr_bit (to_type->arch ()) / TARGET_CHAR_BIT);
}
/* Smash TYPE to be a type of pointer to methods type TO_TYPE.
type->set_code (TYPE_CODE_METHODPTR);
type->set_target_type (to_type);
set_type_self_type (type, TYPE_SELF_TYPE (to_type));
- TYPE_LENGTH (type) = cplus_method_ptr_size (to_type);
+ type->set_length (cplus_method_ptr_size (to_type));
}
/* Smash TYPE to be a type of method of SELF_TYPE with type TO_TYPE.
set_type_self_type (type, self_type);
type->set_fields (args);
type->set_num_fields (nargs);
+
if (varargs)
type->set_has_varargs (true);
- TYPE_LENGTH (type) = 1; /* In practice, this is never needed. */
+
+ /* In practice, this is never needed. */
+ type->set_length (1);
}
/* A wrapper of TYPE_NAME which calls error if the type is anonymous.
max_len = TYPE_LENGTH (real_type);
}
- TYPE_LENGTH (resolved_type) = max_len;
+ resolved_type->set_length (max_len);
return resolved_type;
}
type length of the structure. If we adapt it, we run into problems
when calculating the element offset for arrays of structs. */
if (current_language->la_language != language_fortran)
- TYPE_LENGTH (resolved_type)
- = (resolved_type_bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
+ resolved_type->set_length ((resolved_type_bit_length + TARGET_CHAR_BIT - 1)
+ / TARGET_CHAR_BIT);
/* The Ada language uses this field as a cache for static fixed types: reset
it as RESOLVED_TYPE must have its own static fixed type. */
if (type_length.has_value ())
{
- TYPE_LENGTH (resolved_type) = *type_length;
+ resolved_type->set_length (*type_length);
resolved_type->remove_dyn_prop (DYN_PROP_BYTE_SIZE);
}
}
else if (type->code () == TYPE_CODE_RANGE)
{
- TYPE_LENGTH (type) = TYPE_LENGTH (target_type);
+ type->set_length (TYPE_LENGTH (target_type));
type->set_target_is_stub (false);
}
else if (type->code () == TYPE_CODE_ARRAY
type = make_qualified_type (type, instance_flags, NULL);
/* Cache TYPE_LENGTH for future use. */
- TYPE_LENGTH (orig_type) = TYPE_LENGTH (type);
+ orig_type->set_length (TYPE_LENGTH (type));
return type;
}
type = alloc_type (objfile);
set_type_code (type, code);
gdb_assert ((bit % TARGET_CHAR_BIT) == 0);
- TYPE_LENGTH (type) = bit / TARGET_CHAR_BIT;
+ type->set_length (bit / TARGET_CHAR_BIT);
type->set_name (name);
return type;
t = alloc_type_copy (target_type);
set_type_code (t, TYPE_CODE_COMPLEX);
- TYPE_LENGTH (t) = 2 * TYPE_LENGTH (target_type);
+ t->set_length (2 * TYPE_LENGTH (target_type));
t->set_name (name);
t->set_target_type (target_type);
new_type->set_name (xstrdup (type->name ()));
new_type->set_instance_flags (type->instance_flags ());
- TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
+ new_type->set_length (TYPE_LENGTH (type));
/* Copy the fields. */
if (type->num_fields ())
{
struct type *new_type = alloc_type_copy (type);
new_type->set_instance_flags (type->instance_flags ());
- TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
+ new_type->set_length (TYPE_LENGTH (type));
memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type),
sizeof (struct main_type));
if (type->main_type->dyn_prop_list != NULL)
type = alloc_type_arch (gdbarch);
set_type_code (type, code);
gdb_assert ((bit % TARGET_CHAR_BIT) == 0);
- TYPE_LENGTH (type) = bit / TARGET_CHAR_BIT;
+ type->set_length (bit / TARGET_CHAR_BIT);
if (name)
type->set_name (gdbarch_obstack_strdup (gdbarch, name));
if (t->code () == TYPE_CODE_UNION)
{
if (TYPE_LENGTH (t) < TYPE_LENGTH (field))
- TYPE_LENGTH (t) = TYPE_LENGTH (field);
+ t->set_length (TYPE_LENGTH (field));
}
else if (t->code () == TYPE_CODE_STRUCT)
{
- TYPE_LENGTH (t) = TYPE_LENGTH (t) + TYPE_LENGTH (field);
+ t->set_length (TYPE_LENGTH (t) + TYPE_LENGTH (field));
if (t->num_fields () > 1)
{
f->set_loc_bitpos
if (left)
{
f->set_loc_bitpos (f[0].loc_bitpos () + (alignment - left));
- TYPE_LENGTH (t) += (alignment - left) / TARGET_CHAR_BIT;
+ t->set_length
+ (t->length () + (alignment - left) / TARGET_CHAR_BIT);
}
}
}
this->main_type->name = name;
}
+ ULONGEST length () const
+ {
+ return this->m_length;
+ }
+
+ void set_length (ULONGEST length)
+ {
+ this->m_length = length;
+ }
+
/* Get the number of fields of this type. */
int num_fields () const
{
bool bit_size_differs_p () const
{
return (main_type->type_specific_field == TYPE_SPECIFIC_INT
- && main_type->type_specific.int_stuff.bit_size != 8 * length);
+ && main_type->type_specific.int_stuff.bit_size != 8 * length ());
}
/* * Return the logical (bit) size for this integer type. Only
type_length_units function should be used in order to get the length
expressed in target addressable memory units. */
- ULONGEST length;
+ ULONGEST m_length;
/* * Core type, shared by a group of qualified types. */
But check_typedef does set the TYPE_LENGTH of the TYPEDEF type,
so you only have to call check_typedef once. Since allocate_value
calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */
-#define TYPE_LENGTH(thistype) (thistype)->length
+#define TYPE_LENGTH(thistype) ((thistype)->length ())
/* * Return the alignment of the type in target addressable memory
units, or 0 if no alignment was specified. */
name, (char *) NULL));
t->set_code (type_code);
- TYPE_LENGTH (t) = sh->value;
+ t->set_length (sh->value);
t->set_num_fields (nfields);
f = ((struct field *) TYPE_ALLOC (t, nfields * sizeof (struct field)));
t->set_fields (f);
that too. */
if (TYPE_LENGTH (t) == t->num_fields ()
|| TYPE_LENGTH (t) == 0)
- TYPE_LENGTH (t) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
+ t->set_length (gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT);
for (ext_tsym = ext_sh + external_sym_size;
;
ext_tsym += external_sym_size)
tmp->set_name (OCL_STRING(TYPE ## 2)); \
tmp = add (init_vector_type (ELEMENT_TYPE, 3)); \
tmp->set_name (OCL_STRING(TYPE ## 3)); \
- TYPE_LENGTH (tmp) = 4 * TYPE_LENGTH (ELEMENT_TYPE); \
+ tmp->set_length (4 * TYPE_LENGTH (ELEMENT_TYPE)); \
tmp = add (init_vector_type (ELEMENT_TYPE, 4)); \
tmp->set_name (OCL_STRING(TYPE ## 4)); \
tmp = add (init_vector_type (ELEMENT_TYPE, 8)); \
}
if (i > 0)
- TYPE_LENGTH (result)
- = (result->field (i - 1).loc_bitpos () / TARGET_CHAR_BIT +
- TYPE_LENGTH (result->field (i - 1).type ()));
+ result->set_length (result->field (i - 1).loc_bitpos () / TARGET_CHAR_BIT
+ + TYPE_LENGTH (result->field (i - 1).type ()));
return result;
}
{
/* It's being defined as itself. That means it is "void". */
type->set_code (TYPE_CODE_VOID);
- TYPE_LENGTH (type) = 1;
+ type->set_length (1);
}
else if (type_size >= 0 || is_string)
{
/* Size specified in a type attribute overrides any other size. */
if (type_size != -1)
- TYPE_LENGTH (type) = (type_size + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
+ type->set_length ((type_size + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT);
return type;
}
while (ntype != type)
{
if (TYPE_LENGTH(ntype) == 0)
- TYPE_LENGTH (ntype) = TYPE_LENGTH (type);
+ ntype->set_length (TYPE_LENGTH (type));
else
complain_about_struct_wipeout (ntype);
ntype = TYPE_CHAIN (ntype);
{
int nbits;
- TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0);
+ type->set_length (read_huge_number (pp, 0, &nbits, 0));
if (nbits != 0)
return error_type (pp, objfile);
set_length_in_type_chain (type);
/* Now fill in the fields of the type-structure. */
- TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
+ type->set_length (gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT);
set_length_in_type_chain (type);
type->set_code (TYPE_CODE_ENUM);
type->set_is_stub (false);
}
if (e->size != 0)
- TYPE_LENGTH (m_type) = e->size;
+ m_type->set_length (e->size);
}
void make_gdb_type_union (const tdesc_type_with_fields *e)