+2020-07-12 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (struct range_bounds) <bit_stride>: New method.
+ (struct type) <bit_stride>: New method.
+ (TYPE_BIT_STRIDE): Remove.
+ * gdbtypes.c (update_static_array_size): Use type::bit_stride.
+
2020-07-12 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_ARRAY_LOWER_BOUND_VALUE,
arrays bit size field. */
stride = TYPE_FIELD_BITSIZE (type, 0);
if (stride == 0)
- stride = TYPE_BIT_STRIDE (range_type);
+ stride = range_type->bit_stride ();
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
low_bound = high_bound = 0;
struct range_bounds
{
+ ULONGEST bit_stride () const
+ {
+ if (this->flag_is_byte_stride)
+ return this->stride.const_val () * 8;
+ else
+ return this->stride.const_val ();
+ }
+
/* * Low bound of range. */
struct dynamic_prop low;
this->main_type->flds_bnds.bounds = bounds;
}
+ ULONGEST bit_stride () const
+ {
+ return this->bounds ()->bit_stride ();
+ }
+
/* * Return the dynamic property of the requested KIND from this type's
list of dynamic properties. */
dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
space in struct type. */
extern bool set_type_align (struct type *, ULONGEST);
-#define TYPE_BIT_STRIDE(range_type) \
- ((range_type)->bounds ()->stride.const_val () \
- * ((range_type)->bounds ()->flag_is_byte_stride ? 8 : 1))
-
/* Property accessors for the type data location. */
#define TYPE_DATA_LOCATION(thistype) \
((thistype)->dyn_prop (DYN_PROP_DATA_LOCATION))
index type. */
#define TYPE_ARRAY_BIT_STRIDE(arraytype) \
- (TYPE_BIT_STRIDE(((arraytype)->index_type ())))
+ ((arraytype)->index_type ()->bounds ()->bit_stride ())
/* C++ */