]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove TYPE_ARRAY_BIT_STRIDE
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 13 Jul 2020 02:58:53 +0000 (22:58 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 13 Jul 2020 02:58:53 +0000 (22:58 -0400)
Remove it and update all callers to use the equivalent accessor methods.
A subsequent patch will make type::bit_stride work for array types
(effectively replacing this macro), but I wanted to keep this patch a
simple mechanical change.

gdb/ChangeLog:

* gdbtypes.c (TYPE_ARRAY_BIT_STRIDE): Remove.  Update all
callers to use the equivalent accessor methods.

Change-Id: I09e14bd45075f98567adce8a0b93edea7722f812

gdb/ChangeLog
gdb/f-valprint.c
gdb/gdbtypes.h
gdb/valarith.c

index 444315e9733ee1f26686dca289953e7e7b7bd946..0d54f5eb7292411f18ed7ad908699c3cda473f82 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-12  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbtypes.c (TYPE_ARRAY_BIT_STRIDE): Remove.  Update all
+       callers to use the equivalent accessor methods.
+
 2020-07-12  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (struct range_bounds) <bit_stride>: New method.
index bda48037651025cd66bae8e1616e78c55c1a912b..17e15f9bdff651ae6d17e4bcb9475af211af1652 100644 (file)
@@ -124,7 +124,8 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
       struct gdbarch *gdbarch = get_type_arch (type);
       size_t dim_size = type_length_units (TYPE_TARGET_TYPE (type));
       int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
-      size_t byte_stride = TYPE_ARRAY_BIT_STRIDE (type) / (unit_size * 8);
+      size_t byte_stride
+       = type->index_type ()->bounds ()->bit_stride () / (unit_size * 8);
       if (byte_stride == 0)
        byte_stride = dim_size;
       size_t offs = 0;
index bf6b270515ff335de020cf54508902bc6aeaf47f..d8ddc41613914a78064b0165e4737ac68276bfb9 100644 (file)
@@ -1633,13 +1633,6 @@ extern bool set_type_align (struct type *, ULONGEST);
 #define TYPE_DYN_PROP_KIND(dynprop) \
   (dynprop->kind ())
 
-
-/* Accessors for struct range_bounds data attached to an array type's
-   index type.  */
-
-#define TYPE_ARRAY_BIT_STRIDE(arraytype) \
-  ((arraytype)->index_type ()->bounds ()->bit_stride ())
-
 /* C++ */
 
 #define TYPE_SELF_TYPE(thistype) internal_type_self_type (thistype)
index 0b1f43f2e009e23921b67527b81adc9d38ce461c..775c603a8c32b4559e37869681ca0d4c31a34af2 100644 (file)
@@ -191,7 +191,7 @@ value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound
 
   /* Fetch the bit stride and convert it to a byte stride, assuming 8 bits
      in a byte.  */
-  LONGEST stride = TYPE_ARRAY_BIT_STRIDE (array_type);
+  LONGEST stride = array_type->index_type ()->bounds ()->bit_stride ();
   if (stride != 0)
     {
       struct gdbarch *arch = get_type_arch (elt_type);