]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/compile/compile-cplus-types.c
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / compile / compile-cplus-types.c
index 2f87ad865faa7eeb8b490e5fafac2b5660c36a2a..90ce3f15e143e7d28183660ffe040601e288385e 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -73,9 +73,10 @@ compile_cplus_instance::decl_name (const char *natural)
 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.  */
@@ -455,7 +456,7 @@ compile_cplus_convert_array (compile_cplus_instance *instance,
   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");
@@ -583,8 +584,8 @@ compile_cplus_convert_struct_or_union_members
     {
       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.  */
@@ -642,7 +643,7 @@ compile_cplus_convert_struct_or_union_members
        }
       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);
 
@@ -982,7 +983,7 @@ compile_cplus_convert_func (compile_cplus_instance *instance,
   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;