refactoring: rename create_range_type to create_static_range_type

* gdbtypes.c (create_static_range_type): Renamed from create_range_type.
	* gdbtypes.h (create_static_range_type): Renamed from create_range_type.
	* ada-lang.c: All uses of create_range_type updated.
	* coffread.c: All uses of create_range_type updated.
	* dwarf2read.c: All uses of create_range_type updated.
	* f-exp.y: All uses of create_range_type updated.
	* m2-valprint.c: All uses of create_range_type updated.
	* mdebugread.c: All uses of create_range_type updated.
	* stabsread.c: All uses of create_range_type updated.
	* valops.c: All uses of create_range_type updated.
	* valprint.c: All uses of create_range_type updated.
This commit is contained in:
Sanimir Agovic
2013-12-19 08:31:17 +00:00
parent 85cf705b9d
commit 0c9c347402
12 changed files with 64 additions and 47 deletions

View File

@@ -1981,9 +1981,9 @@ ada_type_of_array (struct value *arr, int bounds)
struct value *high = desc_one_bound (descriptor, arity, 1);
arity -= 1;
create_range_type (range_type, value_type (low),
longest_to_int (value_as_long (low)),
longest_to_int (value_as_long (high)));
create_static_range_type (range_type, value_type (low),
longest_to_int (value_as_long (low)),
longest_to_int (value_as_long (high)));
elt_type = create_array_type (array_type, elt_type, range_type);
if (ada_is_unconstrained_packed_array_type (value_type (arr)))
@@ -2754,9 +2754,10 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type,
CORE_ADDR base = value_as_address (array_ptr)
+ ((low - ada_discrete_type_low_bound (TYPE_INDEX_TYPE (type0)))
* TYPE_LENGTH (TYPE_TARGET_TYPE (type0)));
struct type *index_type =
create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type0)),
low, high);
struct type *index_type
= create_static_range_type (NULL,
TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type0)),
low, high);
struct type *slice_type =
create_array_type (NULL, TYPE_TARGET_TYPE (type0), index_type);
@@ -2768,8 +2769,8 @@ static struct value *
ada_value_slice (struct value *array, int low, int high)
{
struct type *type = ada_check_typedef (value_type (array));
struct type *index_type =
create_range_type (NULL, TYPE_INDEX_TYPE (type), low, high);
struct type *index_type
= create_static_range_type (NULL, TYPE_INDEX_TYPE (type), low, high);
struct type *slice_type =
create_array_type (NULL, TYPE_TARGET_TYPE (type), index_type);
@@ -2980,9 +2981,9 @@ static struct value *
empty_array (struct type *arr_type, int low)
{
struct type *arr_type0 = ada_check_typedef (arr_type);
struct type *index_type =
create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (arr_type0)),
low, low - 1);
struct type *index_type
= create_static_range_type
(NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (arr_type0)), low, low - 1);
struct type *elt_type = ada_array_element_type (arr_type0, 1);
return allocate_value (create_array_type (NULL, elt_type, index_type));
@@ -11120,9 +11121,8 @@ to_fixed_range_type (struct type *raw_type, struct value *dval)
if (L < INT_MIN || U > INT_MAX)
return raw_type;
else
return create_range_type (alloc_type_copy (raw_type), raw_type,
ada_discrete_type_low_bound (raw_type),
ada_discrete_type_high_bound (raw_type));
return create_static_range_type (alloc_type_copy (raw_type), raw_type,
L, U);
}
else
{
@@ -11185,7 +11185,8 @@ to_fixed_range_type (struct type *raw_type, struct value *dval)
}
}
type = create_range_type (alloc_type_copy (raw_type), base_type, L, U);
type = create_static_range_type (alloc_type_copy (raw_type),
base_type, L, U);
TYPE_NAME (type) = name;
return type;
}