/* Convert types from GDB to GCC
- Copyright (C) 2014-2023 Free Software Foundation, Inc.
+ Copyright (C) 2014-2024 Free Software Foundation, Inc.
This file is part of GDB.
static enum gcc_cp_symbol_kind
get_field_access_flag (const struct type *type, int num)
{
- if (TYPE_FIELD_PROTECTED (type, num))
+ field &fld = type->field (num);
+ if (fld.is_protected ())
return GCC_CP_ACCESS_PROTECTED;
- else if (TYPE_FIELD_PRIVATE (type, num))
+ else if (fld.is_private ())
return GCC_CP_ACCESS_PRIVATE;
/* GDB assumes everything else is public. */
struct type *range = type->index_type ();
gcc_type element_type = instance->convert_type (type->target_type ());
- if (range->bounds ()->low.kind () != PROP_CONST)
+ if (!range->bounds ()->low.is_constant ())
{
const char *s = _("array type with non-constant"
" lower bound is not supported");
{
const char *field_name = type->field (i).name ();
- if (TYPE_FIELD_IGNORE (type, i)
- || TYPE_FIELD_ARTIFICIAL (type, i))
+ if (type->field (i).is_ignored ()
+ || type->field (i).is_artificial ())
continue;
/* GDB records unnamed/anonymous fields with empty string names. */
}
else
{
- unsigned long bitsize = TYPE_FIELD_BITSIZE (type, i);
+ unsigned long bitsize = type->field (i).bitsize ();
enum gcc_cp_symbol_kind field_flags = GCC_CP_SYMBOL_FIELD
| get_field_access_flag (type, i);
int artificials = 0;
for (int i = 0; i < type->num_fields (); ++i)
{
- if (strip_artificial && TYPE_FIELD_ARTIFICIAL (type, i))
+ if (strip_artificial && type->field (i).is_artificial ())
{
--array.n_elements;
++artificials;