refactoring: rename create_range_type to create_static_range_type
authorSanimir Agovic <sanimir.agovic@intel.com>
Thu, 19 Dec 2013 08:31:17 +0000 (08:31 +0000)
committerSanimir Agovic <sanimir.agovic@intel.com>
Fri, 11 Apr 2014 12:43:45 +0000 (13:43 +0100)
* gdbtypes.c (create_static_range_type): Renamed from create_range_type.
* gdbtypes.h (create_static_range_type): Renamed from create_range_type.
* ada-lang.c: All uses of create_range_type updated.
* coffread.c: All uses of create_range_type updated.
* dwarf2read.c: All uses of create_range_type updated.
* f-exp.y: All uses of create_range_type updated.
* m2-valprint.c: All uses of create_range_type updated.
* mdebugread.c: All uses of create_range_type updated.
* stabsread.c: All uses of create_range_type updated.
* valops.c: All uses of create_range_type updated.
* valprint.c: All uses of create_range_type updated.

12 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/coffread.c
gdb/dwarf2read.c
gdb/f-exp.y
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/m2-valprint.c
gdb/mdebugread.c
gdb/stabsread.c
gdb/valops.c
gdb/valprint.c

index 45a94a87e9ff3ddf6af69e3227885499fe911997..47230c5a3d2fa00a306bd34f86b7faa1d665ef52 100644 (file)
@@ -1,3 +1,17 @@
+2014-04-11  Sanimir Agovic  <sanimir.agovic@intel.com>
+
+       * gdbtypes.c (create_static_range_type): Renamed from create_range_type.
+       * gdbtypes.h (create_static_range_type): Renamed from create_range_type.
+       * ada-lang.c: All uses of create_range_type updated.
+       * coffread.c: All uses of create_range_type updated.
+       * dwarf2read.c: All uses of create_range_type updated.
+       * f-exp.y: All uses of create_range_type updated.
+       * m2-valprint.c: All uses of create_range_type updated.
+       * mdebugread.c: All uses of create_range_type updated.
+       * stabsread.c: All uses of create_range_type updated.
+       * valops.c: All uses of create_range_type updated.
+       * valprint.c: All uses of create_range_type updated.
+
 2014-04-10  Pedro Alves  <palves@redhat.com>
 
        * breakpoint.c (single_step_breakpoints)
index 71827ae0f6f8dd882633208e1aa18e5bf2836eeb..95447585964b80eacf9b64c88a59814b5086fbd9 100644 (file)
@@ -1981,9 +1981,9 @@ ada_type_of_array (struct value *arr, int bounds)
           struct value *high = desc_one_bound (descriptor, arity, 1);
 
           arity -= 1;
-          create_range_type (range_type, value_type (low),
-                             longest_to_int (value_as_long (low)),
-                             longest_to_int (value_as_long (high)));
+          create_static_range_type (range_type, value_type (low),
+                                   longest_to_int (value_as_long (low)),
+                                   longest_to_int (value_as_long (high)));
           elt_type = create_array_type (array_type, elt_type, range_type);
 
          if (ada_is_unconstrained_packed_array_type (value_type (arr)))
@@ -2754,9 +2754,10 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type,
   CORE_ADDR base = value_as_address (array_ptr)
     + ((low - ada_discrete_type_low_bound (TYPE_INDEX_TYPE (type0)))
        * TYPE_LENGTH (TYPE_TARGET_TYPE (type0)));
-  struct type *index_type =
-    create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type0)),
-                       low, high);
+  struct type *index_type
+    = create_static_range_type (NULL,
+                               TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type0)),
+                               low, high);
   struct type *slice_type =
     create_array_type (NULL, TYPE_TARGET_TYPE (type0), index_type);
 
@@ -2768,8 +2769,8 @@ static struct value *
 ada_value_slice (struct value *array, int low, int high)
 {
   struct type *type = ada_check_typedef (value_type (array));
-  struct type *index_type =
-    create_range_type (NULL, TYPE_INDEX_TYPE (type), low, high);
+  struct type *index_type
+    = create_static_range_type (NULL, TYPE_INDEX_TYPE (type), low, high);
   struct type *slice_type =
     create_array_type (NULL, TYPE_TARGET_TYPE (type), index_type);
 
@@ -2980,9 +2981,9 @@ static struct value *
 empty_array (struct type *arr_type, int low)
 {
   struct type *arr_type0 = ada_check_typedef (arr_type);
-  struct type *index_type =
-    create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (arr_type0)),
-                       low, low - 1);
+  struct type *index_type
+    = create_static_range_type
+        (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (arr_type0)),  low, low - 1);
   struct type *elt_type = ada_array_element_type (arr_type0, 1);
 
   return allocate_value (create_array_type (NULL, elt_type, index_type));
@@ -11120,9 +11121,8 @@ to_fixed_range_type (struct type *raw_type, struct value *dval)
       if (L < INT_MIN || U > INT_MAX)
        return raw_type;
       else
-       return create_range_type (alloc_type_copy (raw_type), raw_type,
-                                 ada_discrete_type_low_bound (raw_type),
-                                 ada_discrete_type_high_bound (raw_type));
+       return create_static_range_type (alloc_type_copy (raw_type), raw_type,
+                                        L, U);
     }
   else
     {
@@ -11185,7 +11185,8 @@ to_fixed_range_type (struct type *raw_type, struct value *dval)
             }
         }
 
-      type = create_range_type (alloc_type_copy (raw_type), base_type, L, U);
+      type = create_static_range_type (alloc_type_copy (raw_type),
+                                      base_type, L, U);
       TYPE_NAME (type) = name;
       return type;
     }
index 44d77f09116d3dea976d3d84ee21e9f166bf5cd5..c650d61e4df4eae5213d7477f1cf8cf24eeb09b0 100644 (file)
@@ -1842,9 +1842,9 @@ decode_type (struct coff_symbol *cs, unsigned int c_type,
 
          base_type = decode_type (cs, new_c_type, aux, objfile);
          index_type = objfile_type (objfile)->builtin_int;
-         range_type =
-           create_range_type ((struct type *) NULL, 
-                              index_type, 0, n - 1);
+         range_type
+           = create_static_range_type ((struct type *) NULL,
+                                       index_type, 0, n - 1);
          type =
            create_array_type ((struct type *) NULL, 
                               base_type, range_type);
index d15650492847435d78fe59bad721d8a11b6bd2f0..a575b8210f983e8020b21f02c9b19ab2c207c8b9 100644 (file)
@@ -13377,7 +13377,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
   if (die->child == NULL)
     {
       index_type = objfile_type (objfile)->builtin_int;
-      range_type = create_range_type (NULL, index_type, 0, -1);
+      range_type = create_static_range_type (NULL, index_type, 0, -1);
       type = create_array_type_with_stride (NULL, element_type, range_type,
                                            bit_stride);
       return set_die_type (die, type, cu);
@@ -14088,7 +14088,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   index_type = objfile_type (objfile)->builtin_int;
-  range_type = create_range_type (NULL, index_type, 1, length);
+  range_type = create_static_range_type (NULL, index_type, 1, length);
   char_type = language_string_char_type (cu->language_defn, gdbarch);
   type = create_string_type (NULL, char_type, range_type);
 
@@ -14560,7 +14560,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
   if (!TYPE_UNSIGNED (base_type) && (high & negative_mask))
     high |= negative_mask;
 
-  range_type = create_range_type (NULL, orig_base_type, low, high);
+  range_type = create_static_range_type (NULL, orig_base_type, low, high);
 
   /* Mark arrays with dynamic length at least as an array of unspecified
      length.  GDB could check the boundary but before it gets implemented at
index 3deaf3017702e7a22525242bc44b97c4c8755f56..c70da17926889df149667bc650dd9884fc07673c 100644 (file)
@@ -1,3 +1,4 @@
+
 /* YACC parser for Fortran expressions, for GDB.
    Copyright (C) 1986-2014 Free Software Foundation, Inc.
 
@@ -577,10 +578,10 @@ ptype     :       typebase
                        if (array_size != -1)
                          {
                            range_type =
-                             create_range_type ((struct type *) NULL,
-                                                parse_f_type (pstate)
-                                                ->builtin_integer,
-                                                0, array_size - 1);
+                             create_static_range_type ((struct type *) NULL,
+                                                       parse_f_type (pstate)
+                                                       ->builtin_integer,
+                                                       0, array_size - 1);
                            follow_type =
                              create_array_type ((struct type *) NULL,
                                                 follow_type, range_type);
index 98cb873ee8ac36e5003e1c8476fec4f0b1902f60..7f1645a049b1bed3a84219a573ee701dde150cbf 100644 (file)
@@ -809,8 +809,8 @@ allocate_stub_method (struct type *type)
    sure it is TYPE_CODE_UNDEF before we bash it into a range type?  */
 
 struct type *
-create_range_type (struct type *result_type, struct type *index_type,
-                  LONGEST low_bound, LONGEST high_bound)
+create_static_range_type (struct type *result_type, struct type *index_type,
+                         LONGEST low_bound, LONGEST high_bound)
 {
   if (result_type == NULL)
     result_type = alloc_type_copy (index_type);
@@ -1019,7 +1019,7 @@ lookup_array_range_type (struct type *element_type,
   struct gdbarch *gdbarch = get_type_arch (element_type);
   struct type *index_type = builtin_type (gdbarch)->builtin_int;
   struct type *range_type
-    = create_range_type (NULL, index_type, low_bound, high_bound);
+    = create_static_range_type (NULL, index_type, low_bound, high_bound);
 
   return create_array_type (NULL, element_type, range_type);
 }
index c6943ef775b82b2c4e07063aea717878c031daba..b5fb5640c9a80d590d160e071db531c62205c43d 100644 (file)
@@ -1625,8 +1625,8 @@ extern struct type *lookup_function_type_with_arguments (struct type *,
                                                         int,
                                                         struct type **);
 
-extern struct type *create_range_type (struct type *, struct type *, LONGEST,
-                                      LONGEST);
+extern struct type *create_static_range_type (struct type *, struct type *,
+                                             LONGEST, LONGEST);
 
 extern struct type *create_array_type_with_stride
   (struct type *, struct type *, struct type *, unsigned int);
index 766ca10a860daeba2bf441102ef033db9fc593af..f8ac141f063ae181b3d0211d7fd11a277c424187 100644 (file)
@@ -475,7 +475,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
                        address, stream, recurse, original_value, options);
          break;
        }
-      /* FIXME: create_range_type does not set the unsigned bit in a
+      /* FIXME: create_static_range_type does not set the unsigned bit in a
          range type (I think it probably should copy it from the target
          type), so we won't print values which are too large to
          fit in a signed integer correctly.  */
index 94af07b19cfc1f6f2eb83c32183a77ecd3d2f0c7..c03ac6793e9d2de1a6d8f37a815ed32933bc4ca5 100644 (file)
@@ -1869,8 +1869,8 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
       ax++;
       rf = AUX_GET_WIDTH (bigend, ax); /* bit size of array element */
 
-      range = create_range_type ((struct type *) NULL, indx,
-                                lower, upper);
+      range = create_static_range_type ((struct type *) NULL, indx,
+                                       lower, upper);
 
       t = create_array_type ((struct type *) NULL, *tpp, range);
 
index b40cf78f49c064ace4b9059f4038c7d0612ae389..592350e0feac1e2ec769a129422974516e7b35cf 100644 (file)
@@ -863,9 +863,9 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
            /* NULL terminate the string.  */
            string_local[ind] = 0;
            range_type
-             = create_range_type (NULL,
-                                  objfile_type (objfile)->builtin_int,
-                                  0, ind);
+             = create_static_range_type (NULL,
+                                         objfile_type (objfile)->builtin_int,
+                                         0, ind);
            SYMBOL_TYPE (sym) = create_array_type (NULL,
                                  objfile_type (objfile)->builtin_char,
                                  range_type);
@@ -3615,7 +3615,7 @@ read_array_type (char **pp, struct type *type,
     }
 
   range_type =
-    create_range_type ((struct type *) NULL, index_type, lower, upper);
+    create_static_range_type ((struct type *) NULL, index_type, lower, upper);
   type = create_array_type (type, element_type, range_type);
 
   return type;
@@ -4245,7 +4245,8 @@ handle_true_range:
       index_type = objfile_type (objfile)->builtin_int;
     }
 
-  result_type = create_range_type ((struct type *) NULL, index_type, n2, n3);
+  result_type
+    = create_static_range_type ((struct type *) NULL, index_type, n2, n3);
   return (result_type);
 }
 
index cf195a34677b84c84a29abe209a9893dba2f0ef2..1fa188fc8b9d442aafc38678bf8cf032e91eeda9 100644 (file)
@@ -413,10 +413,10 @@ value_cast (struct type *type, struct value *arg2)
                       "divide object size in cast"));
          /* FIXME-type-allocation: need a way to free this type when
             we are done with it.  */
-         range_type = create_range_type ((struct type *) NULL,
-                                         TYPE_TARGET_TYPE (range_type),
-                                         low_bound,
-                                         new_length + low_bound - 1);
+         range_type = create_static_range_type ((struct type *) NULL,
+                                                TYPE_TARGET_TYPE (range_type),
+                                                low_bound,
+                                                new_length + low_bound - 1);
          deprecated_set_value_type (arg2, 
                                     create_array_type ((struct type *) NULL,
                                                        element_type, 
@@ -3569,10 +3569,10 @@ value_slice (struct value *array, int lowbound, int length)
 
   /* FIXME-type-allocation: need a way to free this type when we are
      done with it.  */
-  slice_range_type = create_range_type ((struct type *) NULL,
-                                       TYPE_TARGET_TYPE (range_type),
-                                       lowbound,
-                                       lowbound + length - 1);
+  slice_range_type = create_static_range_type ((struct type *) NULL,
+                                              TYPE_TARGET_TYPE (range_type),
+                                              lowbound,
+                                              lowbound + length - 1);
 
   {
     struct type *element_type = TYPE_TARGET_TYPE (array_type);
index 2f6ff94cb535bfc727495a1c5e810d80e9cbdf15..fe2353063765a5f4bf5d149140555013856eeda7 100644 (file)
@@ -597,7 +597,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
       break;
 
     case TYPE_CODE_RANGE:
-      /* FIXME: create_range_type does not set the unsigned bit in a
+      /* FIXME: create_static_range_type does not set the unsigned bit in a
          range type (I think it probably should copy it from the
          target type), so we won't print values which are too large to
          fit in a signed integer correctly.  */
This page took 0.048269 seconds and 4 git commands to generate.