x86: Correct noavx512_vp2intersect
[deliverable/binutils-gdb.git] / gdb / c-typeprint.c
index bbe12ccfe871ff27fe8e639a099befff9af99a99..e10a4858a03cc9371f7b7e63dd34a395ec2beb2b 100644 (file)
@@ -277,8 +277,8 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
                           enum language language,
                           const struct type_print_options *flags)
 {
-  struct field *args = TYPE_FIELDS (mtype);
-  int nargs = TYPE_NFIELDS (mtype);
+  struct field *args = mtype->fields ();
+  int nargs = mtype->num_fields ();
   int varargs = TYPE_VARARGS (mtype);
   int i;
 
@@ -302,7 +302,7 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
          if (FIELD_ARTIFICIAL (arg))
            continue;
 
-         c_print_type (arg.type, "", stream, 0, 0, flags);
+         c_print_type (arg.type (), "", stream, 0, 0, flags);
 
          if (i == nargs && varargs)
            fprintf_filtered (stream, ", ...");
@@ -327,8 +327,8 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
       struct type *domain;
 
       gdb_assert (nargs > 0);
-      gdb_assert (args[0].type->code () == TYPE_CODE_PTR);
-      domain = TYPE_TARGET_TYPE (args[0].type);
+      gdb_assert (args[0].type ()->code () == TYPE_CODE_PTR);
+      domain = TYPE_TARGET_TYPE (args[0].type ());
 
       if (TYPE_CONST (domain))
        fprintf_filtered (stream, " const");
@@ -560,7 +560,7 @@ c_type_print_args (struct type *type, struct ui_file *stream,
 
   fprintf_filtered (stream, "(");
 
-  for (i = 0; i < TYPE_NFIELDS (type); i++)
+  for (i = 0; i < type->num_fields (); i++)
     {
       struct type *param_type;
 
@@ -573,7 +573,7 @@ c_type_print_args (struct type *type, struct ui_file *stream,
          wrap_here ("    ");
        }
 
-      param_type = TYPE_FIELD_TYPE (type, i);
+      param_type = type->field (i).type ();
 
       if (language == language_cplus && linkage_name)
        {
@@ -780,8 +780,8 @@ c_type_print_varspec_suffix (struct type *type,
        fprintf_filtered (stream, (is_vector ?
                                   " __attribute__ ((vector_size(" : "["));
        /* Bounds are not yet resolved, print a bounds placeholder instead.  */
-       if (TYPE_HIGH_BOUND_KIND (TYPE_INDEX_TYPE (type)) == PROP_LOCEXPR
-           || TYPE_HIGH_BOUND_KIND (TYPE_INDEX_TYPE (type)) == PROP_LOCLIST)
+       if (TYPE_HIGH_BOUND_KIND (type->index_type ()) == PROP_LOCEXPR
+           || TYPE_HIGH_BOUND_KIND (type->index_type ()) == PROP_LOCLIST)
          fprintf_filtered (stream, "variable length");
        else if (get_array_bounds (type, &low_bound, &high_bound))
          fprintf_filtered (stream, "%s", 
@@ -965,7 +965,7 @@ need_access_label_p (struct type *type)
   if (TYPE_DECLARED_CLASS (type))
     {
       QUIT;
-      for (int i = TYPE_N_BASECLASSES (type); i < TYPE_NFIELDS (type); i++)
+      for (int i = TYPE_N_BASECLASSES (type); i < type->num_fields (); i++)
        if (!TYPE_FIELD_PRIVATE (type, i))
          return true;
       QUIT;
@@ -982,7 +982,7 @@ need_access_label_p (struct type *type)
   else
     {
       QUIT;
-      for (int i = TYPE_N_BASECLASSES (type); i < TYPE_NFIELDS (type); i++)
+      for (int i = TYPE_N_BASECLASSES (type); i < type->num_fields (); i++)
        if (TYPE_FIELD_PRIVATE (type, i) || TYPE_FIELD_PROTECTED (type, i))
          return true;
       QUIT;
@@ -1115,7 +1115,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
 
       fprintf_filtered (stream, "{\n");
 
-      if (TYPE_NFIELDS (type) == 0 && TYPE_NFN_FIELDS (type) == 0
+      if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0
          && TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
        {
          if (TYPE_STUB (type))
@@ -1143,7 +1143,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
       /* If there is a base class for this type,
         do not print the field that it occupies.  */
 
-      int len = TYPE_NFIELDS (type);
+      int len = type->num_fields ();
       vptr_fieldno = get_vptr_fieldno (type, &basetype);
 
       struct print_offset_data local_podata;
@@ -1167,7 +1167,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
                 TYPE_FIELD_PRIVATE (type, i), flags);
            }
 
-         bool is_static = field_is_static (&TYPE_FIELD (type, i));
+         bool is_static = field_is_static (&type->field (i));
 
          if (flags->print_offsets)
            podata->update (type, i, stream);
@@ -1179,8 +1179,8 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
          int newshow = show - 1;
 
          if (!is_static && flags->print_offsets
-             && (TYPE_FIELD_TYPE (type, i)->code () == TYPE_CODE_STRUCT
-                 || TYPE_FIELD_TYPE (type, i)->code () == TYPE_CODE_UNION))
+             && (type->field (i).type ()->code () == TYPE_CODE_STRUCT
+                 || type->field (i).type ()->code () == TYPE_CODE_UNION))
            {
              /* If we're printing offsets and this field's type is
                 either a struct or an union, then we're interested in
@@ -1200,10 +1200,10 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
                 the whole struct/union.  */
              local_podata.end_bitpos
                = podata->end_bitpos
-                 - TYPE_LENGTH (TYPE_FIELD_TYPE (type, i)) * TARGET_CHAR_BIT;
+                 - TYPE_LENGTH (type->field (i).type ()) * TARGET_CHAR_BIT;
            }
 
-         c_print_type_1 (TYPE_FIELD_TYPE (type, i),
+         c_print_type_1 (type->field (i).type (),
                          TYPE_FIELD_NAME (type, i),
                          stream, newshow, level + 4,
                          language, &local_flags, &local_podata);
@@ -1374,7 +1374,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
          if (semi_local_flags.print_nested_type_limit > 0)
            --semi_local_flags.print_nested_type_limit;
 
-         if (TYPE_NFIELDS (type) != 0 || TYPE_NFN_FIELDS (type) != 0)
+         if (type->num_fields () != 0 || TYPE_NFN_FIELDS (type) != 0)
            fprintf_filtered (stream, "\n");
 
          for (int i = 0; i < TYPE_NESTED_TYPES_COUNT (type); ++i)
@@ -1392,7 +1392,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
 
       if (TYPE_TYPEDEF_FIELD_COUNT (type) != 0 && flags->print_typedefs)
        {
-         if (TYPE_NFIELDS (type) != 0 || TYPE_NFN_FIELDS (type) != 0
+         if (type->num_fields () != 0 || TYPE_NFN_FIELDS (type) != 0
              || TYPE_NESTED_TYPES_COUNT (type) != 0)
            fprintf_filtered (stream, "\n");
 
@@ -1593,7 +1593,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
            }
 
          fprintf_filtered (stream, "{");
-         len = TYPE_NFIELDS (type);
+         len = type->num_fields ();
          for (i = 0; i < len; i++)
            {
              QUIT;
@@ -1627,7 +1627,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
          {
            fputs_filtered (" ", stream);
            fprintf_filtered (stream, "{\n");
-           if (TYPE_NFIELDS (type) == 0)
+           if (type->num_fields () == 0)
              {
                if (TYPE_STUB (type))
                  fprintfi_filtered (level + 4, stream,
@@ -1638,14 +1638,14 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
                                     _("%p[<no data fields>%p]\n"),
                                     metadata_style.style ().ptr (), nullptr);
              }
-           len = TYPE_NFIELDS (type);
+           len = type->num_fields ();
            for (i = 0; i < len; i++)
              {
                QUIT;
                print_spaces_filtered (level + 4, stream);
                /* We pass "show" here and not "show - 1" to get enum types
                   printed.  There's no other way to see them.  */
-               c_print_type_1 (TYPE_FIELD_TYPE (type, i),
+               c_print_type_1 (type->field (i).type (),
                                TYPE_FIELD_NAME (type, i),
                                stream, show, level + 4,
                                language, &local_flags, podata);
This page took 0.028934 seconds and 4 git commands to generate.