/* Get the bounds bounds of this type. The type must be a range type. */
range_bounds *bounds () const
{
- gdb_assert (this->code () == TYPE_CODE_RANGE);
-
- return this->main_type->flds_bnds.bounds;
+ switch (this->code ())
+ {
+ case TYPE_CODE_RANGE:
+ return this->main_type->flds_bnds.bounds;
+
+ case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
+ return this->index_type ()->bounds ();
+
+ default:
+ gdb_assert_not_reached
+ ("type::bounds called on type with invalid code");
+ }
}
/* Set the bounds of this type. The type must be a range type. */
#define TYPE_ASSOCIATED_PROP(thistype) \
((thistype)->dyn_prop (DYN_PROP_ASSOCIATED))
-/* Attribute accessors for dynamic properties. */
-#define TYPE_DYN_PROP_BATON(dynprop) \
- dynprop->data.baton
-#define TYPE_DYN_PROP_ADDR(dynprop) \
- (dynprop->const_val ())
-#define TYPE_DYN_PROP_KIND(dynprop) \
- (dynprop->kind ())
-
-
-/* Accessors for struct range_bounds data attached to an array type's
- index type. */
-
-#define TYPE_ARRAY_BIT_STRIDE(arraytype) \
- ((arraytype)->index_type ()->bounds ()->bit_stride ())
-
/* C++ */
#define TYPE_SELF_TYPE(thistype) internal_type_self_type (thistype)