summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-13 12:53:48 -0600
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:38 -0600
commite727c536c6e7334484b8dcbf369fe425bd5b892a (patch)
treee3a36d9571d8b5f0173d0c5c02c3712371ae00e0 /gdb/gdbtypes.h
parent9c794d2d46f0605ee033107418aac2ca20f659f8 (diff)
downloadbinutils-gdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.gz
Use type allocator for range types
This changes the range type creation functions to accept a type allocator, and updates all the callers. Note that symbol readers should generally allocate on the relevant objfile, regardless of the underlying type of the range, which is what this patch implements. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 33937dd0fd6..7f94a573647 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -2473,25 +2473,38 @@ extern struct type *lookup_function_type_with_arguments (struct type *,
int,
struct type **);
-extern struct type *create_static_range_type (struct type *, struct type *,
- LONGEST, LONGEST);
+/* Create a range type using ALLOC.
+
+ Indices will be of type INDEX_TYPE, and will range from LOW_BOUND
+ to HIGH_BOUND, inclusive. */
+
+extern struct type *create_static_range_type (type_allocator &alloc,
+ struct type *index_type,
+ LONGEST low_bound,
+ LONGEST high_bound);
extern struct type *create_array_type_with_stride
(struct type *, struct type *, struct type *,
struct dynamic_prop *, unsigned int);
-extern struct type *create_range_type (struct type *, struct type *,
- const struct dynamic_prop *,
- const struct dynamic_prop *,
- LONGEST);
+/* Create a range type using ALLOC with a dynamic range from LOW_BOUND
+ to HIGH_BOUND, inclusive. INDEX_TYPE is the underlying type. BIAS
+ is the bias to be applied when storing or retrieving values of this
+ type. */
+
+extern struct type *create_range_type (type_allocator &alloc,
+ struct type *index_type,
+ const struct dynamic_prop *low_bound,
+ const struct dynamic_prop *high_bound,
+ LONGEST bias);
/* Like CREATE_RANGE_TYPE but also sets up a stride. When BYTE_STRIDE_P
is true the value in STRIDE is a byte stride, otherwise STRIDE is a bit
stride. */
-extern struct type * create_range_type_with_stride
- (struct type *result_type, struct type *index_type,
+extern struct type *create_range_type_with_stride
+ (type_allocator &alloc, struct type *index_type,
const struct dynamic_prop *low_bound,
const struct dynamic_prop *high_bound, LONGEST bias,
const struct dynamic_prop *stride, bool byte_stride_p);