+2020-11-24 Joel Brobecker <brobecker@adacore.com>
+
+ * gdbtypes.h (struct type) <fixed_point_type_base_type> New method,
+ replacing the fixed_point_type_base_type function. All callers
+ updated throughout this project.
+ (fixed_point_type_base_type): Remove declaration.
+ * gdbtypes.c (type::fixed_point_type_base_type): Replaces
+ fixed_point_type_base_type. Adjust implementation accordingly.
+
2020-11-24 Joel Brobecker <brobecker@adacore.com>
* gdbtypes.h (struct type) <fixed_point_info, set_fixed_point_info>:
}
if (is_fixed_point_type (type))
- type = fixed_point_type_base_type (type);
+ type = type->fixed_point_type_base_type ();
switch (type->code ())
{
/* See gdbtypes.h. */
struct type *
-fixed_point_type_base_type (struct type *type)
+type::fixed_point_type_base_type ()
{
+ struct type *type = this;
+
while (check_typedef (type)->code () == TYPE_CODE_RANGE)
type = TYPE_TARGET_TYPE (check_typedef (type));
type = check_typedef (type);
const gdb_mpq &
fixed_point_scaling_factor (struct type *type)
{
- type = fixed_point_type_base_type (type);
+ type = type->fixed_point_type_base_type ();
return type->fixed_point_info ().scaling_factor;
}
this->main_type->type_specific.fixed_point_info = info;
}
+ /* * Assuming that THIS is a TYPE_CODE_FIXED_POINT, return its base type.
+
+ In other words, this returns the type after having peeled all
+ intermediate type layers (such as TYPE_CODE_RANGE, for instance).
+ The TYPE_CODE of the type returned is guaranteed to be
+ a TYPE_CODE_FIXED_POINT. */
+
+ struct type *fixed_point_type_base_type ();
+
/* * 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;
a range type whose base type is a TYPE_CODE_FIXED_POINT. */
extern bool is_fixed_point_type (struct type *type);
-/* Assuming that TYPE is a fixed point type, return its base type.
-
- In other words, this returns the type after having peeled all
- intermediate type layers (such as TYPE_CODE_RANGE, for instance).
- The TYPE_CODE of the type returned is guaranteed to be
- a TYPE_CODE_FIXED_POINT. */
-extern struct type *fixed_point_type_base_type (struct type *type);
-
/* Given TYPE, which is a fixed point type, return its scaling factor. */
extern const gdb_mpq &fixed_point_scaling_factor (struct type *type);
type = check_typedef (type);
if (is_fixed_point_type (type))
- type = fixed_point_type_base_type (type);
+ type = type->fixed_point_type_base_type ();
switch (type->code ())
{
unpack_long (struct type *type, const gdb_byte *valaddr)
{
if (is_fixed_point_type (type))
- type = fixed_point_type_base_type (type);
+ type = type->fixed_point_type_base_type ();
enum bfd_endian byte_order = type_byte_order (type);
enum type_code code = type->code ();