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>
This commit is contained in:
Tom Tromey
2023-03-13 12:53:48 -06:00
parent 9c794d2d46
commit e727c536c6
11 changed files with 92 additions and 65 deletions

View File

@ -831,7 +831,8 @@ read_array_type (struct ctf_context *ccp, ctf_id_t tid)
if (idx_type == nullptr)
idx_type = objfile_type (objfile)->builtin_int;
range_type = create_static_range_type (NULL, idx_type, 0, ar.ctr_nelems - 1);
type_allocator alloc (objfile);
range_type = create_static_range_type (alloc, idx_type, 0, ar.ctr_nelems - 1);
type = create_array_type (NULL, element_type, range_type);
if (ar.ctr_nelems <= 1) /* Check if undefined upper bound. */
{