/* Worker for is_dynamic_type. */
static int
-is_dynamic_type_internal (struct type *type, int top_level)
+is_dynamic_type_internal (struct type *type)
{
type = check_typedef (type);
of the range type are static. It allows us to assume that
the subtype of a static range type is also static. */
return (!has_static_range (TYPE_RANGE_DATA (type))
- || is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0));
+ || is_dynamic_type_internal (TYPE_TARGET_TYPE (type)));
}
case TYPE_CODE_ARRAY:
/* The array is dynamic if either the bounds are dynamic,
or the elements it contains have a dynamic contents. */
- if (is_dynamic_type_internal (TYPE_INDEX_TYPE (type), 0))
+ if (is_dynamic_type_internal (TYPE_INDEX_TYPE (type)))
return 1;
- return is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0);
+ return is_dynamic_type_internal (TYPE_TARGET_TYPE (type));
}
case TYPE_CODE_STRUCT:
for (i = 0; i < TYPE_NFIELDS (type); ++i)
if (!field_is_static (&TYPE_FIELD (type, i))
- && is_dynamic_type_internal (TYPE_FIELD_TYPE (type, i), 0))
+ && is_dynamic_type_internal (TYPE_FIELD_TYPE (type, i)))
return 1;
}
break;
int
is_dynamic_type (struct type *type)
{
- return is_dynamic_type_internal (type, 1);
+ return is_dynamic_type_internal (type);
}
static struct type *resolve_dynamic_type_internal
- (struct type *type, struct property_addr_info *addr_stack, int top_level);
+ (struct type *type, struct property_addr_info *addr_stack);
/* Given a dynamic range type (dyn_range_type) and a stack of
struct property_addr_info elements, return a static version
static_target_type
= resolve_dynamic_type_internal (TYPE_TARGET_TYPE (dyn_range_type),
- addr_stack, 0);
+ addr_stack);
static_range_type = create_range_type (copy_type (dyn_range_type),
static_target_type,
&low_bound, &high_bound);
continue;
t = resolve_dynamic_type_internal (TYPE_FIELD_TYPE (resolved_type, i),
- addr_stack, 0);
+ addr_stack);
TYPE_FIELD_TYPE (resolved_type, i) = t;
if (TYPE_LENGTH (t) > max_len)
max_len = TYPE_LENGTH (t);
TYPE_FIELD_TYPE (resolved_type, i)
= resolve_dynamic_type_internal (TYPE_FIELD_TYPE (resolved_type, i),
- &pinfo, 0);
+ &pinfo);
gdb_assert (TYPE_FIELD_LOC_KIND (resolved_type, i)
== FIELD_LOC_KIND_BITPOS);
static struct type *
resolve_dynamic_type_internal (struct type *type,
- struct property_addr_info *addr_stack,
- int top_level)
+ struct property_addr_info *addr_stack)
{
struct type *real_type = check_typedef (type);
struct type *resolved_type = type;
struct dynamic_prop *prop;
CORE_ADDR value;
- if (!is_dynamic_type_internal (real_type, top_level))
+ if (!is_dynamic_type_internal (real_type))
return type;
if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
{
resolved_type = copy_type (type);
TYPE_TARGET_TYPE (resolved_type)
- = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (type), addr_stack,
- top_level);
+ = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (type), addr_stack);
}
else
{
{
struct property_addr_info pinfo = {check_typedef (type), addr, NULL};
- return resolve_dynamic_type_internal (type, &pinfo, 1);
+ return resolve_dynamic_type_internal (type, &pinfo);
}
/* See gdbtypes.h */