aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-exp.y
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/f-exp.y
parent9c794d2d46f0605ee033107418aac2ca20f659f8 (diff)
downloadgdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.zip
gdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.gz
gdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.bz2
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/f-exp.y')
-rw-r--r--gdb/f-exp.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 30da537..9ff8e19 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -669,10 +669,11 @@ ptype : typebase
array_size = type_stack->pop_int ();
if (array_size != -1)
{
+ struct type *idx_type
+ = parse_f_type (pstate)->builtin_integer;
+ type_allocator alloc (idx_type);
range_type =
- create_static_range_type ((struct type *) NULL,
- parse_f_type (pstate)
- ->builtin_integer,
+ create_static_range_type (alloc, idx_type,
0, array_size - 1);
follow_type =
create_array_type ((struct type *) NULL,