diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-13 12:53:48 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-18 11:12:38 -0600 |
commit | e727c536c6e7334484b8dcbf369fe425bd5b892a (patch) | |
tree | e3a36d9571d8b5f0173d0c5c02c3712371ae00e0 /gdb/stabsread.c | |
parent | 9c794d2d46f0605ee033107418aac2ca20f659f8 (diff) | |
download | fsf-binutils-gdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.zip fsf-binutils-gdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.gz fsf-binutils-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/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 7ed0ebf..1e96102 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -877,8 +877,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, /* NULL terminate the string. */ string_local[ind] = 0; + type_allocator alloc (objfile); range_type - = create_static_range_type (NULL, + = create_static_range_type (alloc, objfile_type (objfile)->builtin_int, 0, ind); sym->set_type @@ -3547,8 +3548,9 @@ read_array_type (const char **pp, struct type *type, upper = -1; } + type_allocator alloc (objfile); range_type = - create_static_range_type (NULL, index_type, lower, upper); + create_static_range_type (alloc, index_type, lower, upper); type = create_array_type (type, element_type, range_type); return type; @@ -4180,7 +4182,7 @@ handle_true_range: } result_type - = create_static_range_type (NULL, index_type, n2, n3); + = create_static_range_type (alloc, index_type, n2, n3); return (result_type); } |