aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-13 13:20:22 -0600
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:38 -0600
commit9e76b17aa5a62d866d9446bcc397e35748596193 (patch)
tree297925e36b11f64e126906d08e528e643544ea33 /gdb/f-lang.c
parente727c536c6e7334484b8dcbf369fe425bd5b892a (diff)
downloadgdb-9e76b17aa5a62d866d9446bcc397e35748596193.zip
gdb-9e76b17aa5a62d866d9446bcc397e35748596193.tar.gz
gdb-9e76b17aa5a62d866d9446bcc397e35748596193.tar.bz2
Use type allocator for array types
This changes the array 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 placement of the index type of the array, which is what this patch implements. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/f-lang.c')
-rw-r--r--gdb/f-lang.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 2da50b2..365e0c0 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -137,7 +137,7 @@ fortran_bounds_all_dims (bool lbound_p,
builtin_f_type (gdbarch)->builtin_integer,
1, ndimensions);
struct type *elm_type = builtin_f_type (gdbarch)->builtin_integer;
- struct type *result_type = create_array_type (nullptr, elm_type, range);
+ struct type *result_type = create_array_type (alloc, elm_type, range);
struct value *result = value::allocate (result_type);
/* Walk the array dimensions backwards due to the way the array will be
@@ -721,7 +721,7 @@ fortran_array_shape (struct gdbarch *gdbarch, const language_defn *lang,
builtin_type (gdbarch)->builtin_int,
1, ndimensions);
struct type *elm_type = builtin_f_type (gdbarch)->builtin_integer;
- struct type *result_type = create_array_type (nullptr, elm_type, range);
+ struct type *result_type = create_array_type (alloc, elm_type, range);
struct value *result = value::allocate (result_type);
LONGEST elm_len = elm_type->length ();
@@ -1402,7 +1402,7 @@ fortran_undetermined::value_subarray (value *array,
&p_low, &p_high, 0, &p_stride,
true);
array_slice_type
- = create_array_type (nullptr, array_slice_type, new_range);
+ = create_array_type (alloc, array_slice_type, new_range);
}
if (fortran_array_slicing_debug)
@@ -1439,7 +1439,7 @@ fortran_undetermined::value_subarray (value *array,
&p_low, &p_high, 0, &p_stride,
true);
repacked_array_type
- = create_array_type (nullptr, repacked_array_type, new_range);
+ = create_array_type (alloc, repacked_array_type, new_range);
}
/* Now copy the elements from the original ARRAY into the packed