Change regcache list to be an hash map
[deliverable/binutils-gdb.git] / gdb / ada-typeprint.c
index 076c0a63bfa15f14302288fa6a490b1032039a1a..165ea0ee4aa8b28352e3aef54f5c69e69675205c 100644 (file)
@@ -312,7 +312,7 @@ print_range_type (struct type *raw_type, struct ui_file *stream,
 static void
 print_enum_type (struct type *type, struct ui_file *stream)
 {
-  int len = TYPE_NFIELDS (type);
+  int len = type->num_fields ();
   int i;
   LONGEST lastval;
 
@@ -407,7 +407,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
            {
              if (arr_type != type)
                fprintf_filtered (stream, ", ");
-             print_range (TYPE_INDEX_TYPE (arr_type), stream,
+             print_range (arr_type->index_type (), stream,
                           0 /* bounds_prefered_p */);
              if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0)
                bitsize = TYPE_FIELD_BITSIZE (arr_type, 0);
@@ -417,14 +417,14 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
        {
          int k;
 
-         n_indices = TYPE_NFIELDS (range_desc_type);
+         n_indices = range_desc_type->num_fields ();
          for (k = 0, arr_type = type;
               k < n_indices;
               k += 1, arr_type = TYPE_TARGET_TYPE (arr_type))
            {
              if (k > 0)
                fprintf_filtered (stream, ", ");
-             print_range_type (TYPE_FIELD_TYPE (range_desc_type, k),
+             print_range_type (range_desc_type->field (k).type (),
                                stream, 0 /* bounds_prefered_p */);
              if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0)
                bitsize = TYPE_FIELD_BITSIZE (arr_type, 0);
@@ -549,7 +549,7 @@ print_variant_clauses (struct type *type, int field_num,
   struct type *var_type, *par_type;
   struct type *discr_type;
 
-  var_type = TYPE_FIELD_TYPE (type, field_num);
+  var_type = type->field (field_num).type ();
   discr_type = ada_variant_discrim_type (var_type, outer_type);
 
   if (var_type->code () == TYPE_CODE_PTR)
@@ -563,12 +563,12 @@ print_variant_clauses (struct type *type, int field_num,
   if (par_type != NULL)
     var_type = par_type;
 
-  for (i = 0; i < TYPE_NFIELDS (var_type); i += 1)
+  for (i = 0; i < var_type->num_fields (); i += 1)
     {
       fprintf_filtered (stream, "\n%*swhen ", level + 4, "");
       if (print_choices (var_type, i, stream, discr_type))
        {
-         if (print_record_field_types (TYPE_FIELD_TYPE (var_type, i),
+         if (print_record_field_types (var_type->field (i).type (),
                                        outer_type, stream, show, level + 4,
                                        flags)
              <= 0)
@@ -594,7 +594,7 @@ print_variant_part (struct type *type, int field_num, struct type *outer_type,
                    const struct type_print_options *flags)
 {
   const char *variant
-    = ada_variant_discrim_name (TYPE_FIELD_TYPE (type, field_num));
+    = ada_variant_discrim_name (type->field (field_num).type ());
   if (*variant == '\0')
     variant = "?";
 
@@ -633,7 +633,7 @@ print_selected_record_field_types (struct type *type, struct type *outer_type,
       if (ada_is_parent_field (type, i) || ada_is_ignored_field (type, i))
        ;
       else if (ada_is_wrapper_field (type, i))
-       flds += print_record_field_types (TYPE_FIELD_TYPE (type, i), type,
+       flds += print_record_field_types (type->field (i).type (), type,
                                          stream, show, level, flags);
       else if (ada_is_variant_part (type, i))
        {
@@ -644,7 +644,7 @@ print_selected_record_field_types (struct type *type, struct type *outer_type,
        {
          flds += 1;
          fprintf_filtered (stream, "\n%*s", level + 4, "");
-         ada_print_type (TYPE_FIELD_TYPE (type, i),
+         ada_print_type (type->field (i).type (),
                          TYPE_FIELD_NAME (type, i),
                          stream, show - 1, level + 4, flags);
          fprintf_filtered (stream, ";");
@@ -708,7 +708,7 @@ print_variant_part (const variant_part &part,
   else
     {
       name = TYPE_FIELD_NAME (type, part.discriminant_index);
-      discr_type = TYPE_FIELD_TYPE (type, part.discriminant_index);
+      discr_type = type->field (part.discriminant_index).type ();
     }
 
   fprintf_filtered (stream, "\n%*scase %s is", level + 4, "", name);
@@ -786,13 +786,13 @@ print_record_field_types (struct type *type, struct type *outer_type,
        }
       gdb_assert (prop->kind == PROP_VARIANT_PARTS);
       print_record_field_types_dynamic (*prop->data.variant_parts,
-                                       0, TYPE_NFIELDS (type),
+                                       0, type->num_fields (),
                                        type, stream, show, level, flags);
-      return TYPE_NFIELDS (type);
+      return type->num_fields ();
     }
 
   return print_selected_record_field_types (type, outer_type,
-                                           0, TYPE_NFIELDS (type) - 1,
+                                           0, type->num_fields () - 1,
                                            stream, show, level, flags);
 }
    
@@ -863,7 +863,7 @@ print_unchecked_union_type (struct type *type, struct ui_file *stream,
 {
   if (show < 0)
     fprintf_filtered (stream, "record (?) is ... end record");
-  else if (TYPE_NFIELDS (type) == 0)
+  else if (type->num_fields () == 0)
     fprintf_filtered (stream, "record (?) is null; end record");
   else
     {
@@ -871,11 +871,11 @@ print_unchecked_union_type (struct type *type, struct ui_file *stream,
 
       fprintf_filtered (stream, "record (?) is\n%*scase ? is", level + 4, "");
 
-      for (i = 0; i < TYPE_NFIELDS (type); i += 1)
+      for (i = 0; i < type->num_fields (); i += 1)
        {
          fprintf_filtered (stream, "\n%*swhen ? =>\n%*s", level + 8, "",
                            level + 12, "");
-         ada_print_type (TYPE_FIELD_TYPE (type, i),
+         ada_print_type (type->field (i).type (),
                          TYPE_FIELD_NAME (type, i),
                          stream, show - 1, level + 12, flags);
          fprintf_filtered (stream, ";");
@@ -895,7 +895,7 @@ static void
 print_func_type (struct type *type, struct ui_file *stream, const char *name,
                 const struct type_print_options *flags)
 {
-  int i, len = TYPE_NFIELDS (type);
+  int i, len = type->num_fields ();
 
   if (TYPE_TARGET_TYPE (type) != NULL
       && TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID)
@@ -920,7 +920,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
              wrap_here ("    ");
            }
          fprintf_filtered (stream, "a%d: ", i + 1);
-         ada_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0,
+         ada_print_type (type->field (i).type (), "", stream, -1, 0,
                          flags);
        }
       fprintf_filtered (stream, ")");
This page took 0.026279 seconds and 4 git commands to generate.