vla: introduce new bound type abstraction adapt uses
The rational behind this patch is to get started to implement the feature described in dwarf4 standard (2.19) Static and Dynamic Values of Attributes. It adds new BOUND_PROP to store either a constant, exprloc, or reference to describe an upper-/lower bound of a subrange. Other than that no new features are introduced. * dwarf2read.c (read_subrange_type): Use struct bound_prop for declaring high/low bounds and change uses accordingly. Call create_range_type instead of create_static_range_type. * gdbtypes.c (create_range_type): New function. (create_range_type): Convert bounds into struct bound_prop and pass them to create_range_type. * gdbtypes.h (struct bound_prop): New struct. (create_range_type): New function prototype. (struct range_bounds): Use struct bound_prop instead of LONGEST for high/low bounds. Remove low_undefined/high_undefined and adapt all uses. (TYPE_LOW_BOUND,TYPE_HIGH_BOUND): Adapt macros to refer to the static part of the bound. * parse.c (follow_types): Set high bound kind to BOUND_UNDEFINED.
This commit is contained in:
parent
0c9c347402
commit
729efb1317
5 changed files with 123 additions and 47 deletions
|
@ -1692,7 +1692,8 @@ follow_types (struct type *follow_type)
|
|||
lookup_array_range_type (follow_type,
|
||||
0, array_size >= 0 ? array_size - 1 : 0);
|
||||
if (array_size < 0)
|
||||
TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (follow_type) = 1;
|
||||
TYPE_HIGH_BOUND_KIND (TYPE_INDEX_TYPE (follow_type))
|
||||
= PROP_UNDEFINED;
|
||||
break;
|
||||
case tp_function:
|
||||
/* FIXME-type-allocation: need a way to free this type when we are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue