aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-07-12 22:58:53 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-07-12 22:58:53 -0400
commitbb789949e90d4580ce0ce9034c632d3e7f39a0ac (patch)
tree42a4e88c0c35addf4a1aa86c2a0fa54a716548bd
parent39498edbc850409c332dd5be60a82d1bf704bc8f (diff)
downloadgdb-bb789949e90d4580ce0ce9034c632d3e7f39a0ac.zip
gdb-bb789949e90d4580ce0ce9034c632d3e7f39a0ac.tar.gz
gdb-bb789949e90d4580ce0ce9034c632d3e7f39a0ac.tar.bz2
gdb: remove TYPE_ARRAY_{LOWER,UPPER}_BOUND_VALUE
Remove the macros, use the various equivalent getters instead. gdb/ChangeLog: * gdbtypes.h (TYPE_ARRAY_LOWER_BOUND_VALUE, TYPE_ARRAY_UPPER_BOUND_VALUE): Remove. Update all callers to use the equivalent accessor methods instead. Change-Id: I7f96d988f872170e7a2f58095832710e62b85cfd
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c4
-rw-r--r--gdb/f-valprint.c4
-rw-r--r--gdb/gdbtypes.h6
-rw-r--r--gdb/p-typeprint.c4
5 files changed, 12 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e17a61e..ab2b777 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2020-07-12 Simon Marchi <simon.marchi@efficios.com>
+ * gdbtypes.h (TYPE_ARRAY_LOWER_BOUND_VALUE,
+ TYPE_ARRAY_UPPER_BOUND_VALUE): Remove. Update all
+ callers to use the equivalent accessor methods instead.
+
+2020-07-12 Simon Marchi <simon.marchi@efficios.com>
+
* gdbtypes.h (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED,
TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): Remove. Update all
callers to use the equivalent accessor methods instead.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 8d0b6c2..3d85a5a 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -9492,8 +9492,8 @@ assign_aggregate (struct value *container,
{
lhs = ada_coerce_to_simple_array (lhs);
lhs_type = check_typedef (value_type (lhs));
- low_index = TYPE_ARRAY_LOWER_BOUND_VALUE (lhs_type);
- high_index = TYPE_ARRAY_UPPER_BOUND_VALUE (lhs_type);
+ low_index = lhs_type->index_type ()->bounds ()->low.const_val ();
+ high_index = lhs_type->index_type ()->bounds ()->high.const_val ();
}
else if (lhs_type->code () == TYPE_CODE_STRUCT)
{
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 05f98bc..bda4803 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -49,7 +49,7 @@ f77_get_lowerbound (struct type *type)
if (type->index_type ()->bounds ()->low.kind () == PROP_UNDEFINED)
error (_("Lower bound may not be '*' in F77"));
- return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
+ return type->index_type ()->bounds ()->low.const_val ();
}
LONGEST
@@ -65,7 +65,7 @@ f77_get_upperbound (struct type *type)
return f77_get_lowerbound (type);
}
- return TYPE_ARRAY_UPPER_BOUND_VALUE (type);
+ return type->index_type ()->bounds ()->high.const_val ();
}
/* Obtain F77 adjustable array dimensions. */
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 83432b6..26db793 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1628,12 +1628,6 @@ extern bool set_type_align (struct type *, ULONGEST);
/* Accessors for struct range_bounds data attached to an array type's
index type. */
-#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
- ((arraytype)->index_type ()->bounds ()->high.const_val ())
-
-#define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
- ((arraytype)->index_type ()->bounds ()->low.const_val ())
-
#define TYPE_ARRAY_BIT_STRIDE(arraytype) \
(TYPE_BIT_STRIDE(((arraytype)->index_type ())))
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index 5a32667..d52358a 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -276,8 +276,8 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
&& type->index_type ()->bounds ()->high.kind () != PROP_UNDEFINED)
fprintf_filtered (stream, "[%s..%s] ",
- plongest (TYPE_ARRAY_LOWER_BOUND_VALUE (type)),
- plongest (TYPE_ARRAY_UPPER_BOUND_VALUE (type)));
+ plongest (type->index_type ()->bounds ()->low.const_val ()),
+ plongest (type->index_type ()->bounds ()->high.const_val ()));
fprintf_filtered (stream, "of ");
break;